Skip to content

Commit

Permalink
ENH: Make OrientationAdapterBase deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Apr 18, 2022
1 parent a3ac8de commit c294138
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Documentation/ITK5MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ The namespece itself is only available in legacy mode. Some classes were renamed
* `itk::SpatialOrientation::CoordinateMajornessTerms` became `itk::SpatialOrientationEnums::CoordinateMajornessTerms`.
* `itk::SpatialOrientation::ValidCoordinateOrientationFlags` became `itk::SpatialOrientationEnums::ValidCoordinateOrientations`.

Since ITK 5.3, `OrientationAdapterBase` is deprecated. In ITKv6 it will be available in `ITKDeprecated` module.
SpatialOrientationAdapter no longer inherits from it.

Enumeration member names (`ITK_COORDINATE_UNKNOWN`, `ITK_COORDINATE_Right`, `ITK_COORDINATE_PrimaryMinor`, `ITK_COORDINATE_ORIENTATION_RIP` etc) are unchanged.

Implicit conversion of a single scalar value to a container (which would _fill_ the container by the
Expand Down
16 changes: 10 additions & 6 deletions Modules/Core/Common/include/itkOrientationAdapterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
*=========================================================================*/
#ifndef itkOrientationAdapterBase_h
#define itkOrientationAdapterBase_h
#include "itkImageBase.h"

#if !defined(ITK_LEGACY_REMOVE)
# include "itkImageBase.h"

namespace itk
{
Expand All @@ -41,7 +43,7 @@ namespace itk
* \ingroup ITKCommon
*/
template <typename OrientationType, unsigned int Dimension = 3>
class ITK_TEMPLATE_EXPORT OrientationAdapterBase
class ITK_TEMPLATE_EXPORT [[deprecated("Since ITK 5.3 use SpatialOrientationAdapter.")]] OrientationAdapterBase
{
public:
/** type alias for matching ImageBase */
Expand All @@ -51,17 +53,19 @@ class ITK_TEMPLATE_EXPORT OrientationAdapterBase
using DirectionType = typename ImageType::DirectionType;

/** Convert direction cosines to the Orientation type */
virtual OrientationType
FromDirectionCosines(const DirectionType & Dir) = 0;
virtual OrientationType FromDirectionCosines(const DirectionType & Dir) = 0;

/** Convert Orientation type direction cosines */
virtual DirectionType
ToDirectionCosines(const OrientationType & Orient) = 0;
virtual DirectionType ToDirectionCosines(const OrientationType & Orient) = 0;

protected:
/** destructor, to silence "virtual class has non-virtual destructor()"
warnings */
virtual ~OrientationAdapterBase() = default;
};
} // namespace itk
#else // ITK_LEGACY_REMOVE
# error itkOrientationAdapterBase.h is a legacy file since ITK 5.3 and will be removed in the future.
#endif // ITK_LEGACY_REMOVE

#endif // itkOrientationAdapterBase_h
1 change: 1 addition & 0 deletions Utilities/Maintenance/BuildHeaderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"itkBSplineDeformableTransform.h", # deprecated
"vtkCaptureScreen.h", # these includes require VTK
"itkMultiThreader.h", # Compatibility file, it should not be used
"itkOrientationAdapterBase.h", # Compatibility file, it should not be used
"itkEnableIf.h", # Compatibility file, it should not be used
"itkIsSame.h", # Compatibility file, it should not be used
"itkIsBaseOf.h", # Compatibility file, it should not be used
Expand Down

0 comments on commit c294138

Please sign in to comment.