Hello everyone,<br><br>I am unable to get the vtkImageMapToWindowLevelColors to give me an output :(<br><br>My pipeline is as follows:<br><br>// vtkImageData input to a reslicer<br>this-&gt;m_slicer-&gt;SetInput(in); <br><br>
// pass the output of the slicer to vtkImageMapToWindowLevelColors object<br>this-&gt;m_windowLevelMapper-&gt;SetInputConnection(this-&gt;m_slicer-&gt;GetOutputPort()); <br><br>// Pipe the output to a vtkImageBlend object
<br>this-&gt;m_blender-&gt;AddInputConnection(0, this-&gt;m_windowLevelMapper-&gt;GetOutputPort());<br><br>// Pipe output to a vtkImageMapper. This mapper is tied to the Actor2D<br>// object that is added to the renderer<br>
this-&gt;m_imageMapper-&gt;SetInput(this-&gt;m_blender-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>double * range = in-&gt;GetScalarRange();<br>if (range)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // this calls the ciorresponding methods on the vtkImageMapToWindowLevelColors object
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;SetColorWindow(range[1] - range[0]);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;SetColorLevel(0.5 * (range[1] + range[0]));<br>&nbsp;}<br>&nbsp;<br>SetSlice(static_cast&lt;int&gt;((GetWholeZMin() + GetWholeZMax()) * 0.5));<br><br>My guess is that I am not setting the ColorWindow and ColorLevel on the vtkImageMapper instance. However, I want to control the color window and color level values independently of the mapper as the vtkImageBlend will also have other inputs that I want to control the window and level values for.
<br><br>Any help on how I can get this to work is much appreciated.<br><br>Thanks,<br>Luca<br>