<div dir="ltr">Thanks Matt,<div><br></div><div>The default ZeroFluxNeumannBC that is used should not segfault when I access pixels outside the image ? correct ? </div><div>When I run the block match, i&#39;m expecting pixel access outside the image boundary to be taken care of by the Boundary condition class, but I&#39;m getting seg faults?</div>
<div>Is there some possible setup that I need for the ZeroFluxNeumanBC ? </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 15, 2013 at 9:18 AM, Matt McCormick <span dir="ltr">&lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
It depends on the assumptions in the block-matching algorithm, and the<br>
data, but ZorFluxNeumannBoundaryCondition is usually better than<br>
ConstantBoundaryCondition.  For some datasets, like brain CT&#39;s,<br>
ConstantBoundaryCondition is sufficient, but most other cases it is<br>
not.<br>
<br>
Thanks,<br>
Matt<br>
<div><div class="h5"><br>
On Mon, Apr 15, 2013 at 3:07 AM, David Fuentes &lt;<a href="mailto:fuentesdt@gmail.com">fuentesdt@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; The ZeroFluxNeumannBoundaryCondition that is being used by default for the<br>
&gt; ConstNeighborhoodIterator is causing seg faults on two images of different<br>
&gt; spacing and dimension for the BlockMatching filter. It is difficult to track<br>
&gt; down what is exactly causing the seg fault, but the<br>
&gt; ConstantBoundaryCondition seems to work.<br>
&gt;<br>
&gt; Is there any benefit of the  ZeroFluxNeumannBoundaryCondition ?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; index 2b6635b..5fb38a9 100644<br>
&gt; --- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx<br>
&gt; +++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx<br>
&gt; @@ -21,6 +21,7 @@<br>
&gt;  #include &quot;itkBlockMatchingImageFilter.h&quot;<br>
&gt;  #include &quot;itkImageRegionConstIterator.h&quot;<br>
&gt;  #include &quot;itkConstNeighborhoodIterator.h&quot;<br>
&gt; +#include &quot;itkConstantBoundaryCondition.h&quot;<br>
&gt;  #include &lt;limits&gt;<br>
&gt;<br>
&gt;<br>
&gt; @@ -314,10 +315,12 @@ BlockMatchingImageFilter&lt; TFixedImage, TMovingImage,<br>
&gt; TFeatures, TDisplacements,<br>
&gt;      center.SetIndex( movingIndex );<br>
&gt;<br>
&gt;      // iterate over neighborhoods in region window, for each neighborhood:<br>
&gt; iterate over voxels in blockRadius<br>
&gt; -    ConstNeighborhoodIterator&lt; FixedImageType &gt; windowIterator(<br>
&gt; m_BlockRadius, fixedImage, window );<br>
&gt; +    typedef itk::ConstantBoundaryCondition&lt;FixedImageType&gt;<br>
&gt; FixedBoundaryConditionType;<br>
&gt; +    ConstNeighborhoodIterator&lt; FixedImageType,FixedBoundaryConditionType &gt;<br>
&gt; windowIterator( m_BlockRadius, fixedImage, window );<br>
&gt;<br>
&gt;      // iterate over voxels in neighborhood of current feature point<br>
&gt; -    ConstNeighborhoodIterator&lt; MovingImageType &gt; centerIterator(<br>
&gt; m_BlockRadius, movingImage, center );<br>
&gt; +    typedef itk::ConstantBoundaryCondition&lt;MovingImageType&gt;<br>
&gt; MovingBoundaryConditionType;<br>
&gt; +    ConstNeighborhoodIterator&lt; MovingImageType,MovingBoundaryConditionType<br>
&gt;&gt; centerIterator( m_BlockRadius, movingImage, center );<br>
&gt;      centerIterator.GoToBegin();<br>
&gt;<br>
&gt;<br>
</div></div>&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.php" target="_blank">http://www.kitware.com/products/protraining.php</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>
</blockquote></div><br></div>