SuperElastix / elastix

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

STYLE: Adjust `if` condition on when to use ITK's GradientImageFilter #1079

Closed N-Dekker closed 2 months ago

N-Dekker commented 3 months ago

The metrics (currently) only use ITK's GradientImageFilter when the interpolator is a NearestNeighbor interpolator.

N-Dekker commented 3 months ago

The image created by ITK's GradientImageFilter (m_GradientImage) is used in EvaluateMovingImageValueAndDerivativeWithOptionalThreadId: https://github.com/SuperElastix/elastix/blob/98aa401157d5608b47a3f89892e119c74b0c88fe/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx#L461-L498

Note that AdvancedKappaStatisticImageToImageMetric does not use ITK's GradientImageFilter. It assigns its own manually created image to m_GradientImage.