[vtkusers] transparancy using vtkImageBlend

Anka Kochanowska anka at bic.mni.mcgill.ca
Thu Apr 12 09:23:12 EDT 2007


Something like:

        blendedImage = vtkImageBlend::New();
        blendedImage->SetOpacity(0, 0.5);
        blendedImage->SetOpacity(1, 0.5);
        blendedImage->AddInput( 0, im1->GetOutput());
        blendedImage->AddInput( 0, im2->GetOutput());
        blendedImage->Update();

Anka

Luca Pamparana wrote:

> Hi everyone,
>
> I am playing around with the vtkImageBlend filter and I am having 
> trouble with getting the underlying image to show through.
>
> So, the setup is as follows:
>
> I have two seperate image reslicers for the two input image volumes. 
> Their output port both connect to an input port of the vtkImageBlend 
> filter
>
> When I load the volumes, I center them in a viewing display. This is 
> achieved as follows:
>
> // Set the output extent to our viewer size
> slicer1->SetOutputExtent(0, (int)m_sizeX - 1, 0, (int)m_sizeY -1, 0, 0);
> slicer2->SetOutputExtent(0, (int)m_sizeX - 1, 0, (int)m_sizeY -1, 0, 0);
>
> // After this set the output origin to be the center of the view.
>
> Now, as you can see the images occupy the whole view. Now, when I 
> display the final result, the underlying image cannot be seen at all. 
> Is there a way to set the transparancy so that the underlying image 
> can be seen. Right now, the overlaid image is totally opaque...
>
> Thanks for your help.
>
> Luca
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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
>  
>



More information about the vtkusers mailing list