<DIV>I have written one program about volume rending .When compiled,there are no bugs.But when executed,there exits one window named <FONT size=2>vtkOutputWindow displaying the message"
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3>ERROR: In F:\vtk1\VTK5.0\vtk-5.0.0\VolumeRendering\vtkVolumeRayCastMapper.cxx, line 318</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3>vtkVolumeRayCastMapper (0x0279E840): Cannot volume render data of type short, only unsigned char or unsigned short."</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3>And the final imagine can not be get.</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3>The CT imagine files are <FONT size=2>DICOM <FONT size=3>format.The path</FONT> is</FONT><FONT size=3>"e:/test/dcmdir"</FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3>the primary programs are as follows:</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman" size=3></FONT></SPAN> </P></FONT></DIV>
<DIV><FONT size=2> ren = vtkRenderer::New();<BR> renWin = vtkWin32OpenGLRenderWindow::New();<BR> iren = vtkWin32RenderWindowInteractor::New();<BR> renWin->AddRenderer(this->ren);</FONT></DIV><FONT size=2>
<DIV><BR> // setup the parent window<BR> renWin->SetParentId(this->GetDlgItem(IDC_RENDER)->m_hWnd); <BR> iren->SetRenderWindow(renWin);<BR> vtkDICOMImageReader *m_DicomReader = vtkDICOMImageReader::New();<BR> m_DicomReader->SetDirectoryName ("e:/test/dcmdir");<BR> m_DicomReader->Update();<BR> <BR> vtkVolumeRayCastCompositeFunction *ComositeFun = vtkVolumeRayCastCompositeFunction::New();<BR> vtkVolumeRayCastMapper *VolMapper = vtkVolumeRayCastMapper::New();<BR> VolMapper->SetInputConnection(m_DicomReader->GetOutputPort());<BR> VolMapper->SetVolumeRayCastFunction(ComositeFun); <BR> vtkVolume *Volume = vtkVolume::New();<BR> Volume->SetMapper(VolMapper);<BR><BR> vtkColorTransferFunction *gTFun = vtkColorTransferFunction::New();<BR> gTFun->AddRGBSegment(128.0,126/255.0,16/255.0,16/255.0, 255.0,64/255.0,255/255.0,16/255.0); <BR> vtkVolumeProperty *VolProperty = vtkVolumeProperty::New();<BR> VolProperty->SetColor(gTFun);<BR> <BR><BR> vtkPiecewiseFunction *oTFun = vtkPiecewiseFunction::New();<BR> oTFun->AddSegment(48,0.0,255,1.0);</DIV>
<DIV> VolProperty->SetScalarOpacity(oTFun);<BR> VolProperty->SetInterpolationTypeToLinear();<BR> VolProperty->ShadeOn();<BR> Volume->SetProperty(VolProperty);<BR> ren->AddVolume(Volume);<BR> ren->SetBackground(1,1,1);<BR><BR> CRect rect;<BR> this->GetDlgItem(IDC_RENDER)->GetClientRect(&rect);<BR> iren->Initialize();<BR> renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);<BR> ren->ResetCameraClippingRange();<BR> ren->ResetCamera();<BR> ren->GetActiveCamera()->Zoom(1);<BR> iren->Start(); <BR> AfxMessageBox("init ok");</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>please help me find the error,and tell me how to solve the problem in detail.Thanks a lot!</FONT><BR></DIV>
<DIV> </DIV>
<DIV> </DIV><br><!-- footer --><br><br><div style="border-bottom:1px solid #999"></div><br>
        <font color="black" style="font-size:14.8px"> 年 末 数 码 1 0 0 元 专 场 ( 图 ) </font>
        <br>
         <a href="http://adtaobao.allyes.com/main/adfclick?db=adtaobao&bid=600,597,58&cid=30015,198,1&sid=32501&show=ignore&url=http://www.taobao.com/theme/promotion/main.php/71154" target="_blank" style="font-size:13px;line-height:160%;color:blue"> 百 种 数 码 精 品 1 9 元 起 1 0 0 元 封 顶 , 不 抢 真 的 悔 死 你 ( 图 ) </a>