[vtkusers] Please help to make 3D image...

Amy Henderson amy.henderson at kitware.com
Wed Nov 3 08:48:48 EST 2004


At 10:09 PM 11/2/2004, =?ks_c_5601-1987?B?wMwguO3Ixg==?= wrote:
>Hi.
>I'd like to make 3D image use to vtkImageData.. but failed...
>Array buffer has all data as 'DataSizeX * DataSizeY * DataSizeZ'
>This coding display only one section image for DataSize = 1
>Not 3D image, but 2D image in DataSize == 1
>please Help this problem...
>
>
>vtkImageData *multiVol = vtkImageData::New();
>multiVol->SetDimensions(DataSizeX, DataSizeY, DataSizeZ);
>multiVol->SetSpacing(1, 1, 10);
>multiVol->SetOrigin(0, 0, 0);
>multiVol->SetScalarType(VTK_UNSIGNED_CHAR);
>multiVol->GetPointData()->SetScalars(array);
>
>vtkImageMapToColors *mapColor = vtkImageMapToColors::New();
>mapColor->SetInput(multiVol);
>mapColor->SetLookupTable(lutScaleColor);
>
>vtkImageActor *imageActor = vtkImageActor::New();
>imageActor->SetInput(mapColor->GetOutput());
>

vtkImageActor is intended to display a 2D image (or a 2D slice of a 3D 
image).  If you want to display your image data as a 3D volume, you 
probably want to use vtkVolume instead of vtkImageActor.  The 
Doxygen-generated web page for this class is here: 
http://www.vtk.org/doc/nightly/html/classvtkVolume.html.



>And one question... ^^;;
>ContourFilter::SetValue(int i, float value) what means variable 'i' and 
>'value'

"i" is the index of the contour. If you were generating 10 contours with 
the contour filter, then the value of "i" would be between 0 and 9.
"value" is the value at which you wish to extract a contour (isosurface).

>Thank you....
>
>_________________________________________________________________
>½Î°Ô ½Î°Ô MSN°øµ¿±¸¸Å
>http://www.waawaa.com/cobuy/cobuy_default.asp?siteid=10160
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic. 
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list