[Insight-users] itkBlockMatchingImageFilter on images of different dimensions ?

David Fuentes fuentesdt at gmail.com
Tue Feb 19 11:15:17 EST 2013


Hi,

Is the itkBlockMatchingImageFilter intended to be applied to fixed/moving
images that have been resampled to the same
imaging dimensions ?  Otherwise would the below patch allow running the
block match on two different dimension images where
the TransformPhysicalPointToIndex may return different values ?



diff --git
a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
index 1835a1d..75c144c 100644
--- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
+++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx
@@ -257,8 +257,9 @@ BlockMatchingImageFilter< TFixedImage, TMovingImage,
TFeatures, TDisplacements,
   for ( SizeValueType idx = first, last = first + count; idx < last; idx++
)
     {
     FeaturePointsPhysicalCoordinates originalLocation =
featurePoints->GetPoint( idx );
-    ImageIndexType index;
-    fixedImage->TransformPhysicalPointToIndex( originalLocation, index );
+    ImageIndexType fixedIndex,floatingIndex;
+    fixedImage->TransformPhysicalPointToIndex( originalLocation,
fixedIndex );
+    floatingImage->TransformPhysicalPointToIndex( originalLocation,
floatingIndex );

     // the block is selected for a minimum similarity metric
     SimilaritiesValue  similarity = NumericTraits< SimilaritiesValue
>::Zero;
@@ -267,9 +268,9 @@ BlockMatchingImageFilter< TFixedImage, TMovingImage,
TFeatures, TDisplacements,
     DisplacementsVector displacement;

     // set centers of window and center regions to current location
-    ImageIndexType start = index - this->m_SearchRadius;
+    ImageIndexType start = fixedIndex - this->m_SearchRadius;
     window.SetIndex( start );
-    center.SetIndex( index );
+    center.SetIndex( floatingIndex );

     // iterate over neighborhoods in region window, for each neighborhood:
iterate over voxels in blockRadius
     ConstNeighborhoodIterator< FixedImageType > windowIterator(
m_BlockRadius, fixedImage, window );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130219/49b01785/attachment.htm>


More information about the Insight-users mailing list