<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 "itkBlockMatchingImageFilter.h"</div><div> #include "itkImageRegionConstIterator.h"</div>
<div> #include "itkConstNeighborhoodIterator.h"</div><div>+#include "itkConstantBoundaryCondition.h"</div><div> #include <limits></div><div> </div><div> </div><div>@@ -314,10 +315,12 @@ BlockMatchingImageFilter< 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< FixedImageType > windowIterator( m_BlockRadius, fixedImage, window );</div>
<div>+ typedef itk::ConstantBoundaryCondition<FixedImageType> FixedBoundaryConditionType;</div><div>+ ConstNeighborhoodIterator< FixedImageType,FixedBoundaryConditionType > windowIterator( m_BlockRadius, fixedImage, window );</div>
<div> </div><div> // iterate over voxels in neighborhood of current feature point</div><div>- ConstNeighborhoodIterator< MovingImageType > centerIterator( m_BlockRadius, movingImage, center );</div><div>+ typedef itk::ConstantBoundaryCondition<MovingImageType> MovingBoundaryConditionType;</div>
<div>+ ConstNeighborhoodIterator< MovingImageType,MovingBoundaryConditionType > centerIterator( m_BlockRadius, movingImage, center );</div><div> centerIterator.GoToBegin();</div><div><br></div></div>