[vtkusers] re ad a raw file (32-bit signed integers) with vtkImageReader

Jérôme jerome.velut at gmail.com
Mon Oct 19 07:27:19 EDT 2009


Hi,

First of all, I thought that unsigned short are 2 bytes integers. Correct me
if I mistake!
Then, could you give more precision on what doesn't work? Do you get a VTK
error message, an empty volume, a segfault, or something else?

Best regards,
Jerome

2009/10/19 Orlinn <MeinDatenLaufwerk at googlemail.com>

>
> hello VTK world,
>
> i have a raw(32-bit signed integers) file which contains my images.
> From the 4 bytes i need only the 2 last bytes, i thought i can set a mask
> like 0x00FF.
> but it does not work. I use the the class vtkImageReader.
> When i try with 16 and 8 bit raw files, it works.
>
> this is my code
>                vtkImageReader rawreader= new vtkImageReader();
>                rawRedaer.SetFileName("C:/Desktop/rawFile.dat");
>                rawReader.SetDataExtent(0, 511, 0, 511, 0, 249);
>                rawReader.SetDataScalarTypeToUnsignedShort();
>                rawReader.SetDataByteOrderToBigEndian();
>                rawReader.SetFileDimensionality(3);
>                rawReader.SetDataSpacing(0.40234375, 0.40234375, 0.5);
>                rawReader.SetNumberOfScalarComponents(1);
>                rawReader.Update();
>
> can somebody tell me what i have to add????
>
> sorry for my english and my VTK knowledge
>
> thank you
> --
> View this message in context:
> http://www.nabble.com/read-a-raw-file-%2832-bit-signed-integers%29-with-vtkImageReader-tp25956561p25956561.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091019/2c1e9134/attachment.htm>


More information about the vtkusers mailing list