[vtkusers] need your help: about visualization of color image

Yixun Liu yxliu at fudan.edu.cn
Mon Nov 22 01:46:40 EST 2004


Hi,

I have a 112*128*300 tiff images(24bit, r,g,b) and I want to visualize it. However, I do not know how to visualize the color image.

 vtkTIFFReader *reader =vtkTIFFReader::New();
 reader->SetFilePrefix(".\\Data\\brain(112x128)\\brain");
 reader->SetFilePattern("%s%d.tif");
 reader->SetDataExtent(0,111,0,127,1,300);
 reader->SetDataSpacing(1.2,1.2,0.5);
 reader->SetNumberOfScalarComponents(3);
 reader->SetDataScalarType(VTK_UNSIGNED_CHAR);

 vtkVolumeRayCastCompositeFunction *compositeFunction = vtkVolumeRayCastCompositeFunction::New();

 vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();
 volumeMapper->SetInput(reader->GetOutput());
 volumeMapper->SetVolumeRayCastFunction(compositeFunction);

the result is very strange and looks like a gray instead of a color result.

Hope your reply!

Thank you in advances!

Best regards,

Yixun Liu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041122/c0caeb13/attachment.htm>


More information about the vtkusers mailing list