Skip to content

Commit

Permalink
ENH: Deprecate unused constructor call
Browse files Browse the repository at this point in the history
This constructor signature is not used, and is
not necessary to implement the behavior.
  • Loading branch information
hjmjohnson committed Jun 14, 2024
1 parent be16df8 commit acb499d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,10 @@ class ITK_TEMPLATE_EXPORT MatrixOffsetTransformBase
* to values specified by the caller. If the arguments are
* omitted, then the MatrixOffsetTransformBase is initialized to an identity
* transformation in the appropriate number of dimensions. */
MatrixOffsetTransformBase(const MatrixType & matrix, const OutputVectorType & offset);
#if !defined(ITK_LEGACY_REMOVE)
[[deprecated("Removed unsued constructor")]] MatrixOffsetTransformBase(const MatrixType & matrix,
const OutputVectorType & offset);
#endif
explicit MatrixOffsetTransformBase(unsigned int paramDims = ParametersDimension);

/** Destroy an MatrixOffsetTransformBase object */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimensio
this->m_FixedParameters.Fill(0.0);
}


#if !defined(ITK_LEGACY_REMOVE)
template <typename TParametersValueType, unsigned int VInputDimension, unsigned int VOutputDimension>
MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimension>::MatrixOffsetTransformBase(
const MatrixType & matrix,
Expand All @@ -51,6 +51,7 @@ MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimensio
this->m_FixedParameters.SetSize(VInputDimension);
this->m_FixedParameters.Fill(0.0);
}
#endif

template <typename TParametersValueType, unsigned int VInputDimension, unsigned int VOutputDimension>
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ TEST(MatrixOffsetTransformBase, SetFixedParametersThrowsWhenSizeIsLessThanNDimen
Assert_SetFixedParameters_throws_when_size_is_less_than_NDimensions<4>();
}

#if !defined(ITK_LEGACY_REMOVE)
// Check that fixed parameters are set to default values during construction.
TEST(MatrixOffsetTransformBase, CreateWithMatrixAndOffset)
{
Expand Down Expand Up @@ -105,3 +106,4 @@ TEST(MatrixOffsetTransformBase, CreateWithMatrixAndOffset)

EXPECT_EQ(transform->GetFixedParameters(), expectedFixedParameters);
}
#endif

0 comments on commit acb499d

Please sign in to comment.