[vtkusers] A LUT for each image in vtkImageBlend

David Gobbi david.gobbi at gmail.com
Wed Jun 30 08:32:38 EDT 2010


The vtkImageViewer classes are meant to be a "quick-and-dirty" way of
displaying images.  If you want to do anything beyond basic image
display, you should use a vtkRenderWindow and a vtkImageActor.  Then
you have the full power of VTK available to you, with multiple actors,
overlays, all the interactors, etcetera.

  David


On Tue, Jun 29, 2010 at 11:13 PM, Luis Roberto P. Paula
<luisrpp at gmail.com> wrote:
> Thanks David!!
> This is just what I was looking for!!
> I'm curious on how to solve this using another actor for the marker since
> I'm using vtkImageViewer2.
> Thanks & Regards,
> Luis
> On Tue, Jun 29, 2010 at 8:30 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> 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