<DIV>
<DIV>Hi all:</DIV>
<DIV> </DIV>
<DIV> 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!</DIV>
<DIV> </DIV>
<DIV> My codes are as follow,Who can help me to solve this ?</DIV>
<DIV> </DIV>
<DIV>//a menu which opens an image</DIV>
<DIV>void CImg2View::OnImgOpen() <BR>{<BR> // TODO: Add your command handler code here<BR> static char BASED_CODE szFilter[] = "DCM Files (*.dcm)|*.dcm|All Files (*.*)|*.*||";<BR> CFileDialog cFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);<BR> if (cFileDialog.DoModal() == IDOK)<BR> { <BR> m_movName=cFileDialog.GetFileName();<BR> pipeline();<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV>void CImg2View::pipeline()<BR>{<BR> movingImageReader->SetFileName(m_movName);<BR>// movingImageReader->Update(); !!!!!!!!!!!!!!! here will occur an exception<BR> connectorMov->SetInput(movingImageReader->GetOutput());<BR> viewer->SetInput(connectorMov->GetOutput());<BR> viewer->SetPosition(0,0);<BR> viewer->SetupInteractor(viewInt);<BR> viewInt->Initialize();<BR> viewer->Render();</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>Error at :</DIV>
<DIV> </DIV>
<DIV>unsigned char *vtkOpenGLImageActor::MakeDataSuitable(int &xsize, int &ysize,<BR> int &release,<BR> int &reuseTexture)</DIV>
<DIV> </DIV>
<DIV> *outPtr = *inPtr;//here can not go everytime ŁĄŁĄŁĄŁĄ</DIV></DIV>