InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

Interpolator for gradient calculation is linear, i.e. not using the interpolator set for the cost function

Open
#6,351 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

Trying to solve InsightSoftwareConsortium/ITK#6352 I found that the interpolator that is used to calculate the gradient is always linear
https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkPhysicalCentralDifferenceImageFunction.h#L86
and not using the interpolator that is (possibly) set for the cost function
https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkSingleImageCostFunction.h#L105-L107
It seems the cost function interpolator is used in case iterateNeighborhoodOptimizer (which uses [`GetValue`](https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkSingleImageCostFunction.hxx#L86-L89)) is employed
https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkSingleImageCostFunction.hxx#L102
but not when the gradient is computed (which uses [`GetDerivative`](https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkSingleImageCostFunction.hxx#L114-L118))
https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/blob/2ff1ab58f30842ac57d76c8bc9462fcbc7523e67/include/itkSingleImageCostFunction.hxx#L137

This however does not seem to be the issue of InsightSoftwareConsortium/ITK#6352 (where a linear interpolator was used anyway), so posting as an issue on its own.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.