[vtkusers] Overlaying color onto a grayscale vtk image

Mark Wyszomierski markww at gmail.com
Fri Sep 9 16:33:06 EDT 2005


I did this when I first started using vtk, it may be really inefficient but 
it worked back then. In my input datasets which were greyscale, I marked my 
special pixels with extremely high scalar values, like 65,000. Then I 
created a vtkColorTransferFunction, and mapped my normal greyscales in a 
smooth RGB ramp from 0,0,0 to 255,255,255. I added a last entry in the color 
transfer function that anything above 65,000 would be RGB 255,255,0 
(yellow). In this way I got a pretty decent mapping without changing too 
much in my original setup. If I had other types of 'special' pixels I would 
mark those as 65,100, then add another mapping color in the transfer 
function. Just an option.
 Mark

 On 9/9/05, Aaron Cois <aaron_vtk at yahoo.com> wrote: 
> 
> I apologize, this question is halfway between an ITK
> question and a VTK question. However, I believe there
> may be a pure VTK solution, so i've posted here first.
> 
> I've been writing software that inputs grayscale
> images via ITK and displays them using
> vtkImagePlaneWidgets, vtkImageImport, and
> itkVTKImageExport.
> 
> I've come across a need to overlay color on certain
> pixels, marking them as having a certain status. I've
> had a good deal of trouble trying to accomplish this,
> and haven't been able to find any answers searching
> the archives. Trying to just use an image of
> itkRBGPixels has failed, though
> 
> 
> http://www.itk.org/cgi-bin/viewcvs.cgi/Auxiliary/vtk/itkReadITKImageShowVTK.cxx?root=InsightApplications&view=markup
> 
> would imply that it could be done. I've tried using
> vtkImageActors and have managed to output a 2D color
> image (with interactor crashing problems, but at least
> it displays), but not a 3D volume.
> 
> It seems ot me there should be a simple way for me to
> get the output of the vtkImporter (a vtkDataSet or
> vtkImageData) and simply alter individual pixels to
> change them to a color rather than their grayscale
> value. Can anyone help?
> 
> Aaron
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050909/9fcf4366/attachment.htm>


More information about the vtkusers mailing list