Sorry. This is probably a simple fix, but I don't understand why it doesn't work. For some reason, with the following code, where fn_image1 is simply argv[1], at reader->Update(), my program always throws an exception. 
<br><br>&nbsp;&nbsp;&nbsp; typedef itk::Image &lt; unsigned char, 3 &gt; ImageVType;<br>&nbsp;&nbsp;&nbsp; typedef itk::ImageFileReader &lt; ImageVType &gt; ImageReaderType;<br>&nbsp;&nbsp;&nbsp; ImageReaderType::Pointer reader = ImageReaderType::New();<br>&nbsp;&nbsp;&nbsp; ImageVType::Pointer image;
<br>&nbsp;&nbsp;&nbsp; try <br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;SetFileName( fn_image1 );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;Update();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image = reader-&gt;GetOutput();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; catch(...)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; &quot;Error while reading in fixed image.&quot; &lt;&lt; std::endl;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw;<br>&nbsp;&nbsp;&nbsp; }<br><br>Using the VS 7.0 debugger it points to itkimagefilereader.txx<br><br>&nbsp;&nbsp;&nbsp; // Test if the file can be open for reading access.<br>-&gt; &nbsp;&nbsp; std::ifstream readTester;<br>&nbsp;&nbsp;&nbsp; readTester.open( m_FileName.c_str() );
<br><br>I don't quite understand what the problem is. Compiling other examples, the filereader seems to function normally. Also the file I'm trying to read is in the debug folder, and therefore is in the same path as the compiled executable. Information on how to fix this issue would be appreciated.
<br><br>-Jonathan Wong<br>