<DIV>I'm a new VTKuser,when i wanted to display a Image of dicom,I got this message</DIV>
<DIV> ERROR: In \vtk-5.0.0\Rendering\vtkImageActor.cxx, line 182<BR>vtkOpenGLImageActor (0273CF50): This filter requires unsigned char scalars as input</DIV>
<DIV> </DIV>
<DIV>I don't know why!</DIV>
<DIV>I need some help.</DIV>
<DIV> </DIV>
<DIV>////////////////</DIV>
<DIV>void CvtkDLGDlg::OnBtnLoadFile()<BR>{<BR> static char BASED_CODE szFilter[] = "VTK Files (*.dcm)|*.dcm|All Files (*.*)|*.*||";<BR> CFileDialog cFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);</DIV>
<DIV> if (cFileDialog.DoModal() == IDOK)<BR> {<BR> // remove old actors<BR> this->pvtkRenderer->RemoveActor(this->m_Actor);<BR> //this->pvtkRenderer->RemoveActor(this->pvtkActor2D);<BR> <BR> // read new data<BR> this->dcmReader=vtkDICOMImageReader::New();<BR> double origin[3] = {0, 0, 0};<BR> this->dcmReader->SetDataByteOrderToLittleEndian();<BR> this->dcmReader->SetDataScalarTypeToUnsignedChar();<BR> this->dcmReader->SetFileDimensionality(3);<BR> this->dcmReader->SetDataOrigin(origin);</DIV>
<DIV> this->dcmReader->SetFileName(cFileDialog.GetPathName());</DIV>
<DIV> this->dcmReader->SetNumberOfScalarComponents(1);<BR> this->dcmReader->SetHeaderSize(0);<BR> this->dcmReader->UpdateWholeExtent();<BR> this->dcmReader->SetDataScalarTypeToUnsignedChar();<BR> this->m_Actor->SetInput(this->dcmReader->GetOutput());</DIV>
<DIV> this->pvtkRenderer->SetBackground(0.0,0.0,0.4);<BR> this->pvtkRenderer->AddActor(this->m_Actor);<BR> this->pvtkMFCWindow->GetRenderWindow()->AddRenderer(this->pvtkRenderer);</DIV>
<DIV> </DIV>
<DIV><BR> // update window<BR> if (this->pvtkMFCWindow)<BR> this->pvtkMFCWindow->RedrawWindow();<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV> </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>