[Insight-users] Block match seg fault on different dimension images

David Fuentes fuentesdt at gmail.com
Sun Apr 14 23:07:06 EDT 2013


Hi,

The ZeroFluxNeumannBoundaryCondition that is being used by default for the
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.

Is there any benefit of the  ZeroFluxNeumannBoundaryCondition ?



index 2b6635b..5fb38a9 100644
--- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
+++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
@@ -21,6 +21,7 @@
 #include "itkBlockMatchingImageFilter.h"
 #include "itkImageRegionConstIterator.h"
 #include "itkConstNeighborhoodIterator.h"
+#include "itkConstantBoundaryCondition.h"
 #include <limits>


@@ -314,10 +315,12 @@ BlockMatchingImageFilter< TFixedImage, TMovingImage,
TFeatures, TDisplacements,
     center.SetIndex( movingIndex );

     // iterate over neighborhoods in region window, for each neighborhood:
iterate over voxels in blockRadius
-    ConstNeighborhoodIterator< FixedImageType > windowIterator(
m_BlockRadius, fixedImage, window );
+    typedef itk::ConstantBoundaryCondition<FixedImageType>
 FixedBoundaryConditionType;
+    ConstNeighborhoodIterator< FixedImageType,FixedBoundaryConditionType >
windowIterator( m_BlockRadius, fixedImage, window );

     // iterate over voxels in neighborhood of current feature point
-    ConstNeighborhoodIterator< MovingImageType > centerIterator(
m_BlockRadius, movingImage, center );
+    typedef itk::ConstantBoundaryCondition<MovingImageType>
 MovingBoundaryConditionType;
+    ConstNeighborhoodIterator< MovingImageType,MovingBoundaryConditionType
> centerIterator( m_BlockRadius, movingImage, center );
     centerIterator.GoToBegin();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130414/99854de7/attachment.htm>


More information about the Insight-users mailing list