<DIV> </DIV>
<BLOCKQUOTE style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.7ex; BORDER-LEFT: #ccc 1px solid">
<DIV>
<DIV><FONT size=2>Dear </FONT><FONT size=3>Luis:</FONT></DIV>
<DIV><FONT size=3><FONT size=2> </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> Now I need your help!</FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> I had combined ITK and VTK correctly and run the example of myProject in tutorial of Getting started with ITK and VTK.That's OK!I can get what I want.Now I want to use ITK to read some picture and show them in MFC with VTK.I want to convert codes in myProject above to MFC. But there are some problems. I show you my codes as follow.</FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> typedef itk::Image< unsigned short, 2> ImageType;<BR> typedef itk::ImageFileReader<ImageType> ReaderType;<BR> typedef itk::ImageToVTKImageFilter< ImageType> FilterType;<BR> <BR> ReaderType::Pointer reader = ReaderType::New();<BR> FilterType::Pointer connector = FilterType::New();<BR> reader->SetFileName(str); //str by CFileDialog<BR> connector->SetInput( reader->GetOutput() ); </FONT> <BR></FONT></DIV>
<DIV><FONT size=3><FONT size=2> viewerRef = vtkImageViewer::New();</FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3><FONT size=2> viewerRef->SetInput( connector->GetOutput() );<BR> viewerRef->SetColorWindow(255);<BR> viewerRef->SetColorLevel(128); </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT size=3><FONT size=2> CRect rect;<BR> m_refStatic = &m_picRef; //m_refStatic is a CStatic* ,m_picRef too.<BR> m_refStatic->GetClientRect(&rect);<BR> viewerRef->SetParentId(m_refStatic->m_hWnd);<BR> viewerRef->SetPosition(rect.left, rect.top);<BR> viewerRef->SetSize(100, 100);<BR> viewerRef->GetRenderWindow()->SetCurrentCursor(9);<BR> viewerRef->Render(); </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> </FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2> These codes can't display a picture correctly,errors are:VTK 5.2\vtk\Imaging\vtkImageImport.cxx, line 324<BR>vtkImageImport (01C95498): Unknown exception.VTK5.2\vtk\Imaging\vtkImageImport.cxx, line 303<BR>vtkImageImport (01C95498): Unknown exception.</FONT></FONT></DIV>
<DIV><FONT size=3><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT size=3><FONT size=2> Hope your apply! Thank you!</FONT></FONT></DIV>
<DIV><FONT size=2> Jerry </FONT></DIV>
<DIV><FONT size=2> </FONT></DIV></DIV><BR><!-- urlfiles --><BR><BR><!-- footer --><BR><!-- this is generated by template --></BLOCKQUOTE><BR> <br><!-- urlfiles --><br><br><!-- footer --><br>