<DIV>Hi users,</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN>Sincerely, Alexander</SPAN></DIV>
<DIV><SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN>Some codes is as follows:</SPAN></DIV>
<P><SPAN>//Code begin</SPAN></P>
<P><SPAN>typedef itk::Image&lt; int, 2 &gt; ImageType2D;<BR>typedef itk::ImageFileReader&lt; ImageType2D &gt; ImageReaderType2D;<BR>typedef itk::ImageToVTKImageFilter&lt;ImageType2D&gt; 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>&nbsp;strFile=dlg.GetPathName();<BR>}</SPAN></P>
<P><SPAN>imageReader2D_1-&gt;SetFileName( strFile );</SPAN></P>
<P><SPAN>//Exception thrown out when executing this expression<BR>imageReader2D_1-&gt;Update();</SPAN></P>
<P><SPAN>vtkImageViewer* viewer=vtkImageViewer::New();<BR>vtkRenderWindowInteractor* ImgRenderWindowInteractor=vtkRenderWindowInteractor::New();</SPAN></P>
<P><SPAN>connector-&gt;SetInput(imageReader2D_1-&gt;GetOutput());<BR>&nbsp;<BR>HWND hwnd = this-&gt;GetSafeHwnd();</SPAN></P>
<P><SPAN>viewer-&gt;SetParentId(hwnd);<BR>viewer-&gt;SetPosition(0,0);<BR>viewer-&gt;SetSize(512,512);<BR>viewer-&gt;SetupInteractor(ImgRenderWindowInteractor);<BR>&nbsp;<BR>viewer-&gt;SetInput(connector-&gt;GetOutput());<BR>viewer-&gt;Render();</SPAN></P>
<P><SPAN>viewer-&gt;SetColorWindow(255);<BR>viewer-&gt;SetColorLevel(128);<BR>ImgRenderWindowInteractor-&gt;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>