<div>Hi,</div><div><br></div><div>Is the itkBlockMatchingImageFilter intended to be applied to fixed/moving images that have been resampled to the same</div><div>imaging dimensions ?  Otherwise would the below patch allow running the block match on two different dimension images where</div>
<div>the TransformPhysicalPointToIndex may return different values ? </div><div><br></div><br><div><br></div><div><div>diff --git a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx</div>
<div>index 1835a1d..75c144c 100644</div><div>--- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx</div><div>+++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx</div><div>@@ -257,8 +257,9 @@ BlockMatchingImageFilter&lt; TFixedImage, TMovingImage, TFeatures, TDisplacements,</div>
<div>   for ( SizeValueType idx = first, last = first + count; idx &lt; last; idx++ )</div><div>     {</div><div>     FeaturePointsPhysicalCoordinates originalLocation = featurePoints-&gt;GetPoint( idx );</div><div>-    ImageIndexType index;</div>
<div>-    fixedImage-&gt;TransformPhysicalPointToIndex( originalLocation, index );</div><div>+    ImageIndexType fixedIndex,floatingIndex;</div><div>+    fixedImage-&gt;TransformPhysicalPointToIndex( originalLocation, fixedIndex );</div>
<div>+    floatingImage-&gt;TransformPhysicalPointToIndex( originalLocation, floatingIndex );</div><div> </div><div>     // the block is selected for a minimum similarity metric</div><div>     SimilaritiesValue  similarity = NumericTraits&lt; SimilaritiesValue &gt;::Zero;</div>
<div>@@ -267,9 +268,9 @@ BlockMatchingImageFilter&lt; TFixedImage, TMovingImage, TFeatures, TDisplacements,</div><div>     DisplacementsVector displacement;</div><div> </div><div>     // set centers of window and center regions to current location</div>
<div>-    ImageIndexType start = index - this-&gt;m_SearchRadius;</div><div>+    ImageIndexType start = fixedIndex - this-&gt;m_SearchRadius;</div><div>     window.SetIndex( start );</div><div>-    center.SetIndex( index );</div>
<div>+    center.SetIndex( floatingIndex );</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><div><br></div>