[vtkusers] Cannot open with vtkTIFFReader 32 bit TIFFs.

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Aug 28 08:22:57 EDT 2008


Looking at the code for:

TIFFRGBAImageOK

in ./Utilities/vtktiff/tif_getimage.c, I can see that 32bits is not handled:

    switch (td->td_bitspersample) {
    case 1: case 2: case 4:
    case 8: case 16:
        break;
    default:
        sprintf(emsg, "Sorry, can not handle images with %d-bit samples",
            td->td_bitspersample);
        return (0);
    }


I do not know how ImageJ is handling your 32bits image, but at least
in VTK, this is not straightforward. If you can use another file
format.

sorry
-Mathieu

2008/8/28 D_E <D_E at ukr.net>:
> Here is the sample image: http://efa.hotbox.ru/temp/sm_32b.tif
> And here is its 8bit version: http://efa.hotbox.ru/temp/sm_8b.tif
>
> 32bit TIFF can be opened/saved with ImageJ, and such images I write with VTK. But oppening with VTK is not working. :(
>
> Thank you very much for answering!
>
>>   Where can I download such an image ?
>
>> thx
>
>
>> On Wed, Aug 27, 2008 at 8:00 PM, D_E <D_E at ukr.net> wrote:
>>> Dear Vtk Users,
>
>>> I'm trying to load 32 bit TIFF (type float or real) with vtkTIFFReader. It  show me right data dimensions and data type, but I cannot get any data from this reader. When I'm opening the same file with vtkImageReader2  with corresponding skipping of header - everything is OK. When I'm using the same vtkTIFFReader pipeline for 8 bit data - everithing is OK too. The 32 bit TIFFs are generated with ImageJ program or vtkTIFFWriter. I'm using VTK 5.0.3 under Windows XP with Borland Turbo C++.
>
>>> Here is an example of pipeline:
>
>>> vtkTIFFReader *inpImag2 = vtkTIFFReader::New();
>>>  inpImag2->SetFileName("pic.tif");
>>>  inpImag2->Update();
>>>  inpImag2->UpdateWholeExtent();
>>> vtkImageData *Im->DeepCopy(inpImag2->GetOutput());
>
>>> The data in the image is empty.
>>> As I said if I use the same pipeline with vtkImageReader2 adding information about DataExtent and HeaderSize - it is working!
>>> Unfortunately header can be placed anywhere in TIFF, so I really need to use proper TIFF reader, but it is not working. :(
>
>>> Can somebody advise me how to make it work?
>>> Thank you!
>
>
>>> Best regards,
>>> D_E.
>
>>> _______________________________________________
>>> This is the private VTK discussion list.
>>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>
>
>
>
> --
> С уважением,
>  D_E                          mailto:D_E at Ukr.net
>
>



-- 
Mathieu


More information about the vtkusers mailing list