[vtkusers] 3D volume problem with vtkImageReader reading RAW file

Jérôme jerome.velut at gmail.com
Thu Jun 4 16:28:52 EDT 2009


Hi,

I see that you use a vtkDataSetMapper. vtkDataSet is a high level class in
the vtk hierarchy that represents data. Therefore, the render process is not
able to "choose" a better specialized rendering, e.g is it a mesh or a
volume or a graph or ... ?

Take a look at a vtkVolumeMapper for a volume rendering, or the widget
vtkmagePlaneWidget if you wish to slice the data.

Hope that helps,
Jerome

2009/6/4 -Daniel- <dk-80 at gmx.de>

>
> Hello,
>
> I wrote in my last message
> >     reader.SetDataScalarTypeToUnsignedChar();
> but the raw format is "16bits unsigned". <Thanks burlen>
> Therefore I changed this to:
>      reader.SetDataScalarTypeToUnsignedShort();
>
> But that won't solve my case. The result is a colorized cube.
> Please look at the attached picture.
> http://www.nabble.com/file/p23875911/snapshot_1.jpg snapshot_1.jpg
>
> Any ideas about a Solution is welcomed, thanks!
>
>
>
> -Daniel- wrote:
> >
> > Hi all,
> >
> > I want to read a 3D raw file (512x512x151) of a head with vtkImageReader.
> > But the result is a cube and this is wrong. It should be a 3D volume.
> > Please look at the attached picture.
> >
> > information about this raw file:
> >       16bits unsigned
> >         BigEndian
> >         min 0 max 4096 (12 bits)
> >       Dimensions: 512x512x151
> >       voxel size: 0.4863 0.4863 1 (mm)
> >
> > My java-code is following:
> >       vtkImageReader reader = new vtkImageReader();
> >       reader.SetFileName(file);
> >       reader.SetFileDimensionality(3);
> >       reader.SetDataExtent(0,511,0,511,0,150);
> >       reader.SetDataSpacing(0.4863, 0.4863, 1);
> >       reader.SetDataByteOrderToBigEndian();
> >       reader.SetDataScalarTypeToUnsignedChar();
> >       reader.Update();
> >
> >       vtkDataSetMapper map = new vtkDataSetMapper();
> >       map.SetInputConnection(reader.GetOutputPort());
> >
> >
> > what's wrong in my code? and how I can create a volume?
> > thanks in advance,
> >
> > Daniel
> >
> > --
> > GMX FreeDSL mit DSL 6.000 Flatrate und Telefonanschluss nur 17,95
> > Euro/mtl.!
> >
> http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a
> >
> >
> > _______________________________________________
> > 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
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/3D-volume-problem-with-vtkImageReader-reading-RAW-file-tp23870080p23875911.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/20090604/124da8b9/attachment.htm>


More information about the vtkusers mailing list