Is the program catching  any itk::exception ? if not, add an additional catch sentence with ordinary exception and see if any other error message appears<br><br><div class="gmail_quote">On Sun, Jul 22, 2012 at 3:13 AM, Elhassan Abdou <span dir="ltr">&lt;<a href="mailto:hassan.abdou@yahoo.com" target="_blank">hassan.abdou@yahoo.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><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span>Hi</span></div><div><br></div><div>Can anyone help me and tell me why reader-&gt;Update in this code is giving me SIGABRT signal. </div>
<div>I can not understand what is wrong PLease help me</div><div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#ifndef</span><span style="color:#c0c0c0"> </span>BONESEGMENT_H</pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#define</span><span style="color:#c0c0c0"> </span>BONESEGMENT_H</pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;itkImage.h&quot;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;itkGDCMImageIO.h&quot;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;itkGDCMSeriesFileNames.h&quot;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;itkImageSeriesReader.h&quot;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;itkImageToVTKImageFilter.h&quot;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;QString&gt;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;QMessageBox&gt;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;vtkImageData.h&gt;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;string&gt;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><font color="#000080"><br></font></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">class</span><span style="color:#c0c0c0"> </span>BoneSegment</pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">public</span><span style>:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>BoneSegment<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span>readDirectory<span style>(</span><span style="color:#800080">QString</span><span style="color:#c0c0c0"> </span>dirName<span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>vtkImageData<span style>*</span><span style="color:#c0c0c0"> </span>getImageData<span style>()</span><span style="color:#808000">const</span><span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span><span style="color:#808000">signed</span><span style="color:#c0c0c0"> </span><span style="color:#808000">short</span><span style="color:#c0c0c0">    </span>PixelType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>itk<span style>::</span>Image<span style>&lt;</span><span style="color:#c0c0c0"> </span>PixelType<span style>,</span><span style="color:#c0c0c0"> </span><span style="color:#000080">3</span><span style="color:#c0c0c0"> </span><span style>&gt;</span>ImageType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>itk<span style>::</span>ImageSeriesReader<span style>&lt;</span><span style="color:#c0c0c0"> </span>ImageType<span style="color:#c0c0c0"> </span><span style>&gt;</span><span style="color:#c0c0c0">        </span>ReaderType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>ReaderType<span style>::</span>Pointer<span style="color:#c0c0c0"> </span>reader<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>itk<span style>::</span>GDCMImageIO<span style="color:#c0c0c0">       </span>ImageIOType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>ImageIOType<span style>::</span>Pointer<span style="color:#c0c0c0"> </span>dicomIO<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>itk<span style>::</span>GDCMSeriesFileNames<span style="color:#c0c0c0"> </span>NamesGeneratorType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span>NamesGeneratorType<span style>::</span>Pointer<span style="color:#c0c0c0"> </span>nameGenerator<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>std<span style>::</span>vector<span style>&lt;</span><span style="color:#c0c0c0"> </span>std<span style>::</span>string<span style="color:#c0c0c0"> </span><span style>&gt;</span><span style="color:#c0c0c0">    </span>SeriesIdContainer<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>std<span style>::</span>vector<span style>&lt;</span><span style="color:#c0c0c0"> </span>std<span style>::</span>string<span style="color:#c0c0c0"> </span><span style>&gt;</span><span style="color:#c0c0c0">   </span>FileNamesContainer<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span>itk<span style>::</span>ImageToVTKImageFilter<span style>&lt;</span>ImageType<span style>&gt;</span><span style="color:#c0c0c0">       </span>ConnectorType<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>};</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">BoneSegment<span style>::</span>BoneSegment<span style>(){</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span>BoneSegment<span style>::</span>readDirectory<span style>(</span><span style="color:#800080">QString</span><span style="color:#c0c0c0"> </span>dirName<span style>){</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>reader<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>ReaderType<span style>::</span>New<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>dicomIO<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>ImageIOType<span style>::</span>New<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>NamesGeneratorType<span style>::</span>New<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>SetUseSeriesDetails<span style>(</span><span style="color:#c0c0c0"> </span><span style="color:#808000">true</span><span style="color:#c0c0c0"> </span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>AddSeriesRestriction<span style>(</span><span style="color:#008000">&quot;0008|0021&quot;</span><span style="color:#c0c0c0"> </span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>AddSeriesRestriction<span style>(</span><span style="color:#008000">&quot;0020,0037&quot;</span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>LoadSequencesOn<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>LoadPrivateTagsOn<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>nameGenerator<span style>-&gt;</span>SetInputDirectory<span style>(</span><span style="color:#c0c0c0"> </span>dirName<span style>.</span>toStdString<span style>());</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">const</span><span style="color:#c0c0c0"> </span>SeriesIdContainer<span style="color:#c0c0c0"> </span><span style>&amp;</span><span style="color:#c0c0c0"> </span>seriesUID<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>nameGenerator<span style>-&gt;</span>GetSeriesUIDs<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>std<span style>::</span>string<span style="color:#c0c0c0"> </span>seriesIdentifier<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>seriesIdentifier<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>seriesUID<span style>.</span>begin<span style>()-&gt;</span>c_str<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>FileNamesContainer<span style="color:#c0c0c0"> </span>fileNames<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>fileNames<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>nameGenerator<span style>-&gt;</span>GetFileNames<span style>(</span><span style="color:#c0c0c0"> </span>seriesIdentifier<span style="color:#c0c0c0"> </span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>reader<span style>-&gt;</span>UseStreamingOn<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>reader<span style>-&gt;</span>SetFileNames<span style>(</span><span style="color:#c0c0c0"> </span>fileNames<span style="color:#c0c0c0"> </span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>reader<span style>-&gt;</span>SetImageIO<span style>(</span><span style="color:#c0c0c0"> </span>dicomIO<span style="color:#c0c0c0"> </span><span style>);</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">try</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span>reader<span style>-&gt;</span>Update<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">       </span><span style="color:#808000">catch</span><span style="color:#c0c0c0"> </span><span style>(</span>itk<span style>::</span>ExceptionObject<span style="color:#c0c0c0"> </span><span style>&amp;</span>ex<span style>)</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span>std<span style>::</span>cout<span style="color:#c0c0c0"> </span><span style>&lt;&lt;</span><span style="color:#c0c0c0"> </span>ex<span style="color:#c0c0c0"> </span><span style>&lt;&lt;</span><span style="color:#c0c0c0"> </span>std<span style>::</span>endl<span style>;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">         </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">vtkImageData<span style>*</span><span style="color:#c0c0c0"> </span>BoneSegment<span style>::</span>getImageData<span style>()</span><span style="color:#808000">const</span><span style>{</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span>ConnectorType<span style>::</span>Pointer<span style="color:#c0c0c0"> </span>connector<span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>ConnectorType<span style>::</span>New<span style>();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span>connector<span style>-&gt;</span>SetInput<span style>(</span>reader<span style>-&gt;</span>GetOutput<span style>());</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">     </span><span style="color:#808000">return</span><span style="color:#c0c0c0"> </span><span style>(</span>connector<span style>-&gt;</span>GetOutput<span style>());</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000080">#endif</span><span style="color:#c0c0c0"> </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> </span><span style="color:#008000">BONESEGMENT_H</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre></div><div> </div><div>El-Hassan Mohamed <br>Biomedical engineering</div></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>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com">www.alma3d.com</a><br>