<div dir="ltr"><div style>Hi,</div><div style><br></div><div style>The ZeroFluxNeumannBoundaryCondition that is being used by default for the </div><div style>ConstNeighborhoodIterator is causing seg faults on two images of different spacing and dimension for the BlockMatching filter. It is difficult to track down what is exactly causing the seg fault, but the ConstantBoundaryCondition seems to work.</div>
<div style><br></div><div style>Is there any benefit of the  ZeroFluxNeumannBoundaryCondition ?</div><div><br></div><div><br></div><div><br></div><div>index 2b6635b..5fb38a9 100644</div><div>--- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx</div>
<div>+++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx</div><div>@@ -21,6 +21,7 @@</div><div> #include &quot;itkBlockMatchingImageFilter.h&quot;</div><div> #include &quot;itkImageRegionConstIterator.h&quot;</div>
<div> #include &quot;itkConstNeighborhoodIterator.h&quot;</div><div>+#include &quot;itkConstantBoundaryCondition.h&quot;</div><div> #include &lt;limits&gt;</div><div> </div><div> </div><div>@@ -314,10 +315,12 @@ BlockMatchingImageFilter&lt; TFixedImage, TMovingImage, TFeatures, TDisplacements,</div>
<div>     center.SetIndex( movingIndex );</div><div> </div><div>     // iterate over neighborhoods in region window, for each neighborhood: iterate over voxels in blockRadius</div><div>-    ConstNeighborhoodIterator&lt; FixedImageType &gt; windowIterator( m_BlockRadius, fixedImage, window );</div>
<div>+    typedef itk::ConstantBoundaryCondition&lt;FixedImageType&gt;  FixedBoundaryConditionType;</div><div>+    ConstNeighborhoodIterator&lt; FixedImageType,FixedBoundaryConditionType &gt; windowIterator( m_BlockRadius, fixedImage, window );</div>
<div> </div><div>     // iterate over voxels in neighborhood of current feature point</div><div>-    ConstNeighborhoodIterator&lt; MovingImageType &gt; centerIterator( m_BlockRadius, movingImage, center );</div><div>+    typedef itk::ConstantBoundaryCondition&lt;MovingImageType&gt;  MovingBoundaryConditionType;</div>
<div>+    ConstNeighborhoodIterator&lt; MovingImageType,MovingBoundaryConditionType &gt; centerIterator( m_BlockRadius, movingImage, center );</div><div>     centerIterator.GoToBegin();</div><div><br></div></div>