<DIV id=RTEContent>Hi everyone, </DIV>  <DIV>&nbsp;</DIV>  <DIV>I am triing to display my image data of&nbsp;range [-2,&nbsp;+2] with a colormap. </DIV>  <DIV>&nbsp;</DIV>  <DIV>I took a look on <STRONG>vtkLookupTable</STRONG> and <STRONG>vtkImageMapToColors</STRONG> but&nbsp;it seems that I didn't catch vtkLookupTable notion: my displayed image is all green!!!!!</DIV>  <DIV>&nbsp;</DIV>  <DIV>Here is what I did:</DIV>  <DIV>&nbsp;</DIV>  <DIV><FONT size=2>  <div><STRONG><EM>vtkImageReader* reader = vtkImageReader::New();</EM></STRONG></div>  <div><STRONG><EM>reader-&gt;SetFileDimensionality(3); </EM></STRONG></FONT><FONT color=#008000 size=2><STRONG><EM>//all the slices are in one file </EM></STRONG></div></FONT><FONT size=2>  <div><STRONG><EM>reader-&gt;SetFileName("filename.raw");</EM></STRONG></div>  <div><STRONG><EM>reader-&gt;SetNumberOfScalarComponents(1); </EM></STRONG></FONT><FONT color=#008000 size=2><STRONG><EM>//image is greyscale </EM></STRONG></div></FONT><FONT size=2> 
 <div><STRONG><EM>reader-&gt;SetDataScalarTypeToFloat(); </EM></STRONG></FONT><FONT color=#008000 size=2><STRONG><EM>//4 byte</EM></STRONG></div></FONT><FONT size=2>  <div><STRONG><EM>reader-&gt;SetDataExtent(0,193, 0,54, 0,164); </EM></STRONG></FONT><FONT color=#008000 size=2><STRONG><EM>//194 x 55 x 165 </EM></STRONG></div></FONT><FONT size=2>  <div><STRONG><EM>reader-&gt;SetDataSpacing(1.0, 194/55, 1.0);</EM></STRONG></div>  <div><STRONG><EM>reader-&gt;SetDataOrigin(0.0, 0.0, 0.0);</EM></STRONG></div>  <div><STRONG><EM>reader-&gt;UpdateWholeExtent();</EM></STRONG></div>  <div><STRONG><EM></EM></STRONG></FONT><FONT color=#008000 size=2></FONT>&nbsp;</div>  <div><FONT color=#008000 size=2><STRONG><EM>//rescaling in [0-255]</EM></STRONG></div></FONT>  <div><FONT size=2><STRONG><EM>vtkImageShiftScale* shiftScale = vtkImageShiftScale::New();</EM></STRONG></div>  <div><STRONG><EM>shiftScale-&gt;SetInputConnection(reader-&gt;GetOutputPort());</EM></STRONG></div>  <div></FONT><FONT
 size=2><STRONG><EM>shiftScale-&gt;SetOutputScalarTypeToUnsignedChar();</EM></STRONG></div>  <div><STRONG><EM></EM></STRONG>&nbsp;</div>  <div><FONT color=#0000ff size=2><STRONG><EM>float</EM></STRONG></FONT><FONT size=2><STRONG><EM> min = reader-&gt;GetOutput()-&gt;GetScalarRange()[0];</EM></STRONG></div>  <div></FONT><FONT color=#0000ff size=2><STRONG><EM>float</EM></STRONG></FONT><FONT size=2><STRONG><EM> max = reader-&gt;GetOutput()-&gt;GetScalarRange()[1];</EM></STRONG></div>  <div></FONT></FONT><FONT size=2><STRONG><EM>vtkLookupTable* table = vtkLookupTable::New();</EM></STRONG></div></DIV>  <DIV>  <div><STRONG><EM>table-&gt;SetTableRange(min,max);</EM></STRONG></div>  <div><STRONG><EM>table-&gt;SetHueRange(0.0, 0.667);</EM></STRONG></FONT><FONT color=#008000 size=2><STRONG><EM>//red to blue </EM></STRONG></div></FONT><FONT size=2>  <div><STRONG><EM>table-&gt;SetSaturationRange(1.0, 1.0);</EM></STRONG></div>  <div><STRONG><EM>table-&gt;SetValueRange(1.0,
 1.0);</EM></STRONG></div>  <div><STRONG><EM>table-&gt;SetAlphaRange (1.0, 1.0);</EM></STRONG></div>  <div><STRONG><EM>table-&gt;SetNumberOfColors(256);</EM></STRONG></div>  <div><STRONG><EM>table-&gt;Build();</EM></STRONG></div>  <div><STRONG><EM></EM></STRONG>&nbsp;</div>  <div></FONT><FONT color=#008000 size=2><STRONG><EM>//convert to color:</EM></STRONG></div></FONT><FONT size=2>  <div><STRONG><EM>vtkImageMapToColors* colormap = vtkImageMapToColors::New();</EM></STRONG></div>  <div><STRONG><EM>colormap-&gt;SetInput(shiftScale-&gt;GetOutput());</EM></STRONG></div>  <div><STRONG><EM>colormap-&gt;SetLookupTable(table);</EM></STRONG></div>  <div><STRONG><EM>colormap-&gt;SetOutputFormatToRGB();</EM></STRONG></div>  <div><STRONG><EM></EM></STRONG>&nbsp;</div>  <div><STRONG><EM></EM></STRONG></div>  <div><STRONG><EM>vtkImageViewer2* viewer = vtkImageViewer2::New();</EM></STRONG></div>  <div><STRONG><EM>viewer-&gt;SetInput(colormap-&gt;GetOutput());</EM></STRONG></div> 
 <div><STRONG><EM>colormap-&gt;Delete();</EM></STRONG></div>  <div><STRONG><EM>reader-&gt;Delete();</EM></STRONG></div>  <div><STRONG><EM></EM></STRONG>&nbsp;</div></FONT><FONT size=2>  <div><STRONG><EM>viewer-&gt;SetSlice(10);</EM></STRONG></FONT><FONT size=2>  <div><STRONG><EM></EM></STRONG></div><STRONG><EM>viewer-&gt;Render();</EM></STRONG></div></FONT></DIV>  <DIV>&nbsp;</DIV>  <DIV>Please help me. It is pretty quite urgent. </DIV>  <DIV>&nbsp;</DIV>  <DIV>Isabelle</DIV><p>
                <hr size=1> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com">Téléchargez</a> la version beta.