Look like the i/o factories are not initialized properly. What does your CMakeLists.txt file look like?<div><br><br><div class="gmail_quote">On Fri, Oct 26, 2012 at 12:18 AM, xianjun.sun.ext_CRC <span dir="ltr">&lt;<a href="mailto:xianjun.sun.ext@united-imaging.com" target="_blank">xianjun.sun.ext@united-imaging.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div lang="ZH-CN" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span lang="EN-US">Hello all, <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">    I tried to read a .nii
file, but when debug reader-&gt;Update(), an exception happened. Could anyone
help me ?<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">   
</span><span lang="EN-US" style="font-family:NSimSun;color:blue">try</span><span lang="EN-US" style="font-family:NSimSun"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    {<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    
fixedImageReader-&gt;Update();<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    }<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">  <span style="color:blue">catch</span>(
itk::ExceptionObject &amp; excp )<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    {<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    std::cerr &lt;&lt; <span style="color:#a31515">&quot;Exception thrown while reading the image&quot;</span>
&lt;&lt; std::endl;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    std::cerr &lt;&lt; excp &lt;&lt;
std::endl;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:NSimSun">    }<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">    Exception thrown while
reading the image<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">itk::ImageFileReaderException
(0044F158) Location: <u></u><u></u></span></p>

<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">&quot;void
__thiscall itk::ImageFileReader&lt;class itk::Image&lt;short,3&gt;,class<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">itk::DefaultConvertPixelTraits&lt;short&gt;
&gt;::GenerateOutputInformation(void)&quot;<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">File: c:\program files
(x86)\itk\include\itk-4.2\itkimagefilereader.hxx<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">Line: 143<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">Description:  Could not create IO
object for file E:\Atlas\data_case5.nii<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">  Tried to create one of the
following:<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">  You probably failed to set a file
suffix, or<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">    set the suffix to an
unsupported type.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">    <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">   Actually, I used itk\Examples\IO\ImageReadWrite.cxx
to read the same .nii file,  it could be read out rightly. <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm"><span lang="EN-US" style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">I
am using:<u></u><u></u></span></p>

<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm"><span lang="EN-US" style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> -
VS 2010<u></u><u></u></span></p>

<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm"><span lang="EN-US" style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> -
Windows 7 64 bit. <u></u><u></u></span></p>

<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm"><span lang="EN-US" style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">and
the platform I build my C++ projects is Win32.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><u></u> <u></u></span></p>

</div>

</div>


<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div>