<DIV>I'm a new VTKuser,when i wanted to display a Image of dicom,I got this message</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; ERROR: In \vtk-5.0.0\Rendering\vtkImageActor.cxx, line 182<BR>vtkOpenGLImageActor (0273CF50): This filter requires unsigned char scalars as input</DIV>
<DIV>&nbsp;</DIV>
<DIV>I don't know why!</DIV>
<DIV>I need some help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>////////////////</DIV>
<DIV>void CvtkDLGDlg::OnBtnLoadFile()<BR>{<BR>&nbsp; static char BASED_CODE szFilter[] = "VTK Files (*.dcm)|*.dcm|All Files (*.*)|*.*||";<BR>&nbsp; CFileDialog cFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);</DIV>
<DIV>&nbsp; if (cFileDialog.DoModal() == IDOK)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; // remove old actors<BR>&nbsp;&nbsp; this-&gt;pvtkRenderer-&gt;RemoveActor(this-&gt;m_Actor);<BR>&nbsp;&nbsp;&nbsp; //this-&gt;pvtkRenderer-&gt;RemoveActor(this-&gt;pvtkActor2D);<BR>&nbsp; <BR>&nbsp;&nbsp;&nbsp; // read new data<BR>&nbsp;&nbsp; this-&gt;dcmReader=vtkDICOMImageReader::New();<BR>&nbsp;&nbsp; double origin[3] = {0, 0, 0};<BR>&nbsp;&nbsp;this-&gt;dcmReader-&gt;SetDataByteOrderToLittleEndian();<BR>&nbsp;&nbsp;this-&gt;dcmReader-&gt;SetDataScalarTypeToUnsignedChar();<BR>&nbsp;&nbsp;this-&gt;dcmReader-&gt;SetFileDimensionality(3);<BR>&nbsp;&nbsp;this-&gt;dcmReader-&gt;SetDataOrigin(origin);</DIV>
<DIV>&nbsp;&nbsp; this-&gt;dcmReader-&gt;SetFileName(cFileDialog.GetPathName());</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;dcmReader-&gt;SetNumberOfScalarComponents(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;dcmReader-&gt;SetHeaderSize(0);<BR>&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;dcmReader-&gt;UpdateWholeExtent();<BR>&nbsp; this-&gt;dcmReader-&gt;SetDataScalarTypeToUnsignedChar();<BR>&nbsp; this-&gt;m_Actor-&gt;SetInput(this-&gt;dcmReader-&gt;GetOutput());</DIV>
<DIV>&nbsp; this-&gt;pvtkRenderer-&gt;SetBackground(0.0,0.0,0.4);<BR>&nbsp; this-&gt;pvtkRenderer-&gt;AddActor(this-&gt;m_Actor);<BR>&nbsp; this-&gt;pvtkMFCWindow-&gt;GetRenderWindow()-&gt;AddRenderer(this-&gt;pvtkRenderer);</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; // update window<BR>&nbsp;&nbsp;&nbsp; if (this-&gt;pvtkMFCWindow)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;pvtkMFCWindow-&gt;RedrawWindow();<BR>&nbsp; }<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><br><!-- footer --><br><hr>
<a style="font-size:14px;line-height:15px; color:#000; text-decoration:none" href="http://event.mail.163.com/chanel/xyq.htm?from=163" target="_blank"><span style="text-decoration:underline; color:blue">免费试玩2006中国最佳网络游戏--梦幻西游 </span> </a>