I added the try/catch block. It gives a segmentation fault, however does not throw an exception. Here is the code and the output:<br><br><b>Code:</b><br>            typedef unsigned char PixelType;<br>            const unsigned int Dimension = 3;<br>

            typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;<br>            <br>            typedef itk::ImageSeriesReader&lt; ImageType &gt; ReaderType;<br>            <br>            ReaderType::Pointer reader = ReaderType::New();<br>

            <br>            typedef itk::NumericSeriesFileNames    NameGeneratorType;<br>            NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();<br><br><br>            nameGenerator-&gt;SetSeriesFormat( &quot;/root/Desktop/default_10-v1.0.3/default_10-v1.0.3/phantom_01/clean/dwi-%02d.hdr&quot; );<br>

    <br>            nameGenerator-&gt;SetStartIndex( 0 );<br>            nameGenerator-&gt;SetEndIndex( 66 );<br>            nameGenerator-&gt;SetIncrementIndex( 1 );<br>    <br>            reader-&gt;SetImageIO( itk::AnalyzeImageIO::New() );<br>

        <br>            reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames() );<br>    <br>            cout &lt;&lt; &quot;Before try/catch&quot; &lt;&lt; endl;<br>            try<br>            {<br>                cout &lt;&lt; &quot;Try1&quot; &lt;&lt; endl;<br>

                reader-&gt;Update();<br>                cout &lt;&lt; &quot;Try2&quot; &lt;&lt; endl;<br>            }<br>            catch (itk::ExceptionObject &amp;e)<br>            {<br>                std::cerr &lt;&lt; e &lt;&lt; std::endl;<br>

                return EXIT_FAILURE;<br>            }<br><br><br><b>Output:</b><br>Before try/catch<br>Try1<br>Segmentation fault<br><br><br clear="all">Ahmet Burak Yoldemir<br>
<br><br><div class="gmail_quote">On Sun, Nov 8, 2009 at 11:23 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">Place a try/catch block around the reader-&gt;Update() and print the<br>
exception if one is thrown.<br>
<br>
  try<br>
    {<br>
    reader-&gt;Update();<br>
    }<br>
  catch (itk::ExceptionObject &amp;e)<br>
    {<br>
    std::cerr &lt;&lt; e &lt;&lt; std::endl;<br>
    return EXIT_FAILURE;<br>
    }<br>
<br>
<br>
On Sun, Nov 8, 2009 at 3:40 PM, A.Burak Yoldemir &lt;<a href="mailto:yoldemir@gmail.com">yoldemir@gmail.com</a>&gt; wrote:<br>
</div><div><div></div><div class="h5">&gt; Hello,<br>
&gt;<br>
&gt; I am trying to read Analyze 7.5 images using ITK, however I am getting<br>
&gt; segfault. Here is the relevant code:<br>
&gt;<br>
&gt;             typedef unsigned char PixelType;<br>
&gt;             const unsigned int Dimension = 3;<br>
&gt;             typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;<br>
&gt;<br>
&gt;             typedef itk::ImageSeriesReader&lt; ImageType &gt; ReaderType;<br>
&gt;<br>
&gt;             ReaderType::Pointer reader = ReaderType::New();<br>
&gt;<br>
&gt;             typedef itk::NumericSeriesFileNames    NameGeneratorType;<br>
&gt;             NameGeneratorType::Pointer nameGenerator =<br>
&gt; NameGeneratorType::New();<br>
&gt;<br>
&gt;             nameGenerator-&gt;SetSeriesFormat(<br>
&gt; &quot;/root/Desktop/default_10-v1.0.3/default_10-v1.0.3/phantom_01/clean/dwi-%02d.hdr&quot;<br>
&gt; );<br>
&gt;<br>
&gt;             nameGenerator-&gt;SetStartIndex( 0 );<br>
&gt;             nameGenerator-&gt;SetEndIndex( 66 );<br>
&gt;             nameGenerator-&gt;SetIncrementIndex( 1 );<br>
&gt;<br>
&gt;             reader-&gt;SetImageIO( itk::AnalyzeImageIO::New() );<br>
&gt;<br>
&gt;             reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames() );<br>
&gt;             reader-&gt;Update();<br>
&gt;<br>
&gt; I am getting a segmentation fault when the update method is called. Any<br>
&gt; ideas?<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt;<br>
&gt; Ahmet Burak Yoldemi<br>
</div></div><div><div></div><div class="h5">&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>