[Insight-users] ImageToVtkImageFilter +MFC

┭定格Ⅱ╃ jerry5612897 at foxmail.com
Wed Jun 16 23:29:53 EDT 2010


Hi all:
     
      I want to display a dicom Image with ImageToVtkImageFilter(ITK)and vtkimageview2(VTK).In 32 console application it's OK!But in a MFC Application it can be compiled successfully but when I open a dicom image to display,it has a problem!
     
      My codes are as follow,Who can help me to solve this ?
  
 //a menu which opens an image
 void CImg2View::OnImgOpen() 
{
 // TODO: Add your command handler code here
 static char BASED_CODE szFilter[] = "DCM Files (*.dcm)|*.dcm|All Files (*.*)|*.*||";
 CFileDialog cFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
 if (cFileDialog.DoModal() == IDOK)
 { 
   m_movName=cFileDialog.GetFileName();
      pipeline();
 }
}
  
 void CImg2View::pipeline()
{
 movingImageReader->SetFileName(m_movName);
// movingImageReader->Update(); !!!!!!!!!!!!!!! here will occur an exception
 connectorMov->SetInput(movingImageReader->GetOutput());
 viewer->SetInput(connectorMov->GetOutput());
 viewer->SetPosition(0,0);
 viewer->SetupInteractor(viewInt);
 viewInt->Initialize();
 viewer->Render();
 }
  
 Error at :
  
 unsigned char *vtkOpenGLImageActor::MakeDataSuitable(int &xsize, int &ysize,
                                                     int &release,
                                                     int &reuseTexture)
  
         *outPtr = *inPtr;//here can not go everytime !!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100617/a21f9899/attachment-0001.htm>


More information about the Insight-users mailing list