<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:NSimSun;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:SimSun;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hello all, <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US> I tried to read a .nii
file, but when debug reader->Update(), an exception happened. Could anyone
help me ?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></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'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> {<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'>
fixedImageReader->Update();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> }<o:p></o:p></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 & excp )<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> {<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> std::cerr << <span
style='color:#A31515'>"Exception thrown while reading the image"</span>
<< std::endl;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> std::cerr << excp <<
std::endl;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-family:NSimSun'> }<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Exception thrown while
reading the image<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>itk::ImageFileReaderException
(0044F158) Location: <o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>"void
__thiscall itk::ImageFileReader<class itk::Image<short,3>,class<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>itk::DefaultConvertPixelTraits<short>
>::GenerateOutputInformation(void)"<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>File: c:\program files
(x86)\itk\include\itk-4.2\itkimagefilereader.hxx<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Line: 143<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Description: Could not create IO
object for file E:\Atlas\data_case5.nii<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Tried to create one of the
following:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> You probably failed to set a file
suffix, or<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> set the suffix to an
unsupported type.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></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. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:0cm'><span lang=EN-US style='font-family:"Arial","sans-serif"'>I
am using:<o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:0cm'><span lang=EN-US style='font-family:"Arial","sans-serif"'> -
VS 2010<o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:0cm'><span lang=EN-US style='font-family:"Arial","sans-serif"'> -
Windows 7 64 bit. <o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:0cm'><span lang=EN-US style='font-family:"Arial","sans-serif"'>and
the platform I build my C++ projects is Win32.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>
</div>
</body>
</html>