There is an interesting approximation for smoothing using a mask: s(X with mask) = s(Mask*X)/s(Mask)
For smoothing, particularly in registration pipelines, this can reduce the computation needed, and focus registration better, particularly also helpful to avoid edge effects from anatomy/features that you might want to avoid.
In the ideal case, we could make it possible to specify / override the smoothing filter used in the registration method. This would enable optimized implementations, GPU implementation when available, mask approximations, etc.
I think we are looking to create a base class perhaps called “DownsamplerImageFilter” or MultiResolutionImageFilter? (additional keywords: scale, scale space, smoothing, downsample … )
It should take the sigmas, shrink factors, input image and optionally input mask and produce a smooth downsampled image. This could be an settable object to the ImageRegistrationMethodv4.
Possible implementations include:
DiscreteGaussian->Shrink
SmoothingRecursiveGaussian->Shrink
YuuGaussian->ResampleImageFilter
BinShrink
Discrete in X, Shrink in X, … Discrete in D, Shrink in D
I have used the last two outside the registration method when needing to reduce an image by a large amount say 10x10x10, doing the shrinking after just 1D convolution can greatly reduce the amount of computation done in the later convolutions.