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

dk-80 at gmx.de dk-80 at gmx.de
Thu Jun 4 09:33:37 EDT 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapshot.jpg
Type: image/jpeg
Size: 68906 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090604/eab8061d/attachment.jpg>


More information about the vtkusers mailing list