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

Matt McCormick matt.mccormick at kitware.com
Mon Apr 15 10:18:14 EDT 2013


Hi David,

It depends on the assumptions in the block-matching algorithm, and the
data, but ZorFluxNeumannBoundaryCondition is usually better than
ConstantBoundaryCondition.  For some datasets, like brain CT's,
ConstantBoundaryCondition is sufficient, but most other cases it is
not.

Thanks,
Matt

On Mon, Apr 15, 2013 at 3:07 AM, David Fuentes <fuentesdt at gmail.com> wrote:
> 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();
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list