<div dir="ltr">Thank you for a quick response. I did try it, and the scalar space does increase to rgb, but my output is completely black. My vtkScalarsToColors might be lacking something. The code is: <div><br></div><div>
<div>vtkSmartPointer<vtkScalarsToColors> scalarsToColors = vtkSmartPointer<vtkScalarsToColors>::New();</div></div><div><div><br></div><div>vtkSmartPointer<vtkImageMapToColors> colorMapper = vtkSmartPointer<vtkImageMapToColors>::New();</div>
<div>firstColorMapper->SetOutputFormatToRGB();</div><div>firstColorMapper->SetInputData(myImageVtkImageData);</div><div>firstColorMapper->SetLookupTable( scalarsToColors );</div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, May 31, 2014 at 5:44 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Use vtkImageMapToColors, here is a python example of<br>
how to set it up:<br>
<br>
rgbConverter = vtkImageMapToColors()<br>
rgbConverter.SetOutputFormatToRGB()<br>
rgbConverter.SetLookupTable(vtkScalarsToColors())<br>
<br>
The "vtkScalarsToColors" object describes how the<br>
mapping of scalars to colors is done. By default, it just<br>
replicates the scalar into the r, g, and b components.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Sat, May 31, 2014 at 9:21 AM, Milan Vidakovic <<a href="mailto:milan.vidakovic@tp.rs">milan.vidakovic@tp.rs</a>> wrote:<br>
> I have a number of single-scalar grayscale vtkImageData objects that would<br>
> need to convert to rgb. Is there a way to perform this transformation<br>
> without loosing the grayscale information? Even a change from grayscale to<br>
> mono-color would do the trick.<br>
><br>
> Thank you!<br>
> Milan<br>
</div></div></blockquote></div><br></div>