<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>hi all guys:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I'm using the 
vtkImageMapToWindowLevelColors class for "Match Colors".&nbsp;<FONT face=Arial>I 
used VS2005, vtk 4.1 under the winodwsXP</FONT></FONT><FONT size=2><FONT 
face=ÐÂËÎÌå size=1><SPAN lang=EN-US 
style="FONT-SIZE: 9pt; FONT-FAMILY: ÐÂËÎÌå">.</SPAN></FONT>&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I can get the "Match Colors" result, but 
the result is not good -&nbsp;It seems that something above the result. 
</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; Here is my code:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; void TestMap2Color()<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp; &nbsp;vtkDICOMImageReader* reader = 
vtkDICOMImageReader::New();&nbsp;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;reader-&gt;SetFileName("c:\\IM2");<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;reader-&gt;Update();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;vtkLookupTable *hueLut = 
vtkLookupTable::New();<BR>&nbsp;&nbsp;&nbsp; &nbsp;hueLut-&gt;SetTableRange (0, 
2000);<BR>&nbsp;&nbsp;&nbsp; &nbsp;hueLut-&gt;SetHueRange (0, 
1);<BR>&nbsp;&nbsp;&nbsp; &nbsp;hueLut-&gt;SetSaturationRange (1, 
1);<BR>&nbsp;&nbsp;&nbsp; &nbsp;hueLut-&gt;SetValueRange (1, 
1);<BR>&nbsp;&nbsp;&nbsp; &nbsp;hueLut-&gt;Build(); //effective 
built</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;vtkImageMapToWindowLevelColors* 
pImageMapToColors = vtkImageMapToWindowLevelColors 
::New();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pImageMapToColors-&gt;SetLookupTable(hueLut);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pImageMapToColors-&gt;SetInput(reader-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pImageMapToColors-&gt;Update();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;vtkImageViewer* pViewer = 
vtkImageViewer::New();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pViewer-&gt;SetInput(pImageMapToColors-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pViewer-&gt;GetImageMapper()-&gt;SetColorLevel(10);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pViewer-&gt;GetImageMapper()-&gt;SetColorWindow(100);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pViewer-&gt;Render();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;vtkRenderWindowInteractor *iren = 
vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;iren-&gt;SetRenderWindow(pViewer-&gt;GetRenderWindow());<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;iren-&gt;Initialize();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;iren-&gt;Start();<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I upload a bmp file for the screen-shot : 
<A 
href="http://www.chmbook.com/cpptk/upload/20071/cpb2_2007123113255.jpg">http://www.chmbook.com/cpptk/upload/20071/cpb2_2007123113255.jpg</A></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; If I used vtkImageViewer2 instead of 
vtkImageViewer, It work fine! show for this: <A 
href="http://www.chmbook.com/cpptk/upload/20071/cpb2_2007123113632.jpg">http://www.chmbook.com/cpptk/upload/20071/cpb2_2007123113632.jpg</A></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I checked the vtk code, and I found the 
vtkImageViewer2 class used the vtkImageActor class, that based on 
vtkProp2D,&nbsp;</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; and, the vtkImageViewer class used the 
vtkActor2D.</FONT><FONT size=2>&nbsp;But in&nbsp;our project,&nbsp;we must be 
used the vtkActor2D class:(</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;I think that only remove something in 
the render result is ok, but&nbsp;how can I do? </FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; Another question, I must use these code in 
above code:</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pViewer-&gt;GetImageMapper()-&gt;SetColorLevel(10);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;pViewer-&gt;GetImageMapper()-&gt;SetColorWindow(100);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; otherwise I can't get any result, 
why?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; <FONT face=Arial>Thanks for any 
advice!</FONT></FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; </FONT></DIV></BODY></HTML>