There is a case to be made about incrementing the variables in the loop.... boy, one of those days!<br><br><div><span class="gmail_quote">On 4/18/07, <b class="gmail_sendername">Luca Pamparana</b> <<a href="mailto:luca.pamparana@gmail.com">
luca.pamparana@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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><span class="sg"><br>Luca<br>
</span></blockquote></div><br>