<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< TFixedImage, TMovingImage, TFeatures, TDisplacements,</div>
<div> for ( SizeValueType idx = first, last = first + count; idx < last; idx++ )</div><div> {</div><div> FeaturePointsPhysicalCoordinates originalLocation = featurePoints->GetPoint( idx );</div><div>- ImageIndexType index;</div>
<div>- fixedImage->TransformPhysicalPointToIndex( originalLocation, index );</div><div>+ ImageIndexType fixedIndex,floatingIndex;</div><div>+ fixedImage->TransformPhysicalPointToIndex( originalLocation, fixedIndex );</div>
<div>+ floatingImage->TransformPhysicalPointToIndex( originalLocation, floatingIndex );</div><div> </div><div> // the block is selected for a minimum similarity metric</div><div> SimilaritiesValue similarity = NumericTraits< SimilaritiesValue >::Zero;</div>
<div>@@ -267,9 +268,9 @@ BlockMatchingImageFilter< 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->m_SearchRadius;</div><div>+ ImageIndexType start = fixedIndex - this->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< FixedImageType > windowIterator( m_BlockRadius, fixedImage, window );</div>
</div><div><br></div>