[vtkusers] vtkOpenGLVolumeTextureMapper3D: color problems, please help

Frank Gao gao at mdimaging.com
Mon Feb 5 18:01:48 EST 2007


VTK/OpenGL gurus,

I have a very basic question for volume rendering. For image type 'short',
is there any way to tell VTK or OpenGL that certain scalar value (such
as -1024) indicates that a voxel is outside of the target object (a
segmented tissue/organ). The reason I asked this is that I am having a tough
problem with vtkOpenGLVolumeTextureMapper3D.

What I tried to do is to render a volume dataset as gray/white.
What I always got was the surface of the model was all greenish (or whatever
color I selected for voxels outside of the segmented tissue).

 My code could be described as below:

1.Have a 3D dicom CT dataset. The image type is "short"
2. Do a region growth to extract a tissue, and mark the voxels out of the
tissue with scalar value -1024.
3. Set color map, -1024 for green, and other scalar values are mapped to a
range from gray to white
4. Set opacity map: -1024 for opacity 0. Opacity value 1 for other scalar
values.
5. Set volume property interpolation mode to LINEAR
6. Set vtkOpenGLVolumeTextureMapper3D's sample distance to 0.125
7. Do rendering

My guess is that the interpolation and sample distance caused the problem.
The system interpolated the boundary voxels with outside voxels, which ended
up new texels with a scalar value close to -1024, which is green.

Do we have any solution in VTK or OpenGL?

Is it possible to indicate in VTK that certain scalar value is supposed to
be a model boundary?
Is it possible to tell OpenGL that certain scalar value (-1024 here) is NOT
supposed to be used for the linear interpolation? (GL_LINEAR). I was
guessing using mipmap interpolation can be better but not a full solution,
and we DO need to tell OpenGL how to differentiate a voxel outside of the
dataset?

Anybody ever experienced same problems? Your suggestion is greatly
appreciated.

Frank Gao






More information about the vtkusers mailing list