[vtkusers] lookup table of vtkImageActor?

Matthieu Chabanas Matthieu.Chabanas at imag.fr
Sat Mar 9 15:28:17 EST 2002


Hello,

I want to display slices in a 3D scene with other objects.
I have tried to use vtkImageActor, which looks better than
vtkImageMapper and vtkActor2D since I can interact with the image:
rotate, zoom, ...
Am I right on this point?

Then I have two problems:

i) vtkImageActor with 12 bits images
It looks like vtkImageActor requires unsigned char images.
I use CT images, with 4096 grey level (12 bits), but 16 bits are
allocated. I transformed them to 8 bits this way:
	
	vtkImageShiftScale * imShiftScale = vtkImageShiftScale::New();
	imShiftScale->SetInput(imageVolume->getAxialSlices());
	// 4096/65536 = 1/16, scaling to use all of the 16 bits instead of 12
	imShiftScale->SetScale(1.0/16);	
	// cast to 8 bits
	imShiftScale->SetOutputScalarTypeToUnsignedChar();

	vtkImageActor * imActor = vtkImageActor::New();
	imActor->SetInput(imShiftScale->GetOutput());

Is there a better solution?
Is it possible to use vtkImageActor with vtkImageData of type unsigned
short, non only unsigned char?


ii) How can I control the lookup table (level and window) of the
vtkImageActor??
I would like to control the image intensity but, unlike with usual
vtkActors, there is no properties or mapper associated to this actor.
Hence, can I change the level and window of the image lut?
I found out how to do it with vtkImageViewer, but it's only 2D...


I still use vtk 3.2, would vtk 4.0 be better for this?

Thanks for any help!
a+
Matt



More information about the vtkusers mailing list