SuperElastix / elastix

Official elastix repository
http://elastix.dev
Apache License 2.0
449 stars 110 forks source link

STYLE: Remove GradientImageFilterType, GradientImageFilterPointer types #1072

Closed N-Dekker closed 3 months ago

N-Dekker commented 3 months ago

elastix does not use them.

For the record, ImageToImageMetric::GradientImageFilterType is defined as GradientRecursiveGaussianImageFilter<MovingImageType, GradientImageType>, at https://github.com/InsightSoftwareConsortium/ITK/blob/be79ceb0a9343c02dba310f5faee371941f6fa40/Modules/Registration/Common/include/itkImageToImageMetric.h#L112

AdvancedImageToImageMetric::AdvancedImageToImageMetric() has an explanation why elastix does not use this filter:

Don't use the default gradient image as implemented by ITK. It uses a Gaussian derivative, which introduces extra smoothing, which may not always be desired. Also, when the derivatives are computed using Gaussian filtering, the gray-values should also be blurred, to have a consistent 'image model'.

https://github.com/SuperElastix/elastix/blob/43b5c54e2486ec2517c8abd92fa2b69e9bb55975/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx#L43-L47

This pull request is somewhat related to: