[vtkusers] vtkImageViewer2 with RGBA vtkImageBlend

Jason Crane jasonc at radiology.ucsf.edu
Thu Jul 12 12:48:33 EDT 2007


Hi,

I'm interested in generating a color overlay of one image on top of a 
2nd gray scale reference image in a viewer with zoom, pan, resize functionality. 
I've been using vtkImageBlend to combine a color and gray scale image (both RGBA) 
into a single vtkImageData object (RGBA). This renders fine when used as the input 
to vtkImageViewer. However in vtkImageViewer2, although the initial rendering looks 
fine, any window-level event causes the rendered image to revert completely to 
gray scale in the viewer. I am able to set a LUT via the vtkImageViewer2's 
vtkImageMapToWindowLevelColors:


vtkImageViewer2* viewer = vtkImageViewer2::New();
viewer->GetWindowLevel()->SetLookupTable(lut)


but this only seems to work if my input vtkImageData is a single compoent scalar.


Is there a better way to accomplish this, or a way to add pan, resize, zoom 
to vtkImageViewer?


Thanks in advance for any advice.


-Jason





More information about the vtkusers mailing list