<DIV>Hi users,</DIV>
<DIV> </DIV>
<DIV><SPAN >I recently started working on ITK, and I want to display images in windows using SDI Application. But there is some </SPAN><SPAN>problem. When the Update() function of imagereader is executing, an exception is thrown out which says" Unhandles </SPAN><SPAN>exception in ***.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception". Does anybody could give me some help? </SPAN><SPAN>Thanks in advance. </SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN>Sincerely, Alexander</SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN>Some codes is as follows:</SPAN></DIV>
<P><SPAN>//Code begin</SPAN></P>
<P><SPAN>typedef itk::Image< int, 2 > ImageType2D;<BR>typedef itk::ImageFileReader< ImageType2D > ImageReaderType2D;<BR>typedef itk::ImageToVTKImageFilter<ImageType2D> ConnectorType2D;<BR>ImageReaderType2D::Pointer imageReader2D_1 = ImageReaderType2D::New();<BR>ImageReaderType2D::Pointer imageReader2D_2 = ImageReaderType2D::New();<BR>ConnectorType2D::Pointer connector=ConnectorType2D::New();</SPAN></P>
<P><SPAN>CString strFile="";<BR>char szFilter[]="bmp文件(*.bmp)|*.bmp|All files(*.*)|*.*||";<BR>CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,szFilter,this);<BR>dlg.m_ofn.lpstrInitialDir=".";</SPAN></P>
<P><SPAN>if(dlg.DoModal()==IDOK)<BR>{<BR> strFile=dlg.GetPathName();<BR>}</SPAN></P>
<P><SPAN>imageReader2D_1->SetFileName( strFile );</SPAN></P>
<P><SPAN>//Exception thrown out when executing this expression<BR>imageReader2D_1->Update();</SPAN></P>
<P><SPAN>vtkImageViewer* viewer=vtkImageViewer::New();<BR>vtkRenderWindowInteractor* ImgRenderWindowInteractor=vtkRenderWindowInteractor::New();</SPAN></P>
<P><SPAN>connector->SetInput(imageReader2D_1->GetOutput());<BR> <BR>HWND hwnd = this->GetSafeHwnd();</SPAN></P>
<P><SPAN>viewer->SetParentId(hwnd);<BR>viewer->SetPosition(0,0);<BR>viewer->SetSize(512,512);<BR>viewer->SetupInteractor(ImgRenderWindowInteractor);<BR> <BR>viewer->SetInput(connector->GetOutput());<BR>viewer->Render();</SPAN></P>
<P><SPAN>viewer->SetColorWindow(255);<BR>viewer->SetColorLevel(128);<BR>ImgRenderWindowInteractor->Start();</SPAN></P>
<P><SPAN>//Code End</SPAN></P><br><!-- footer --><br><br><br><br><br><div style="border-bottom:1px solid #999"></div><br>
        <font color="black" style="font-size:14.8px">你 不 想 试 试 今 夏 最 “酷” 的 邮 箱 吗 ?</font>
        <br>
         <a href="http://www.126.com/" target="_blank" style="font-size:13px;line-height:160%;color:blue">蕴 涵 中 华 传 统 文 化 于 世 界 一 流 科 技 之 中,创 新 Ajax 技 术,126 “D 计 划”火 热 体 验 中 !
</a>