[vtkusers] A LUT for each image in vtkImageBlend

David Gobbi david.gobbi at gmail.com
Tue Jun 29 07:30:23 EDT 2010


Hi Luis,

The LUT can be set in a separate step, using vtkImageMapToColors. With
vtkImageMapToColors, you can use SetOutputFormatToRGB() or
SetOutputFormatToRGBA().

image1 -> vtkImageMapToColors (RGB) -> image1_rgb
marker -> vtkImageMapToColors (RGBA) -> marger_rgba

(image1_rgb , marker_rgba) -> vtkImageBlend -> composite_rgb

Also, if your marker image is smaller than your main image, you can
position it in the main image by using vtkImageChangeInformation:

marker -> vtkImageChangeInformation::SetExtentTranslation() ->
marker_new_position

By adjusting the vtkImageChangeInformation to change the extent of the
second image input for vtkImageBlend, you can adjust where it will
appear relative to the first image.

Another option (that does not use vtkImageBlend) is to use a separate
actor for the marker.

  David



On Mon, Jun 28, 2010 at 9:16 PM, Luis Roberto P. Paula
<luisrpp at gmail.com> wrote:
> Hi All,
>
> I have two images:
>
> vtkImageData object;  // Contains the object of interest - Grey scale image (0 - 256)
> vtkImageData marker;  // Just the marker for the object - Binary Image with same size of 'object'
>
> I need to display the marker over the object in a GUI. To do that, I`m using the vtkImageBlend:
>
>   vtkImageBlend* blend = vtkImageBlend::New();
>   blend->RemoveAllInputs();
>   blend->AddInput(object);
>   blend->AddInput(marker);
>   blend->SetOpacity(1, opacity);
>   blend->Update();
>
> Then, I'm setting the output image to a vtkImageViewer2.
>
> So far so good, but the problem is that I have to control the opacity to see the marker.
>
> Is it possible to set a LUT for each image in vtkImageBlend, so I can set the marker a different color for the marker, without the need to set opacity?
>
> If this is not the correct approach to do this kind of effect, could someone give me some guidance?
>
> Thanks & Regards,
> Luis
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list