[vtkusers] Not able to blend properly

anupriya.sharma at accenture.com anupriya.sharma at accenture.com
Mon Oct 1 01:40:31 EDT 2012


Hi

I am trying to blend two different raw files. I have used vtkImageReader to read both the files. I have applied two different lookup tables on both the file
I have also  used          vtkImageMapToColors ColorMapper = new vtkImageMapToColors();

                vtkImageMapToColors ColorMapper = new vtkImageMapToColors();
                ColorMapper.SetInput(reader1.GetOutput());
                ColorMapper.SetLookupTable(table);

                vtkImageMapToColors ColorMapper1 = new vtkImageMapToColors();
                ColorMapper1.SetInput(reader2.GetOutput());
                ColorMapper1.SetLookupTable(table1);

"table is the Lookuptable applied on first file and table1 is the lookup table applied on second file".

After setting the lookuptable I have created instance of vtkImage blend.

vtkImageBlend blend = new vtkImageBlend();
blend.setOpacity(0,0);
blend.setOpacity(1,0);
blend.AddInputConnection(ColorMapper.GetOutputPort);
blend.AddInputConnection(ColorMapper1.GetOutputPort);

I have later given the output of blend to the Input Connection of Viewer.
Viewer.SetInputConnection(blend.GetOutputPort());

But the problem is the opacity results are coming incorrect.

If the opacity of first file is 0 and the opacity of second file is also 0 then no output should be displayed but the output is getting displayed with color of first LUT i.e Green.
If the opacities are 0.5 and 0.5(0.5 opacity for both the files) then the fused color (dark green ) is getting displayed. The same color is getting displayed at opacities 0 and 0.5(0 for first file and 0.5 for second).The same thing is happening with opacities 1 and 0.5(1 for first file and 0.5 for second).

Could anyone please explain how this Opacity function is working and how to blend two different files with different color tables.



Regards
Anupriya Sharma


________________________________
Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121001/0cb00126/attachment.htm>


More information about the vtkusers mailing list