Skip to content

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

@romangrothausmann

Description

@romangrothausmann

Trying to solve #61 I found that the interpolator that is used to calculate the gradient is always linear

using InterpolateImageFunctionType = LinearInterpolateImageFunction<TInputImage, TCoordRep>;

and not using the interpolator that is (possibly) set for the cost function
/** Get/set the Interpolator. */
itkSetObjectMacro( Interpolator, InterpolatorType );
itkGetConstObjectMacro( Interpolator, InterpolatorType );

It seems the cost function interpolator is used in case iterateNeighborhoodOptimizer (which uses GetValue) is employed
return static_cast<MeasureType>( m_Interpolator->Evaluate(point) );

but not when the gradient is computed (which uses GetDerivative)
output = m_GradientImageFunction->Evaluate(point);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions