Skip to content

Commit 328606b

Browse files
committed
ENH: Deprecate unused constructor call
These constructor signatures are not used, and are not necessary to implement the behavior. The derived unused constructors in derived classes (11) are also be deprecated, when MatrixOffsetTransformBase(const MatrixType &, const OutputVectorType &) is deprecated: AffineTransform(const MatrixType & matrix, const OutputVectorType & offset); ComposeScaleSkewVersor3DTransform(const MatrixType & matrix, const OutputVectorType & offset); FixedCenterOfRotationAffineTransform(const MatrixType & matrix, const OutputVectorType & offset); QuaternionRigidTransform(const MatrixType & matrix, const OutputVectorType & offset); Rigid3DTransform(const MatrixType & matrix, const OutputVectorType & offset); ScalableAffineTransform(const MatrixType & matrix, const OutputVectorType & offset); ScaleSkewVersor3DTransform(const MatrixType & matrix, const OutputVectorType & offset); ScaleVersor3DTransform(const MatrixType & matrix, const OutputVectorType & offset); Similarity3DTransform(const MatrixType & matrix, const OutputVectorType & offset); VersorRigid3DTransform(const MatrixType & matrix, const OutputVectorType & offset); VersorTransform(const MatrixType & matrix, const OutputVectorType & offset); These 11 constructors all directly or indirectly call MatrixOffsetTransformBase(const MatrixType &, const OutputVectorType &). But none of them are tested, it appears that they aren't even compiled!!! At least not at the CI. And they are all protected, so they can not be used in the public API. Disabled GTest that used now deprecated interface.
1 parent a81ea1e commit 328606b

25 files changed

Lines changed: 72 additions & 41 deletions

Modules/Core/Transform/include/itkAffineTransform.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ class ITK_TEMPLATE_EXPORT AffineTransform
274274
* to values specified by the caller. If the arguments are
275275
* omitted, then the AffineTransform is initialized to an identity
276276
* transformation in the appropriate number of dimensions. */
277-
AffineTransform(const MatrixType & matrix, const OutputVectorType & offset);
277+
#if !defined(ITK_LEGACY_REMOVE)
278+
[[deprecated("Removed unused constructor")]] AffineTransform(const MatrixType & matrix,
279+
const OutputVectorType & offset);
280+
#endif
278281
AffineTransform(unsigned int parametersDimension);
279282
AffineTransform();
280283

Modules/Core/Transform/include/itkAffineTransform.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ AffineTransform<TParametersValueType, VDimension>::AffineTransform(unsigned int
3434
: Superclass(parametersDimension)
3535
{}
3636

37+
#if !defined(ITK_LEGACY_REMOVE)
3738
template <typename TParametersValueType, unsigned int VDimension>
3839
AffineTransform<TParametersValueType, VDimension>::AffineTransform(const MatrixType & matrix,
3940
const OutputVectorType & offset)
4041
: Superclass(matrix, offset)
4142
{}
43+
#endif
4244

4345
template <typename TParametersValueType, unsigned int VDimension>
4446
void

Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ class ITK_TEMPLATE_EXPORT ComposeScaleSkewVersor3DTransform : public VersorRigid
152152

153153
protected:
154154
ComposeScaleSkewVersor3DTransform();
155-
ComposeScaleSkewVersor3DTransform(const MatrixType & matrix, const OutputVectorType & offset);
155+
#if !defined(ITK_LEGACY_REMOVE)
156+
[[deprecated("Removed unused constructor")]] ComposeScaleSkewVersor3DTransform(const MatrixType & matrix,
157+
const OutputVectorType & offset);
158+
#endif
156159
ComposeScaleSkewVersor3DTransform(unsigned int parametersDimension);
157160
~ComposeScaleSkewVersor3DTransform() override = default;
158161

Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ ComposeScaleSkewVersor3DTransform<TParametersValueType>::ComposeScaleSkewVersor3
4343
m_Skew.Fill(0.0);
4444
}
4545

46+
#if !defined(ITK_LEGACY_REMOVE)
4647
// Constructor with arguments
4748
template <typename TParametersValueType>
4849
ComposeScaleSkewVersor3DTransform<TParametersValueType>::ComposeScaleSkewVersor3DTransform(
@@ -52,6 +53,7 @@ ComposeScaleSkewVersor3DTransform<TParametersValueType>::ComposeScaleSkewVersor3
5253
{
5354
this->ComputeMatrixParameters();
5455
}
56+
#endif
5557

5658
// Directly set the matrix
5759
template <typename TParametersValueType>

Modules/Core/Transform/include/itkFixedCenterOfRotationAffineTransform.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ class ITK_TEMPLATE_EXPORT FixedCenterOfRotationAffineTransform
119119

120120
protected:
121121
/** Construct an FixedCenterOfRotationAffineTransform object */
122-
FixedCenterOfRotationAffineTransform(const MatrixType & matrix, const OutputVectorType & offset);
122+
#if !defined(ITK_LEGACY_REMOVE)
123+
[[deprecated("Removed unused constructor")]] FixedCenterOfRotationAffineTransform(const MatrixType & matrix,
124+
const OutputVectorType & offset);
125+
#endif
123126
FixedCenterOfRotationAffineTransform(unsigned int outputSpaceDims, unsigned int paramsDims);
124127
FixedCenterOfRotationAffineTransform();
125128

Modules/Core/Transform/include/itkFixedCenterOfRotationAffineTransform.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ FixedCenterOfRotationAffineTransform<TParametersValueType, VDimension>::FixedCen
3737
: Superclass(outputSpaceDims, paramsDims)
3838
{}
3939

40+
#if !defined(ITK_LEGACY_REMOVE)
4041
template <typename TParametersValueType, unsigned int VDimension>
4142
FixedCenterOfRotationAffineTransform<TParametersValueType, VDimension>::FixedCenterOfRotationAffineTransform(
4243
const MatrixType & matrix,
4344
const OutputVectorType & offset)
4445
: Superclass(matrix, offset)
4546
{}
47+
#endif
4648

4749
} // namespace itk
4850

Modules/Core/Transform/include/itkMatrixOffsetTransformBase.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ class ITK_TEMPLATE_EXPORT MatrixOffsetTransformBase
507507
* to values specified by the caller. If the arguments are
508508
* omitted, then the MatrixOffsetTransformBase is initialized to an identity
509509
* transformation in the appropriate number of dimensions. */
510-
MatrixOffsetTransformBase(const MatrixType & matrix, const OutputVectorType & offset);
510+
#if !defined(ITK_LEGACY_REMOVE)
511+
[[deprecated("Removed unused constructor")]] MatrixOffsetTransformBase(const MatrixType & matrix,
512+
const OutputVectorType & offset);
513+
#endif
511514
explicit MatrixOffsetTransformBase(unsigned int paramDims = ParametersDimension);
512515

513516
/** Destroy an MatrixOffsetTransformBase object */

Modules/Core/Transform/include/itkMatrixOffsetTransformBase.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimensio
3737
this->m_FixedParameters.Fill(0.0);
3838
}
3939

40-
40+
#if !defined(ITK_LEGACY_REMOVE)
4141
template <typename TParametersValueType, unsigned int VInputDimension, unsigned int VOutputDimension>
4242
MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimension>::MatrixOffsetTransformBase(
4343
const MatrixType & matrix,
@@ -51,6 +51,7 @@ MatrixOffsetTransformBase<TParametersValueType, VInputDimension, VOutputDimensio
5151
this->m_FixedParameters.SetSize(VInputDimension);
5252
this->m_FixedParameters.Fill(0.0);
5353
}
54+
#endif
5455

5556
template <typename TParametersValueType, unsigned int VInputDimension, unsigned int VOutputDimension>
5657
void

Modules/Core/Transform/include/itkQuaternionRigidTransform.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ class ITK_TEMPLATE_EXPORT QuaternionRigidTransform : public Rigid3DTransform<TPa
135135
ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & jacobian) const override;
136136

137137
protected:
138-
QuaternionRigidTransform(const MatrixType & matrix, const OutputVectorType & offset);
138+
#if !defined(ITK_LEGACY_REMOVE)
139+
[[deprecated("Removed unused constructor")]] QuaternionRigidTransform(const MatrixType & matrix,
140+
const OutputVectorType & offset);
141+
#endif
139142
QuaternionRigidTransform(unsigned int parametersDimension);
140143
QuaternionRigidTransform();
141144
~QuaternionRigidTransform() override = default;

Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ QuaternionRigidTransform<TParametersValueType>::QuaternionRigidTransform(unsigne
3939
// std::cos(t/2)
4040
}
4141

42+
#if !defined(ITK_LEGACY_REMOVE)
4243
// Constructor with explicit arguments
4344
template <typename TParametersValueType>
4445
QuaternionRigidTransform<TParametersValueType>::QuaternionRigidTransform(const MatrixType & matrix,
@@ -47,6 +48,7 @@ QuaternionRigidTransform<TParametersValueType>::QuaternionRigidTransform(const M
4748
{
4849
this->ComputeMatrixParameters();
4950
}
51+
#endif
5052

5153
// Print self
5254
template <typename TParametersValueType>

0 commit comments

Comments
 (0)