Dear,<div><br></div><div>More precisely, i find the place of program crash which is line no 189 
in ImageToImageFilter file. The member inputPtrN is supposed to be NULL because the dynamic_cast should fail, but it does not. Then the seeds are consider as image input and it doesn&#39;t work properly. </div><div><br></div>
<div>Why this problem come and How can i solve this problem or prevent this error?</div><div><br></div><div><br></div><div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Humayun Irshad</b> <span dir="ltr">&lt;<a href="mailto:humayun.irshad@gmail.com">humayun.irshad@gmail.com</a>&gt;</span><br>
Date: Mon, Apr 2, 2012 at 1:45 PM<br>Subject: LevelSetBasedCellSegmentation Crash<br>To: Insight User &lt;<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br><br><br>Dear All,<div><br></div><div>I am using LevelSetBasedCellSegmentation filter to segment image. I give Centroid (Seed Point) of candidate cells and grayscale image but it crash during execution with this error:</div>
<div><br>
</div><div>itk::ExceptionObject (O1FDEDB0)</div><div>Location: &quot;void __thiscall itk::ImageToImageFilter&lt;class itk::Image&lt;float, 2&gt;, class itk::Image&lt;float, 2&gt; &gt;::VerifyInputInformation(void)&quot;</div>

<div>File:H:\itk\modules\core\common\include\itkImageToImageFilter.txx</div><div><br></div><div>GeodesicActiveContourLevelSetImageFilter(0359D700): Input do not occupy the same physical space! InputImage origin: [-1.2000000e+001, -1.20000000e+001], InputImageIndexedDataObject1 Origin: [1.2550000e+003, 4.80000000e+001] Tolerance: 1.0000000e-006<br clear="all">

<div><br></div><div>This code is here:</div><div><br></div><div><div>                       CharReaderType::Pointer charReader = CharReaderType::New();</div><div><span style="white-space:pre-wrap">                        </span>charReader-&gt;SetFileName( &quot;image.bmp&quot; );</div>

<div><span style="white-space:pre-wrap">                        </span>try<span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                        </span>{</div><div><span style="white-space:pre-wrap">                                </span>charReader-&gt;Update();</div>

<div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                        </span>catch (itk::ExceptionObject&amp; excp)</div><div><span style="white-space:pre-wrap">                        </span>{</div>
<div><span style="white-space:pre-wrap">                                </span>std::cerr &lt;&lt; &quot;Err in Reading char image - Exception caught &quot; &lt;&lt; excp &lt;&lt; std::endl;<span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">                                </span>return;</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>// 2 - Perform Image enhancment and Noise removal</div>

<div><span style="white-space:pre-wrap">                        </span>CharImageSizeType meanRadius;</div><div><span style="white-space:pre-wrap">                        </span>meanRadius.Fill(4);</div><div><span style="white-space:pre-wrap">                        </span>MeanImageFilterType::Pointer mean = MeanImageFilterType::New();</div>

<div><span style="white-space:pre-wrap">                        </span>mean-&gt;SetRadius( meanRadius );</div><div><span style="white-space:pre-wrap">                        </span>mean-&gt;SetInput( charReader-&gt;GetOutput() );</div>
<div><span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                        </span>// 3 - Perform Binary Thresholding</div><div><span style="white-space:pre-wrap">                        </span>BinaryThresholdImageFilterType::Pointer threshold = BinaryThresholdImageFilterType::New();</div>

<div><span style="white-space:pre-wrap">                        </span>threshold-&gt;SetLowerThreshold( lowerThreshold );</div><div><span style="white-space:pre-wrap">                        </span>threshold-&gt;SetUpperThreshold( upperThreshold );</div>
<div><span style="white-space:pre-wrap">                        </span>threshold-&gt;SetOutsideValue( backgroundPixel );</div><div><span style="white-space:pre-wrap">                        </span>threshold-&gt;SetInsideValue( foregroundPixel );</div>
<div><span style="white-space:pre-wrap">                        </span>threshold-&gt;SetInput( mean-&gt;GetOutput() );</div><div><br></div><div><span style="white-space:pre-wrap">                </span>        BinaryImageToLabelMapFilterType::Pointer binaryImageToLabelMapFilter = BinaryImageToLabelMapFilterType::New();</div>

<div><span style="white-space:pre-wrap">                        </span>binaryImageToLabelMapFilter-&gt;SetInput( 
threshold -&gt;GetOutput() );</div><div><span style="white-space:pre-wrap">                        </span>binaryImageToLabelMapFilter-&gt;Update();</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>itk::SimpleFilterWatcher watcher(binaryImageToLabelMapFilter, &quot;filter&quot;);</div>

<div><br></div><div><span style="white-space:pre-wrap">                        </span>typedef itk::ShapeLabelMapFilter&lt; LabelMapType &gt; ShapeLabelMapFilterType;</div><div><span style="white-space:pre-wrap">                        </span>ShapeLabelMapFilterType::Pointer shapeFilter = ShapeLabelMapFilterType::New();</div>

<div><span style="white-space:pre-wrap">                        </span>shapeFilter-&gt;SetInput( binaryImageToLabelMapFilter-&gt;GetOutput() );</div><div><span style="white-space:pre-wrap">                        </span>shapeFilter-&gt;Update();</div>
<div><br></div><div><span style="white-space:pre-wrap">                        </span>LabelMapPointer labelMap = binaryImageToLabelMapFilter-&gt;GetOutput();</div><div><span style="white-space:pre-wrap">                        </span>for( unsigned int label=1; label&lt;=labelMap-&gt;GetNumberOfLabelObjects(); label++ )</div>

<div><span style="white-space:pre-wrap">                        </span>{</div><div><span style="white-space:pre-wrap">                                </span>const ShapeLabelObjectType * labelObject = labelMap-&gt;GetLabelObject( label );</div>
<div><span style="white-space:pre-wrap">                                </span>CharImageIndexType centerIndex;</div><div><span style="white-space:pre-wrap">                                </span>centerIndex[0] = labelObject-&gt;GetCentroid()[0];</div>
<div><span style="white-space:pre-wrap">                                </span>centerIndex[1] = labelObject-&gt;GetCentroid()[1];</div><div><span style="white-space:pre-wrap">                                </span>if(centerIndex[0] &gt; 50 &amp;&amp; centerIndex[1] &gt; 50 )</div>

<div><span style="white-space:pre-wrap">                                        </span>candidateCentroids.push_back( centerIndex );</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>typedef itk::LevelSetBasedCellSegmentation&lt; CharImageType, CharImageType &gt;    LevelSetBasedCellSegmentationType;</div>

<div><span style="white-space:pre-wrap">                        </span>LevelSetBasedCellSegmentationType::Pointer levelSetSegmentor = LevelSetBasedCellSegmentationType::New();</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetInput( mean-&gt;GetOutput());</div>

<div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetLargestCellRadius( 30.0 ); // in real coordinates</div><div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetSeedValue( 10 );</div>

<div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetIterations( 500 );</div><div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetPropagationScaling( 4 );</div>
<div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetCurvatureScaling( 1 );</div><div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetAdvectionScaling( 1 );</div>
<div><span style="white-space:pre-wrap">                        </span>levelSetSegmentor-&gt;SetMaxRMSChange( 0.01 );</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>for( unsigned int seedNo = 0; seedNo &lt; candidateCentroids.size(); seedNo++ )</div>

<div><span style="white-space:pre-wrap">                                </span>levelSetSegmentor-&gt;seeds[seedNo] = static_cast&lt;CharImageIndexType&gt; (candidateCentroids[seedNo]);</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>try<span style="white-space:pre-wrap">                </span></div>

<div><span style="white-space:pre-wrap">                        </span>{</div><div><span style="white-space:pre-wrap">                                </span>levelSetSegmentor-&gt;Update();</div><div><span style="white-space:pre-wrap">                        </span>}</div>
<div><span style="white-space:pre-wrap">                        </span>catch (itk::ExceptionObject&amp; excp)</div><div><span style="white-space:pre-wrap">                        </span>{</div><div><span style="white-space:pre-wrap">                                </span>std::cerr &lt;&lt; &quot;Err in LevelSetBasedCellSegmentationFilter 1: - Exception caught &quot; &lt;&lt; &quot;\n&quot; &lt;&lt; excp &lt;&lt; std::endl;<span style="white-space:pre-wrap">        </span></div>

<div><span style="white-space:pre-wrap">                                </span>return;</div><div><span style="white-space:pre-wrap">                        </span>}</div></div><div><br></div>-- <br><font face="arial, helvetica, sans-serif">-- <br>
Best Regards, <br><br></font><div><b><font face="arial, helvetica, sans-serif">HUMAYUN IRSHAD</font></b></div><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div>
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">PhD student, University of Joseph Fourier, Grenoble, France</font></span></b></span></div>

</span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important"><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">

<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">Research Engineer, </font></span></b></span></div></span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">

<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">IPAL – Image &amp; Pervasive Access Lab, Singapore</font></span></b></span></div>

</span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">UMI CNRS (I2R/A*STAR, NUS, UJF, UPMC, IT)</font></span></b></span></div>

<div><div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif"><div><span style="border-collapse:collapse"><br></span></div>Institute for Infocomm Research (I2R)<br>1 Fusionopolis Way<br>
#10-19 Connexis South Tower<br>
Singapore 138632<br>Tel:<a href="tel:%2B65-65162864" value="+6565162864" target="_blank">+65-65162864</a></font></span></div></div></div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif">Cell: <a href="tel:%2B65-83851671" value="+6583851671" target="_blank">+65-83851671</a></font></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>
</span></div></span></b></span></div><br>
</div>
</div><br><br clear="all"><div><br></div>-- <br><font face="arial, helvetica, sans-serif">-- <br>Best Regards, <br><br></font><div><b><font face="arial, helvetica, sans-serif">HUMAYUN IRSHAD</font></b></div><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div>
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important"><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">PhD student, University of Joseph Fourier, Grenoble, France</font></span></b></span></div>
</span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important"><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">Research Engineer, </font></span></b></span></div></span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">IPAL – Image &amp; Pervasive Access Lab, Singapore</font></span></b></span></div>
</span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">UMI CNRS (I2R/A*STAR, NUS, UJF, UPMC, IT)</font></span></b></span></div>
<div><div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif"><div><span style="border-collapse:collapse"><br></span></div>Institute for Infocomm Research (I2R)<br>1 Fusionopolis Way<br>#10-19 Connexis South Tower<br>
Singapore 138632<br>Tel:+65-65162864</font></span></div></div></div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif">Cell: +65-83851671</font></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>
</span></div></span></b></span></div><br>
</div>