<!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> </DIV>
<DIV><FONT size=2> I'm using the
vtkImageMapToWindowLevelColors class for "Match Colors". <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> </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> I can get the "Match Colors" result, but
the result is not good - It seems that something above the result.
</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> Here is my code:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> void TestMap2Color()<BR>
{<BR> vtkDICOMImageReader* reader =
vtkDICOMImageReader::New(); <BR>
reader->SetFileName("c:\\IM2");<BR>
reader->Update();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkLookupTable *hueLut =
vtkLookupTable::New();<BR> hueLut->SetTableRange (0,
2000);<BR> hueLut->SetHueRange (0,
1);<BR> hueLut->SetSaturationRange (1,
1);<BR> hueLut->SetValueRange (1,
1);<BR> hueLut->Build(); //effective
built</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkImageMapToWindowLevelColors*
pImageMapToColors = vtkImageMapToWindowLevelColors
::New();<BR>
pImageMapToColors->SetLookupTable(hueLut);<BR>
pImageMapToColors->SetInput(reader->GetOutput());<BR>
pImageMapToColors->Update();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkImageViewer* pViewer =
vtkImageViewer::New();<BR>
pViewer->SetInput(pImageMapToColors->GetOutput());<BR>
pViewer->GetImageMapper()->SetColorLevel(10);<BR>
pViewer->GetImageMapper()->SetColorWindow(100);<BR>
pViewer->Render();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(pViewer->GetRenderWindow());<BR>
iren->Initialize();<BR>
iren->Start();<BR> }</FONT></DIV>
<DIV><FONT size=2> </FONT></DIV>
<DIV><FONT size=2> 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> </DIV>
<DIV><FONT size=2> 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> </DIV>
<DIV><FONT size=2> I checked the vtk code, and I found the
vtkImageViewer2 class used the vtkImageActor class, that based on
vtkProp2D, </FONT></DIV>
<DIV><FONT size=2> and, the vtkImageViewer class used the
vtkActor2D.</FONT><FONT size=2> But in our project, we must be
used the vtkActor2D class:(</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> I think that only remove something in
the render result is ok, but how can I do? </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> Another question, I must use these code in
above code:</FONT></DIV>
<DIV><FONT
size=2> pViewer->GetImageMapper()->SetColorLevel(10);<BR>
pViewer->GetImageMapper()->SetColorWindow(100);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> otherwise I can't get any result,
why?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> <FONT face=Arial>Thanks for any
advice!</FONT></FONT></DIV>
<DIV><FONT size=2> </FONT></DIV></BODY></HTML>