Skip to content

Commit 1b746f8

Browse files
committed
COMP: Remove LEGACY off mode in backport
The backported AnatomicalOrientation is explicitly available for the purpose of providing an easy long-term conversion to the new paradigm. Have conditional support for deprecating features of future support makes the backport unnecessarily complicated. Using a separate commit to remove the backported future deprecation elements to minimize the changes from the original files.
1 parent 54b89d3 commit 1b746f8

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

Modules/Core/Common/include/itkAnatomicalOrientation.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
#include "ITKCommonExport.h"
2222
#include "itkImageBase.h"
23-
#ifndef ITK_FUTURE_LEGACY_REMOVE
24-
# include "itkSpatialOrientation.h"
25-
#endif
23+
#include "itkSpatialOrientation.h"
2624
#include <map>
2725
#include <string>
2826

@@ -57,9 +55,7 @@ class ITKCommon_EXPORT AnatomicalOrientation
5755
using DirectionType = typename ImageBase<Dimension>::DirectionType;
5856
static constexpr unsigned int ImageDimension = Dimension;
5957

60-
#ifndef ITK_FUTURE_LEGACY_REMOVE
6158
using LegacyOrientationType = SpatialOrientationEnums::ValidCoordinateOrientations;
62-
#endif
6359

6460
// Anatomical names for an axis.
6561
//
@@ -433,16 +429,11 @@ class ITKCommon_EXPORT AnatomicalOrientation
433429
: m_Value(PositiveEnum(static_cast<uint32_t>(fromOrientation)))
434430
{}
435431

436-
#ifndef ITK_FUTURE_LEGACY_REMOVE
437432
/** \brief Conversion from Legacy SpatialOrientation
438433
*
439434
* @param legacyOrientation
440435
*/
441-
# if defined(ITK_LEGACY_REMOVE) && !defined(ITK_LEGACY_SILENT) && !defined(ITK_WRAPPING)
442-
[[deprecated("Use the AnatomicalOrientation::FromEnum type instead.")]]
443-
# endif
444436
AnatomicalOrientation(LegacyOrientationType legacyOrientation);
445-
#endif
446437

447438
/** Conversion for a Direction Cosine Matrix to the closest anatomical orientation. Any partial axis rotations are
448439
* rounded to the nearest axis, and lost in this conversion.

Modules/Core/Common/src/itkAnatomicalOrientation.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@
1616
*
1717
*=========================================================================*/
1818
#include "itkAnatomicalOrientation.h"
19-
#ifndef ITK_FUTURE_LEGACY_REMOVE
20-
# include "itkSpatialOrientationAdapter.h"
21-
#endif
19+
#include "itkSpatialOrientationAdapter.h"
2220

2321
namespace itk
2422
{
2523

2624

27-
#ifndef ITK_FUTURE_LEGACY_REMOVE
2825
AnatomicalOrientation::AnatomicalOrientation(LegacyOrientationType legacyOrientation)
2926
: AnatomicalOrientation(SpatialOrientationAdapter().ToDirectionCosines(legacyOrientation))
3027
{
3128
assert(uint32_t(legacyOrientation) == uint32_t(m_Value));
3229
}
33-
#endif
3430

3531

3632
std::string

Modules/Core/Common/test/itkAnatomicalOrientationGTest.cxx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
#include <gtest/gtest.h>
2020

2121
#include "itkGTest.h"
22-
#ifndef ITK_FUTURE_LEGACY_REMOVE
23-
# define ITK_LEGACY_SILENT
24-
#endif
22+
#define ITK_LEGACY_SILENT
2523
#include "itkAnatomicalOrientation.h"
2624
#include "itkImage.h"
2725
#include <sstream>
@@ -247,8 +245,7 @@ TEST(AntomicalOrientation, ToFromEnumInteroperability)
247245
EXPECT_EQ(itk_rai.GetTerms(), expected_terms);
248246
}
249247

250-
#ifndef ITK_FUTURE_LEGACY_REMOVE
251-
# include "itkSpatialOrientation.h"
248+
#include "itkSpatialOrientation.h"
252249
TEST(AnatomicalOrientation, LegacyInteroperability)
253250
{
254251

@@ -266,4 +263,3 @@ TEST(AnatomicalOrientation, LegacyInteroperability)
266263
EXPECT_EQ(itk_rai.GetAsPositiveOrientation(), OE::LPS);
267264
EXPECT_EQ(itk_rai.GetAsPositiveStringEncoding(), "LPS");
268265
}
269-
#endif

0 commit comments

Comments
 (0)