[Insight-users] Help with the RGB voxel visualization

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 13 17:34:15 EDT 2004


Hi Patrick,

Please update your CVS checkout of Insight and your
CVS checkout of InsightApplications.

A new example was committed this week illustrating
how to load an ITK RGB image and display it with VTK.

You will find this new example under

  InsightApplications/Auxiliary/vtk/
                 itkReadITKImageShowVTK.cxx

It is important that you update both Insight and
InsightApplications since a bug was fixed in the
VTKImageExport filter. That bug was preventing
multicomponent ITK image from being exported
correctly to VTK.



Regards,



    Luis


---------------------------
Patrick (Peng) Cheng wrote:

> Hi
> I want to use a vtkImagePlaneWidget to make a slice view of a volume data (Voxel type is RGB)
> It seems that it can't display it correctly, it only maps the first component of the voxel.
> When I use a cutter and a polydatamapper, it can get the right color image, but I want the nice interaction feature of the vtkImagePlaneWidget.
> 
> I also tried to convert the three RGB values into a single scalar value by the following equation:
> unsigned long ScalarValue = r*65536+g*256+b;		(r,g,b are unsigned char)
> 
> and then built up a lookup table as follows:
> vtkLookupTable *lut = vtkLookupTable::New();
> 	lut->SetNumberOfColors(256*256*256);
> 	lut->Build();
> 	for(int r=0;r<256;r++){
> 		for(int g=0;g<256;g++){
> 			for(int b=0;b<256;b++){
> 				lut->SetTableValue(r*65536+g*256+b,r/255,g/255,b/255,1);	
> 			}			
> 		}
> 	}
> It takes a long time to do this, still the result is not right. the whole image looks white.
> How can I get the image displayed correctly?
> Thanks a lot!
> 
> Patrick
> 
> 
> ---------------------------
> Peng (Patrick) Cheng
> Biomedical Engineering
> University of Iowa
> Tel:(319) 400-7442
> Email: peng-cheng at uiowa.edu
> 
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list