Skip to content

Clean-up using-declarations and typedef's CorrespondingPointsEuclideanDistancePoint and other metrics #1265

Merged
N-Dekker merged 6 commits intomainfrom
Replace-DerivativeValueType-with-0
Nov 9, 2024
Merged

Clean-up using-declarations and typedef's CorrespondingPointsEuclideanDistancePoint and other metrics #1265
N-Dekker merged 6 commits intomainfrom
Replace-DerivativeValueType-with-0

Conversation

@N-Dekker
Copy link
Copy Markdown
Member

@N-Dekker N-Dekker commented Nov 9, 2024

No description provided.

`DerivativeValueType` is just a floating point type. In both AdvancedImageToImageMetric and SingleValuedPointSetToPointSetMetric, it is defined as:

    using DerivativeValueType = typename DerivativeType::ValueType;

In ITK 5.4's SingleValuedCostFunction, DerivativeType is defined as:

    using DerivativeType = Array<ParametersValueType>;

SingleValuedCostFunction is derived from CostFunction, which has:

    using ParametersValueType = TInternalComputationValueType;

And for CostFunction, TInternalComputationValueType = double.

In LimiterFunctionBase, DerivativeValueType is defined as RealType:

      using DerivativeValueType = OutputType;

OutputType is an alias of NumericTraits<TInput>::RealType
CorrespondingPointsEuclideanDistancePointMetric does not need to use those six types from its `Superclass`.
CorrespondingPointsEuclideanDistancePointMetric only uses VnlVectorType internally, in GetValueAndDerivative.
Replace `TransformParametersType` with `ParametersType` in "elastix\Components\Metrics\itk*.*"

`TransformParametersType` and `ParametersType` _must_ be exactly the same type, in order to override those virtual `itk::SingleValuedCostFunction` member functions from ITK 5.4.0:

    GetValue(const ParametersType & parameters) const
    GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const
    GetValueAndDerivative(const ParametersType & parameters, MeasureType & value, DerivativeType & derivative) const
"Components/Metrics" just does not need those TransformParametersType typedefs.
Removed unused `Superclass1` and `Superclass2` using-declarations from the class definition of `elx::CorrespondingPointsEuclideanDistancePointMetric`. Also removed ITKBaseType (which is a "typedef", rather than a "using-declarations").
@N-Dekker N-Dekker merged commit bab46b0 into main Nov 9, 2024
@N-Dekker N-Dekker deleted the Replace-DerivativeValueType-with-0 branch November 9, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant