Hello everyone,<br><br>I finally managed to get rid of the RGB and grayscale blending by simply switching the connection in the vtkImageBlend filter. However, I am still struggling with the vtkLookupTable and using it with the vtkImageMapToWindowLevelColors filter.
<br><br>So, I am creating the table as follows:<br><br>vtkImageMapToWindowLevelColors * iwlc = vtkImageMapToWindowLevelColors;<br>vtkLookupTable * lut = vtkLookupTable::New();<br><br>// Input is the input vtkImageData pointer.
<br>double * range = input->GetScalarRange();<br><br>lut->SetTableRange (range[0], range[1]); <br>lut->SetNumberOfTableValues(256);<br>lut->Build();<br><br>float r, g, b;<br>r = g = b = 0.0;<br>
<br>for (int i = 0; i < 256; i++)<br>{<br> lut->SetTableValue(i, r/255.0f, g/255.0f, b/255.0f, 1.0);<br>}<br>iwlc->SetLookupTable(lut);<br>iwlc->SetInput(input);<br><br>Now, later when I get the output of the vtkImageMapToWindowLevelColors filter object as:
<br><br>iwic->GetOutput();<br><br>then the scalar range for the output data is always 0 - 0. I have tried using calls to update but to no avail. <br><br>I would really appreciate some help from experts who have experience using these filters.
<br><br>Thanks,<br><br>Luca<br>