diff --git a/.github/workflows/itk_dict.txt b/.github/workflows/itk_dict.txt index 0fb96f47a34..4964a81d868 100644 --- a/.github/workflows/itk_dict.txt +++ b/.github/workflows/itk_dict.txt @@ -652,6 +652,7 @@ mv myhistogram myreferenceimage mx +natively nbOfDirections nbOfPixels ncodewords diff --git a/CMake/ITKConfig.cmake.in b/CMake/ITKConfig.cmake.in index 7a77ae3c07a..2286442eb03 100644 --- a/CMake/ITKConfig.cmake.in +++ b/CMake/ITKConfig.cmake.in @@ -26,9 +26,6 @@ set(ITK_VERSION_MAJOR "@ITK_VERSION_MAJOR@") set(ITK_VERSION_MINOR "@ITK_VERSION_MINOR@") set(ITK_VERSION_PATCH "@ITK_VERSION_PATCH@") -# If ITK was built with version 4 compatibility features. -set(ITKV4_COMPATIBILITY "@ITKV4_COMPATIBILITY@") - # Remove all legacy code completely. set(ITK_LEGACY_REMOVE "@ITK_LEGACY_REMOVE@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 1267b1aae95..77075e99c7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,20 +325,16 @@ cmake_dependent_option( OFF "NOT ITK_LEGACY_REMOVE" OFF) -# The disabling of legacy code, and the ITKv4 compatibility option can not both be -# requested. If removal of legacy code is requested, then ITKV4_COMPATIBILITY must -# be off. -cmake_dependent_option( - ITKV4_COMPATIBILITY - "Enable LEGACY compatibility with ITK4.x when possible." - OFF - "NOT ITK_LEGACY_REMOVE" - OFF) + mark_as_advanced( ITK_LEGACY_SILENT ITK_LEGACY_REMOVE ITK_FUTURE_LEGACY_REMOVE - ITKV4_COMPATIBILITY) + ) + +if(ITKV4_COMPATIBILITY) + message(FATAL_ERROR "ITKV4_COMPATIBILITY is removed starting in ITK version 4.0, this option is no longer valid.") +endif() if(ITKV3_COMPATIBILITY) message(FATAL_ERROR "ITKV3_COMPATIBILITY is removed starting in ITK version 5.0, this option is no longer valid.") diff --git a/Documentation/docs/migration_guides/itk_6_migration_guide.md b/Documentation/docs/migration_guides/itk_6_migration_guide.md index 334fe9cc59d..ba2f4dfb12a 100644 --- a/Documentation/docs/migration_guides/itk_6_migration_guide.md +++ b/Documentation/docs/migration_guides/itk_6_migration_guide.md @@ -21,3 +21,19 @@ re-flagged as `ITK_LEGACY_REMOVE`. There have been some other deprecations and API changes. The new behavior is activated by setting `ITK_LEGACY_REMOVE` to `ON`. By default, compatibility with v5 is retained (`ITK_LEGACY_REMOVE=OFF`). + +Remove support for ITKv4 interfaces +----------------------------------- + +ITKV4_COMPATIBILITY is no longer a supported option. + +Require modern C++ language feature use +--------------------------------------- + +Many backward compatible/ forward enabling compiler features are now required to be used. + +* `ITKv5_CONST` must be replaced with `const` +* `ITK_ITERATOR_VIRTUAL` must be replaced with `virtual` +* `ITK_ITERATOR_OVERRIDE` must be replaced with `override` +* `ITK_ITERATOR_FINAL` must be replaced with `final` +* `ITK_DELETE_FUNCTION` must be replaced with `delete` \ No newline at end of file diff --git a/Modules/Compatibility/Deprecated/include/itkImageTransformer.hxx b/Modules/Compatibility/Deprecated/include/itkImageTransformer.hxx index 1c57cee58f2..8e7a0a12866 100644 --- a/Modules/Compatibility/Deprecated/include/itkImageTransformer.hxx +++ b/Modules/Compatibility/Deprecated/include/itkImageTransformer.hxx @@ -323,20 +323,6 @@ ImageTransformer::ThreaderCallback(void * arg) if (threadId < total) { str->Filter->ThreadedGenerateData(splitRegion, threadId); -#if defined(ITKV4_COMPATIBILITY) - if (str->Filter->GetAbortGenerateData()) - { - std::string msg; - ProcessAborted e(__FILE__, __LINE__); - msg += "Object " + std::string(str->Filter->GetNameOfClass()) + ": AbortGenerateData was set!"; - e.SetDescription(msg); - throw e; - } - else if (str->Filter->GetProgress() == 0.0f) // progress was not set after at least the first chunk finished - { - str->Filter->UpdateProgress(static_cast(threadId + 1) / total); // this will be the only progress update - } -#endif } // else // { diff --git a/Modules/Compatibility/Deprecated/itk-module.cmake b/Modules/Compatibility/Deprecated/itk-module.cmake index a04eee547b3..c4384784485 100644 --- a/Modules/Compatibility/Deprecated/itk-module.cmake +++ b/Modules/Compatibility/Deprecated/itk-module.cmake @@ -2,9 +2,6 @@ set(DOCUMENTATION "This is a collection of classes that are intended to be removed from the toolkit.") set(ITKDeprecatedOnByDefault EXCLUDE_FROM_DEFAULT) -if(ITKV4_COMPATIBILITY) - set(ITKDeprecatedOnByDefault "") -endif() itk_module( ITKDeprecated diff --git a/Modules/Core/Common/include/itkArray.h b/Modules/Core/Common/include/itkArray.h index 9a1d1f1da78..f58ed0d0536 100644 --- a/Modules/Core/Common/include/itkArray.h +++ b/Modules/Core/Common/include/itkArray.h @@ -81,21 +81,12 @@ class ITK_TEMPLATE_EXPORT Array : public vnl_vector * memory when this object is destroyed. */ Array(ValueType * datain, SizeValueType sz, bool LetArrayManageMemory = false); -#if defined(ITK_LEGACY_REMOVE) /** Constructor that initializes array with contents from a user supplied * const buffer. The pointer to the buffer and the length is specified. By default, * the array does a deep copy of the const pointer data, so the array class also * manages memory. */ Array(const ValueType * datain, SizeValueType sz); -#else // defined ( ITK_LEGACY_REMOVE ) - /** Constructor that initializes array with contents from a user supplied - * buffer. The pointer to the buffer and the length is specified. The array - * does a deep copy of the const pointer data, so the array class also - * manages memory. The 3rd argument is only for backward compatibility. */ - Array(const ValueType * datain, SizeValueType sz, bool LetArrayManageMemory = false); -#endif - /** Constructor to initialize an array from another of any data type */ template Array(const Array & r) @@ -187,14 +178,6 @@ class ITK_TEMPLATE_EXPORT Array : public vnl_vector * means that subclasses cannot allocate memory. */ ~Array() override; -#if !defined(ITK_LEGACY_REMOVE) - void - swap(Array & other) - { - this->Swap(other); - } -#endif - void Swap(Array & other) { diff --git a/Modules/Core/Common/include/itkArray.hxx b/Modules/Core/Common/include/itkArray.hxx index c71ba78b591..a87b635aadb 100644 --- a/Modules/Core/Common/include/itkArray.hxx +++ b/Modules/Core/Common/include/itkArray.hxx @@ -58,7 +58,6 @@ Array::Array(ValueType * datain, SizeValueType sz, bool LetArrayManageMe vnl_vector::num_elmts = sz; } -#if defined(ITK_LEGACY_REMOVE) template Array::Array(const ValueType * datain, SizeValueType sz) : vnl_vector(datain, sz) @@ -66,17 +65,6 @@ Array::Array(const ValueType * datain, SizeValueType sz) // no matter the setting of let array manage memory of rhs {} -#else // defined ( ITK_LEGACY_REMOVE ) -template -Array::Array(const ValueType * datain, SizeValueType sz, bool /* LetArrayManageMemory */) - : /* NOTE: The 3rd argument "LetArrayManageMemory, was never valid to use, but is - * preserved to maintain backwards compatibility*/ - vnl_vector(datain, sz) -// The vnl vector copy constructor creates new memory -// no matter the setting of let array manage memory of rhs -{} -#endif - template Array::~Array() { diff --git a/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h b/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h index 91c9be76411..37fca64e924 100644 --- a/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h +++ b/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h @@ -104,14 +104,6 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction virtual void Evaluate(const ContinuousIndexType & index, WeightsType & weights, IndexType & startIndex) const; -#if !defined(ITK_LEGACY_REMOVE) - /** Get support region size. */ - itkLegacyMacro(SizeType GetSupportSize() const) { return Self::SupportSize; }; - - /** Get number of weights. */ - itkLegacyMacro(unsigned int GetNumberOfWeights() const) { return Self::NumberOfWeights; } -#endif - protected: BSplineInterpolationWeightFunction() = default; ~BSplineInterpolationWeightFunction() override = default; diff --git a/Modules/Core/Common/include/itkBoundingBox.h b/Modules/Core/Common/include/itkBoundingBox.h index a466cdb1d26..cc58e386a26 100644 --- a/Modules/Core/Common/include/itkBoundingBox.h +++ b/Modules/Core/Common/include/itkBoundingBox.h @@ -198,12 +198,9 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object private: PointsContainerConstPointer m_PointsContainer{}; -#if !defined(ITK_LEGACY_REMOVE) - PointsContainerPointer m_CornersContainer{ PointsContainer::New() }; -#endif - mutable BoundsArrayType m_Bounds{}; - mutable TimeStamp m_BoundsMTime{}; // The last time the bounds - // were computed. + mutable BoundsArrayType m_Bounds{}; + mutable TimeStamp m_BoundsMTime{}; // The last time the bounds + // were computed. }; } // end namespace itk diff --git a/Modules/Core/Common/include/itkBoundingBox.hxx b/Modules/Core/Common/include/itkBoundingBox.hxx index d14c95b3fcb..c61d775374a 100644 --- a/Modules/Core/Common/include/itkBoundingBox.hxx +++ b/Modules/Core/Common/include/itkBoundingBox.hxx @@ -108,26 +108,6 @@ BoundingBox::Com return result; } -#if !defined(ITK_LEGACY_REMOVE) -/** Compute and get the corners of the bounding box */ -template -auto -BoundingBox::GetCorners() -> const PointsContainer * -{ - m_CornersContainer->clear(); - m_CornersContainer->Reserve(NumberOfCorners); - - SizeValueType index = 0; - for (const PointType & pnt : this->ComputeCorners()) - { - m_CornersContainer->SetElement(index++, pnt); - } - - return m_CornersContainer.GetPointer(); -} -#endif - - template bool BoundingBox::ComputeBoundingBox() const @@ -344,23 +324,6 @@ BoundingBox::Dee // Connect the same points container into the clone clone->SetPoints(this->m_PointsContainer); -#if !defined(ITK_LEGACY_REMOVE) - // Copy the corners into the clone. - clone->m_CornersContainer->clear(); - - PointsContainerConstIterator itr = this->m_CornersContainer->Begin(); - PointsContainerConstIterator end = this->m_CornersContainer->End(); - - clone->m_CornersContainer->Reserve(this->m_CornersContainer->Size()); - PointsContainerIterator dest = clone->m_CornersContainer->Begin(); - - while (itr != end) - { - dest.Value() = itr.Value(); - ++itr; - } -#endif - // Copy the bounds into the clone for (unsigned int i = 0; i < 2 * PointDimension; ++i) { diff --git a/Modules/Core/Common/include/itkCellInterface.h b/Modules/Core/Common/include/itkCellInterface.h index 37b642cff90..a25e6fc3aa6 100644 --- a/Modules/Core/Common/include/itkCellInterface.h +++ b/Modules/Core/Common/include/itkCellInterface.h @@ -472,22 +472,6 @@ class ITK_TEMPLATE_EXPORT CellInterface /** Get the geometric position of a point. */ // bool GetPointPosition(PointsContainer*, int localId, Point*)=0; -#if !defined(ITK_LEGACY_REMOVE) - /** Expose old names for backwards compatibility*/ - static constexpr CommonEnums::CellGeometry VERTEX_CELL = CommonEnums::CellGeometry::VERTEX_CELL; - static constexpr CommonEnums::CellGeometry LINE_CELL = CommonEnums::CellGeometry::LINE_CELL; - static constexpr CommonEnums::CellGeometry TRIANGLE_CELL = CommonEnums::CellGeometry::TRIANGLE_CELL; - static constexpr CommonEnums::CellGeometry QUADRILATERAL_CELL = CommonEnums::CellGeometry::QUADRILATERAL_CELL; - static constexpr CommonEnums::CellGeometry POLYGON_CELL = CommonEnums::CellGeometry::POLYGON_CELL; - static constexpr CommonEnums::CellGeometry TETRAHEDRON_CELL = CommonEnums::CellGeometry::TETRAHEDRON_CELL; - static constexpr CommonEnums::CellGeometry HEXAHEDRON_CELL = CommonEnums::CellGeometry::HEXAHEDRON_CELL; - static constexpr CommonEnums::CellGeometry QUADRATIC_EDGE_CELL = CommonEnums::CellGeometry::QUADRATIC_EDGE_CELL; - static constexpr CommonEnums::CellGeometry QUADRATIC_TRIANGLE_CELL = - CommonEnums::CellGeometry::QUADRATIC_TRIANGLE_CELL; - static constexpr CommonEnums::CellGeometry LAST_ITK_CELL = CommonEnums::CellGeometry::LAST_ITK_CELL; - static constexpr CommonEnums::CellGeometry MAX_ITK_CELLS = CommonEnums::CellGeometry::MAX_ITK_CELLS; -#endif - protected: /** Store the set of cells using this boundary. */ UsingCellsContainer m_UsingCells{}; diff --git a/Modules/Core/Common/include/itkCommonEnums.h b/Modules/Core/Common/include/itkCommonEnums.h index c23f62bf776..fbb56387b28 100644 --- a/Modules/Core/Common/include/itkCommonEnums.h +++ b/Modules/Core/Common/include/itkCommonEnums.h @@ -161,15 +161,6 @@ using IOFileModeEnum = CommonEnums::IOFileMode; using IOByteOrderEnum = CommonEnums::IOByteOrder; using CellGeometryEnum = CommonEnums::CellGeometry; -#if !defined(ITK_LEGACY_REMOVE) -/** Expose old names for backwards compatibility*/ -using IOPixelType = CommonEnums::IOPixel; -using IOComponentType = CommonEnums::IOComponent; -using IOFileType = CommonEnums::IOFile; -using IOFileModeType = CommonEnums::IOFileMode; -using IOByteOrderType = CommonEnums::IOByteOrder; -using CellGeometryType = CommonEnums::CellGeometry; -#endif // Define how to print enumeration extern ITKCommon_EXPORT std::ostream & operator<<(std::ostream & out, IOPixelEnum value); diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.h b/Modules/Core/Common/include/itkConstNeighborhoodIterator.h index ca856039f54..2951f1fd285 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.h +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.h @@ -172,8 +172,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the N-dimensional index of the iterator's position in * the image. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex() const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex() const final { return m_Loop; } @@ -186,12 +186,12 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Function that "dereferences" a ConstNeighborhoodIterator, * returning a Neighborhood of pixel values. */ - ITK_ITERATOR_VIRTUAL NeighborhoodType - GetNeighborhood() const ITK_ITERATOR_FINAL; + virtual NeighborhoodType + GetNeighborhood() const final; /** Returns the pixel value located at a linear array location i. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const NeighborIndexType i) const ITK_ITERATOR_FINAL + virtual PixelType + GetPixel(const NeighborIndexType i) const final { if (!m_NeedToUseBoundaryCondition || this->InBounds()) { @@ -211,13 +211,13 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * image and the pixel value returned is an actual pixel in the * image. Sets "IsInBounds" to false if the location is outside the * image and the pixel value returned is a boundary condition. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPixel(NeighborIndexType i, bool & IsInBounds) const ITK_ITERATOR_FINAL; + virtual PixelType + GetPixel(NeighborIndexType i, bool & IsInBounds) const final; /** Returns the pixel value located at the itk::Offset o from the center of the neighborhood. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const OffsetType & o) const ITK_ITERATOR_FINAL + virtual PixelType + GetPixel(const OffsetType & o) const final { bool inbounds; @@ -229,8 +229,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * image and the pixel value returned is an actual pixel in the * image. Sets "IsInBounds" to false if the offset is outside the * image and the pixel value returned is a boundary condition. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const OffsetType & o, bool & IsInBounds) const ITK_ITERATOR_FINAL + virtual PixelType + GetPixel(const OffsetType & o, bool & IsInBounds) const final { return (this->GetPixel(this->GetNeighborhoodIndex(o), IsInBounds)); } @@ -238,8 +238,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the pixel value located i pixels distant from the neighborhood * center in the positive specified "axis" direction. No bounds checking * is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL PixelType - GetNext(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL + virtual PixelType + GetNext(const unsigned int axis, NeighborIndexType i) const final { return (this->GetPixel(this->GetCenterNeighborhoodIndex() + (i * this->GetStride(axis)))); } @@ -247,8 +247,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the pixel value located one pixel distant from the neighborhood * center in the specified positive axis direction. No bounds checking is * done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL PixelType - GetNext(const unsigned int axis) const ITK_ITERATOR_FINAL + virtual PixelType + GetNext(const unsigned int axis) const final { return (this->GetPixel(this->GetCenterNeighborhoodIndex() + this->GetStride(axis))); } @@ -256,8 +256,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the pixel value located i pixels distant from the neighborhood * center in the negative specified "axis" direction. No bounds checking * is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPrevious(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL + virtual PixelType + GetPrevious(const unsigned int axis, NeighborIndexType i) const final { return (this->GetPixel(this->GetCenterNeighborhoodIndex() - (i * this->GetStride(axis)))); } @@ -265,24 +265,24 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the pixel value located one pixel distant from the neighborhood * center in the specified negative axis direction. No bounds checking is * done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL PixelType - GetPrevious(const unsigned int axis) const ITK_ITERATOR_FINAL + virtual PixelType + GetPrevious(const unsigned int axis) const final { return (this->GetPixel(this->GetCenterNeighborhoodIndex() - this->GetStride(axis))); } /** Returns the image index for neighbor pixel at offset o from the center of the neighborhood. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex(const OffsetType & o) const final { return (this->GetIndex() + o); } /** Returns the image index for neighbor pixel at index i in the neighborhood. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex(NeighborIndexType i) const final { return (this->GetIndex() + this->GetOffset(i)); } @@ -326,31 +326,31 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator } /** Method for rewinding the iterator to its beginning pixel. */ - ITK_ITERATOR_VIRTUAL void - GoToBegin() ITK_ITERATOR_FINAL; + virtual void + GoToBegin() final; /** Method for sending the iterator to one past the last pixel in its * region. */ - ITK_ITERATOR_VIRTUAL void - GoToEnd() ITK_ITERATOR_FINAL; + virtual void + GoToEnd() final; /** Initializes the iterator to walk a particular image and a particular * region of that image. */ - ITK_ITERATOR_VIRTUAL void - Initialize(const SizeType & radius, const ImageType * ptr, const RegionType & region) ITK_ITERATOR_FINAL; + virtual void + Initialize(const SizeType & radius, const ImageType * ptr, const RegionType & region) final; /** Method for determining whether the iterator is at the * beginning of its iteration region. */ - ITK_ITERATOR_VIRTUAL bool - IsAtBegin() const ITK_ITERATOR_FINAL + virtual bool + IsAtBegin() const final { return (this->GetCenterPointer() == m_Begin); } /** Method for determining whether the iterator has reached the * end of its iteration region. */ - ITK_ITERATOR_VIRTUAL bool - IsAtEnd() const ITK_ITERATOR_FINAL + virtual bool + IsAtEnd() const final { if (this->GetCenterPointer() > m_End) { @@ -486,16 +486,16 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * object during the time it is referenced. The overriding condition * can be of a different type than the default type as long as it is * a subclass of ImageBoundaryCondition. */ - ITK_ITERATOR_VIRTUAL void - OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i) ITK_ITERATOR_FINAL + virtual void + OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i) final { m_BoundaryCondition = i; } /** Resets the boundary condition to the internal, default conditions * specified by the template parameter. */ - ITK_ITERATOR_VIRTUAL void - ResetBoundaryCondition() ITK_ITERATOR_FINAL + virtual void + ResetBoundaryCondition() final { m_BoundaryCondition = &m_InternalBoundaryCondition; } @@ -540,14 +540,14 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator } /** Set the region to iterate over. */ - ITK_ITERATOR_VIRTUAL void - SetRegion(const RegionType & region) ITK_ITERATOR_FINAL; + virtual void + SetRegion(const RegionType & region) final; protected: /** Default method for setting the coordinate location of the iterator. * Loop indices correspond to the actual Image region index. */ - ITK_ITERATOR_VIRTUAL void - SetLoop(const IndexType & p) ITK_ITERATOR_FINAL + virtual void + SetLoop(const IndexType & p) final { m_Loop = p; m_IsInBoundsValid = false; @@ -556,28 +556,28 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Method for setting internal loop boundaries. This * method must be defined in each subclass because * each subclass may handle loop boundaries differently. */ - ITK_ITERATOR_VIRTUAL void - SetBound(const SizeType &) ITK_ITERATOR_FINAL; + virtual void + SetBound(const SizeType &) final; /** Default method for setting the values of the internal pointers * to itk::Image memory buffer locations. This method should * generally only be called when the iterator is initialized. * \sa SetLocation */ - ITK_ITERATOR_VIRTUAL void - SetPixelPointers(const IndexType &) ITK_ITERATOR_FINAL; + virtual void + SetPixelPointers(const IndexType &) final; /** Default method for setting the index of the first pixel in the * iteration region. */ - ITK_ITERATOR_VIRTUAL void - SetBeginIndex(const IndexType & start) ITK_ITERATOR_FINAL + virtual void + SetBeginIndex(const IndexType & start) final { m_BeginIndex = start; } /** Default method for setting the index of the first pixel in the * iteration region. */ - ITK_ITERATOR_VIRTUAL void - SetEndIndex() ITK_ITERATOR_FINAL; + virtual void + SetEndIndex() final; /** The starting index for iteration within the itk::Image region * on which this ConstNeighborhoodIterator is defined. */ diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h index 2a88242f8a4..53ae1b0da4b 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h @@ -138,24 +138,24 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb /** Returns the N-dimensional index of the iterator's position in * the image. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex() const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex() const final { return m_Loop; } /** Returns the image index for neighbor pixel at offset o from the center of the neighborhood. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex(const OffsetType & o) const final { return (this->GetIndex() + o); } /** Returns the image index for neighbor pixel at index i in the neighborhood. */ - ITK_ITERATOR_VIRTUAL IndexType - GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL + virtual IndexType + GetIndex(NeighborIndexType i) const final { return (this->GetIndex() + this->GetOffset(i)); } @@ -181,31 +181,31 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb GetBoundingBoxAsImageRegion() const; /** Method for rewinding the iterator to its beginning image index. */ - ITK_ITERATOR_VIRTUAL void - GoToBegin() ITK_ITERATOR_FINAL; + virtual void + GoToBegin() final; /** Method for sending the iterator to one past the last index in its * region. */ - ITK_ITERATOR_VIRTUAL void - GoToEnd() ITK_ITERATOR_FINAL; + virtual void + GoToEnd() final; /** Initializes the iterator to walk a particular image and a particular * region of that image. */ - ITK_ITERATOR_VIRTUAL void - Initialize(const SizeType & radius, const ImageType * ptr, const RegionType & region) ITK_ITERATOR_FINAL; + virtual void + Initialize(const SizeType & radius, const ImageType * ptr, const RegionType & region) final; /** Virtual method for determining whether the iterator is at the * beginning of its iteration region. */ - ITK_ITERATOR_VIRTUAL bool - IsAtBegin() const ITK_ITERATOR_FINAL + virtual bool + IsAtBegin() const final { return (this->GetIndex() == m_BeginIndex); } /** Virtual method for determining whether the iterator has reached the * end of its iteration region. */ - ITK_ITERATOR_VIRTUAL bool - IsAtEnd() const ITK_ITERATOR_FINAL; + virtual bool + IsAtEnd() const final; /** Increments the pointers in the ConstNeighborhoodIteratorWithOnlyIndex, * wraps across boundaries automatically, accounting for @@ -341,8 +341,8 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb protected: /** Default method for setting the coordinate location of the iterator. * Loop indices correspond to the actual Image region index. */ - ITK_ITERATOR_VIRTUAL void - SetLoop(const IndexType & p) ITK_ITERATOR_FINAL + virtual void + SetLoop(const IndexType & p) final { m_Loop = p; m_IsInBoundsValid = false; @@ -351,21 +351,21 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb /** Virtual method for setting internal loop boundaries. This * method must be defined in each subclass because * each subclass may handle loop boundaries differently. */ - ITK_ITERATOR_VIRTUAL void - SetBound(const SizeType &) ITK_ITERATOR_FINAL; + virtual void + SetBound(const SizeType &) final; /** Default method for setting the first index of the * iteration region. */ - ITK_ITERATOR_VIRTUAL void - SetBeginIndex(const IndexType & start) ITK_ITERATOR_FINAL + virtual void + SetBeginIndex(const IndexType & start) final { m_BeginIndex = start; } /** Default method for setting the last index of the * iteration region. */ - ITK_ITERATOR_VIRTUAL void - SetEndIndex() ITK_ITERATOR_FINAL; + virtual void + SetEndIndex() final; /** The starting index for iteration within the itk::Image region * on which this ConstNeighborhoodIteratorWithOnlyIndex is defined. */ diff --git a/Modules/Core/Common/include/itkConstShapedNeighborhoodIterator.h b/Modules/Core/Common/include/itkConstShapedNeighborhoodIterator.h index 5325e943a17..7ca15d06092 100644 --- a/Modules/Core/Common/include/itkConstShapedNeighborhoodIterator.h +++ b/Modules/Core/Common/include/itkConstShapedNeighborhoodIterator.h @@ -122,7 +122,7 @@ class ITK_TEMPLATE_EXPORT ConstShapedNeighborhoodIterator : private Neighborhood this->GoToBegin(); } - ITK_ITERATOR_VIRTUAL ~ConstIterator() = default; + virtual ~ConstIterator() = default; ConstIterator & operator=(const ConstIterator & o) @@ -326,13 +326,13 @@ class ITK_TEMPLATE_EXPORT ConstShapedNeighborhoodIterator : private Neighborhood /** Add/Remove a neighborhood offset (from the center of the neighborhood) * to/from the active list. Active list offsets are the only locations * updated and accessible through the iterator. */ - ITK_ITERATOR_VIRTUAL void - ActivateOffset(const OffsetType & off) ITK_ITERATOR_FINAL + virtual void + ActivateOffset(const OffsetType & off) final { this->ActivateIndex(Superclass::GetNeighborhoodIndex(off)); } - ITK_ITERATOR_VIRTUAL void - DeactivateOffset(const OffsetType & off) ITK_ITERATOR_FINAL + virtual void + DeactivateOffset(const OffsetType & off) final { this->DeactivateIndex(Superclass::GetNeighborhoodIndex(off)); } @@ -350,8 +350,8 @@ class ITK_TEMPLATE_EXPORT ConstShapedNeighborhoodIterator : private Neighborhood } /** Removes all active pixels from this neighborhood. */ - ITK_ITERATOR_VIRTUAL void - ClearActiveList() ITK_ITERATOR_FINAL + virtual void + ClearActiveList() final { m_ActiveIndexList.clear(); m_CenterIsActive = false; @@ -422,9 +422,9 @@ class ITK_TEMPLATE_EXPORT ConstShapedNeighborhoodIterator : private Neighborhood argument is an index location calculated as an offset into a linear array which represents the image region defined by the radius of this iterator, with the smallest dimension as the fastest increasing index. */ - ITK_ITERATOR_VIRTUAL void ActivateIndex(NeighborIndexType) ITK_ITERATOR_FINAL; + virtual void ActivateIndex(NeighborIndexType) final; - ITK_ITERATOR_VIRTUAL void DeactivateIndex(NeighborIndexType) ITK_ITERATOR_FINAL; + virtual void DeactivateIndex(NeighborIndexType) final; bool m_CenterIsActive{ false }; diff --git a/Modules/Core/Common/include/itkDataObject.h b/Modules/Core/Common/include/itkDataObject.h index 6a2504c9196..67bbf4484d2 100644 --- a/Modules/Core/Common/include/itkDataObject.h +++ b/Modules/Core/Common/include/itkDataObject.h @@ -82,10 +82,6 @@ class ITKCommon_EXPORT DataObjectError : public ExceptionObject /** Get the data object that is throwing this exception. */ const DataObject * GetDataObject() const noexcept; -#if !defined(ITK_LEGACY_REMOVE) - DataObject * - GetDataObject() noexcept; -#endif protected: /** Print exception information. This method can be overridden by diff --git a/Modules/Core/Common/include/itkEnableIf.h b/Modules/Core/Common/include/itkEnableIf.h index f90a66a9abb..d0226979a80 100644 --- a/Modules/Core/Common/include/itkEnableIf.h +++ b/Modules/Core/Common/include/itkEnableIf.h @@ -17,154 +17,7 @@ *=========================================================================*/ #ifndef itkEnableIf_h #define itkEnableIf_h - -#include "itkMacro.h" - -#if !defined(ITK_LEGACY_REMOVE) - -namespace itk -{ -/// \cond HIDE_META_PROGRAMMING -namespace mpl -{ - -/** \brief This is an implementation of the enable if idiom. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - * - * Enable if is a common C++ meta-programming technique for example - * there is a boost implementation, for more information on its usage - * please see: - * https://www.boost.org/doc/libs/1_49_0/libs/utility/enable_if.html - * - * This template enables specialization of a templated function based - * on some traits or concepts. It is implemented with SFINAE. - * - * If the parameter V is true then the Type trait is the second - * template parameter, otherwise an implementation does not exist and - * with SFINAE another implementation may be chosen. - * - * Example: - \code - template< typename TType> - typename EnableIfC< - IsSame::ValueType>::Value, - TType >::Type - GetComponent(const TType pix, - unsigned int itkNotUsed( idx ) ) const - { - return pix; - } - \endcode - * - * \sa \c EnableIf - */ -template -struct EnableIfC -{}; -/// \cond SPECIALIZATION_IMPLEMENTATION -template -struct EnableIfC -{ - using Type = TType; -}; -/// \endcond - - -/** \brief An implementation of the negation of the enable if idiom. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - * - * \sa \c EnableIfC - * \sa \c DisableIf - */ -template -struct DisableIfC -{}; -/// \cond SPECIALIZATION_IMPLEMENTATION -template -struct DisableIfC -{ - using Type = TType; -}; -/// \endcond - -/** \brief simplified way to dispose of \c enable_if. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - * \tparam TCondition Condition type. It's expected to provide a boolean value - * through its \c Value member. - * \tparam TType Type to \em return when the \c TCondition is (a) true (type). - * - * This \em overload automatically fetches \c TCondition value. However, beware, it - * won't work with standard C++ traits or boost traits. Indeed, this \c - * enable_if overload expects the \em value to follow UpperCamelCase ITK naming - * policy instead of the standard snake_case policy. - * - * Example: - \code - template< typename TType> - typename EnableIf< - IsSame::ValueType>, - TType >::Type - GetComponent(const TType pix, - unsigned int itkNotUsed( idx ) ) const - { - return pix; - } - \endcode - * \sa \c EnableIfC - * \sa \c DisableIf - */ -template -struct EnableIf : public EnableIfC -{}; - -/** \brief simplified way to dispose of \c disable_if. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - * \tparam TCondition Condition type. It's expected to provide a boolean value - * through its \c Value member. - * \tparam TType Type to \em return when the \c TCondition is (a) false (type). - * - * This \em overload automatically fetches \c TCondition value. However, beware, it - * won't work with standard C++ traits or boost traits. Indeed, this \c - * enable_if overload expects the \em value to follow UpperCamelCase ITK naming - * policy instead of the standard snake_case policy. - * - * Example: - \code - template< typename TType> - typename DisableIf< - mpl::Not_::ValueType>>, - TType >::Type - GetComponent(const TType pix, - unsigned int itkNotUsed( idx ) ) const - { - return pix; - } - \endcode - * \sa \c EnableIfC - * \sa \c DisableIf - */ -template -struct DisableIf : public DisableIfC -{}; - -} // namespace mpl - -// itk::EnableIf(C), DisableIf(C) have move to itk::mpl -// Expect them to be deprecated. -using mpl::EnableIf; -using mpl::DisableIf; -using mpl::EnableIfC; -using mpl::DisableIfC; - -/// \endcond -} // namespace itk - -#else // ITK_LEGACY_REMOVE -# error Use C++ 11 std::enable_if directly -#endif +// This file is no longer needed, features are natively available in C++11 +#error Use C++ 11 std::enable_if directly #endif // itkEnableIf_h diff --git a/Modules/Core/Common/include/itkEventObject.h b/Modules/Core/Common/include/itkEventObject.h index 0dddea3f561..d6e22afc356 100644 --- a/Modules/Core/Common/include/itkEventObject.h +++ b/Modules/Core/Common/include/itkEventObject.h @@ -153,49 +153,6 @@ operator<<(std::ostream & os, const EventObject & e) itk::EventObject * classname::MakeObject() const { return new classname; } \ static_assert(true, "Compile time eliminated. Used to require a semi-colon at end of macro.") -#if !defined(ITK_LEGACY_REMOVE) -// Support Pre 2015 code bases - -// This macro duplicates some of the declaration and definition -// macro code. The purpose is to provide a backward compatibility API -// for ITK applications. -// NOTE: New applications should use itkEventMacroDeclaration (in a -// .h file) and itkEventMacroDefinition (in a compiled .cxx -// file). This new approach guarantees that only one copy of the -// implementation will be present. -// -# define itkEventMacro(classname, super) \ - /** \class classname */ \ - class ITKEvent_EXPORT classname : public super \ - { \ - public: \ - using Self = classname; \ - using Superclass = super; \ - classname() {} \ - virtual ~classname() {} \ - virtual const char * \ - GetEventName() const \ - { \ - return #classname; \ - } \ - virtual bool \ - CheckEvent(const itk::EventObject * e) const \ - { \ - return (dynamic_cast(e) != nullptr); \ - } \ - virtual itk::EventObject * \ - MakeObject() const \ - { \ - return new Self; \ - } \ - classname(const Self & s) \ - : super(s){}; \ - \ - private: \ - void \ - operator=(const Self &); \ - }; -#endif /** * Declare some common ITK events */ diff --git a/Modules/Core/Common/include/itkExtractImageFilter.h b/Modules/Core/Common/include/itkExtractImageFilter.h index 17773d1e584..10448c9110a 100644 --- a/Modules/Core/Common/include/itkExtractImageFilter.h +++ b/Modules/Core/Common/include/itkExtractImageFilter.h @@ -152,19 +152,6 @@ class ITK_TEMPLATE_EXPORT ExtractImageFilter : public InPlaceImageFilter::End() const -> ConstIterator return ConstIterator(m_InternalArray + VLength); } -#if !defined(ITK_LEGACY_REMOVE) - -template -auto -FixedArray::rBegin() -> ReverseIterator -{ - return ReverseIterator(m_InternalArray + VLength); -} - -template -auto -FixedArray::rBegin() const -> ConstReverseIterator -{ - return ConstReverseIterator(m_InternalArray + VLength); -} - -template -auto -FixedArray::rEnd() -> ReverseIterator -{ - return ReverseIterator(m_InternalArray); -} - -template -auto -FixedArray::rEnd() const -> ConstReverseIterator -{ - return ConstReverseIterator(m_InternalArray); -} - -#endif // defined ( ITK_LEGACY_REMOVE ) - template auto FixedArray::Size() const -> SizeType diff --git a/Modules/Core/Common/include/itkFloatingPointExceptions.h b/Modules/Core/Common/include/itkFloatingPointExceptions.h index d407803204b..3f9dfc27ffa 100644 --- a/Modules/Core/Common/include/itkFloatingPointExceptions.h +++ b/Modules/Core/Common/include/itkFloatingPointExceptions.h @@ -61,12 +61,6 @@ class ITKCommon_EXPORT FloatingPointExceptions virtual ~FloatingPointExceptions() = default; using ExceptionActionEnum = FloatingPointExceptionsEnums::ExceptionAction; -#if !defined(ITK_LEGACY_REMOVE) - /**Exposes enum values at class level for backwards compatibility*/ - using ExceptionAction = ExceptionActionEnum; - static constexpr ExceptionActionEnum ABORT = ExceptionActionEnum::ABORT; - static constexpr ExceptionActionEnum EXIT = ExceptionActionEnum::EXIT; -#endif /** Enable floating point exceptions. * diff --git a/Modules/Core/Common/include/itkFrustumSpatialFunction.h b/Modules/Core/Common/include/itkFrustumSpatialFunction.h index e9d12931a44..640750a20be 100644 --- a/Modules/Core/Common/include/itkFrustumSpatialFunction.h +++ b/Modules/Core/Common/include/itkFrustumSpatialFunction.h @@ -86,12 +86,6 @@ class ITK_TEMPLATE_EXPORT FrustumSpatialFunction : public InteriorExteriorSpatia /** Rotate the frustum in the XZ or the YZ plane. */ using FrustumRotationPlaneType = RotationPlaneEnum; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr FrustumRotationPlaneType RotateInXZPlane = RotationPlaneEnum::RotateInXZPlane; - static constexpr FrustumRotationPlaneType RotateInYZPlane = RotationPlaneEnum::RotateInYZPlane; -#endif /** Evaluates the function at a given position. */ OutputType diff --git a/Modules/Core/Common/include/itkImageBase.hxx b/Modules/Core/Common/include/itkImageBase.hxx index f67fd5f4193..b7358834a5b 100644 --- a/Modules/Core/Common/include/itkImageBase.hxx +++ b/Modules/Core/Common/include/itkImageBase.hxx @@ -83,12 +83,7 @@ ImageBase::SetSpacing(const SpacingType & spacing) if (spacing[i] < 0.0) { constexpr char message[] = "Negative spacing is not supported and may result in undefined behavior.\n"; -#if !defined(ITK_LEGACY_REMOVE) - itkWarningMacro(<< message << "Proceeding to set spacing to " << spacing); - break; -#else itkExceptionMacro(<< message << "Refusing to change spacing from " << this->m_Spacing << " to " << spacing); -#endif } } diff --git a/Modules/Core/Common/include/itkImageDuplicator.h b/Modules/Core/Common/include/itkImageDuplicator.h index 63eeb657851..f36e553111e 100644 --- a/Modules/Core/Common/include/itkImageDuplicator.h +++ b/Modules/Core/Common/include/itkImageDuplicator.h @@ -101,15 +101,6 @@ class ITK_TEMPLATE_EXPORT ImageDuplicator : public Object return this->m_DuplicateImage.GetPointer(); } -#if !defined(ITK_LEGACY_REMOVE) - // This interface was exposed in ITKv4 when the itkGetModifiableObjectMacro was used - virtual ImageType * - GetModifiableOutput() - { - return this->m_DuplicateImage.GetPointer(); - } -#endif - /** Compute of the input image. */ void Update(); diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index 7c9b8858e43..1ce4fe78c8c 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -36,18 +36,9 @@ #include // For conditional and integral_constant. #include // For tuple_element and tuple_size. -// Macro added to each `ImageRegion` member function that overrides a virtual member function of `Region`, when legacy -// support is enabled. Without legacy support, `ImageRegion` will no longer inherit from `Region`, so then those -// `ImageRegion` member functions will no longer override. -#ifdef ITK_LEGACY_REMOVE -# define itkRegionOverrideMacro // nothing -#else -# define itkRegionOverrideMacro override -#endif - namespace itk { -// Forward declaration of ImageBase so it can be declared a friend +// Forward declaration of ImageBase, so it can be declared a friend // (needed for PrintSelf mechanism) template class ITK_TEMPLATE_EXPORT ImageBase; @@ -78,22 +69,14 @@ class ITK_TEMPLATE_EXPORT ImageBase; */ template class ITK_TEMPLATE_EXPORT ImageRegion final -#ifndef ITK_LEGACY_REMOVE - // This inheritance is only there when legacy support is enabled. - : public Region -#endif { public: /** Standard class type aliases. */ using Self = ImageRegion; -#ifndef ITK_LEGACY_REMOVE - using Superclass = Region; -#endif - /** Standard part of all itk objects. */ const char * - GetNameOfClass() const itkRegionOverrideMacro + GetNameOfClass() const { return "ImageRegion"; } @@ -129,14 +112,14 @@ class ITK_TEMPLATE_EXPORT ImageRegion final /** Return the region type. Images are described with structured regions. */ Region::RegionEnum - GetRegionType() const itkRegionOverrideMacro + GetRegionType() const { return Region::RegionEnum::ITK_STRUCTURED_REGION; } /** Print the region. */ void - Print(std::ostream & os, Indent indent = 0) const itkRegionOverrideMacro; + Print(std::ostream & os, Indent indent = 0) const; /** Constructor. ImageRegion is a lightweight object that is not reference * counted, so the constructor is public. Its two data members are filled @@ -145,7 +128,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final /** Destructor. ImageRegion is a lightweight object that is not reference * counted, so the destructor is public. */ - ~ImageRegion() itkRegionOverrideMacro = default; + ~ImageRegion() = default; /** Copy constructor. ImageRegion is a lightweight object that is not * reference counted, so the copy constructor is public. */ @@ -400,7 +383,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final * instead) but used in the hierarchical print process to combine the * output of several classes. */ void - PrintSelf(std::ostream & os, Indent indent) const itkRegionOverrideMacro; + PrintSelf(std::ostream & os, Indent indent) const; private: IndexType m_Index = { { 0 } }; @@ -461,8 +444,6 @@ struct tuple_element> #endif } // namespace std -#undef itkRegionOverrideMacro - #ifndef ITK_MANUAL_INSTANTIATION # include "itkImageRegion.hxx" #endif diff --git a/Modules/Core/Common/include/itkImageSink.h b/Modules/Core/Common/include/itkImageSink.h index d8c146c8b3d..ee14040534e 100644 --- a/Modules/Core/Common/include/itkImageSink.h +++ b/Modules/Core/Common/include/itkImageSink.h @@ -158,7 +158,7 @@ class ImageSink {} void - VerifyInputInformation() ITKv5_CONST override; + VerifyInputInformation() const override; void BeforeStreamedGenerateData() override diff --git a/Modules/Core/Common/include/itkImageSink.hxx b/Modules/Core/Common/include/itkImageSink.hxx index 7966797b669..ae34d2d914e 100644 --- a/Modules/Core/Common/include/itkImageSink.hxx +++ b/Modules/Core/Common/include/itkImageSink.hxx @@ -167,7 +167,7 @@ ImageSink::GenerateNthInputRequestedRegion(unsigned int inputReques template void -ImageSink::VerifyInputInformation() ITKv5_CONST +ImageSink::VerifyInputInformation() const { using ImageBaseType = const ImageBase; diff --git a/Modules/Core/Common/include/itkImageSource.h b/Modules/Core/Common/include/itkImageSource.h index d57631b0cf7..fa7b96427d3 100644 --- a/Modules/Core/Common/include/itkImageSource.h +++ b/Modules/Core/Common/include/itkImageSource.h @@ -399,7 +399,7 @@ class ITK_TEMPLATE_EXPORT ImageSource itkSetMacro(DynamicMultiThreading, bool); itkBooleanMacro(DynamicMultiThreading); - bool m_DynamicMultiThreading{}; + bool m_DynamicMultiThreading{ true }; }; } // end namespace itk diff --git a/Modules/Core/Common/include/itkImageSource.hxx b/Modules/Core/Common/include/itkImageSource.hxx index 3103e4256eb..43607924d88 100644 --- a/Modules/Core/Common/include/itkImageSource.hxx +++ b/Modules/Core/Common/include/itkImageSource.hxx @@ -45,12 +45,6 @@ ImageSource::ImageSource() this->ProcessObject::SetNumberOfRequiredOutputs(1); this->ProcessObject::SetNthOutput(0, output.GetPointer()); -#if defined(ITKV4_COMPATIBILITY) - m_DynamicMultiThreading = false; -#else - m_DynamicMultiThreading = true; -#endif - // Set the default behavior of an image source to NOT release its // output bulk data prior to GenerateData() in case that bulk data // can be reused (an thus avoid a costly deallocate/allocate cycle). @@ -242,19 +236,10 @@ ImageSource::GenerateData() // The execute method created by the subclass. template void -ImageSource::ThreadedGenerateData(const OutputImageRegionType & -#if !defined(ITK_LEGACY_REMOVE) - region -#endif - , - ThreadIdType) +ImageSource::ThreadedGenerateData(const OutputImageRegionType & itkNotUsed(region), ThreadIdType) { -#if !defined(ITK_LEGACY_REMOVE) - this->DynamicThreadedGenerateData(region); -#else itkExceptionMacro("With DynamicMultiThreadingOff subclass should override this method. The signature of " "ThreadedGenerateData() has been changed in ITK v4 to use the new ThreadIdType."); -#endif } // The execute method created by the subclass. @@ -287,21 +272,6 @@ ImageSource::ThreaderCallback(void * arg) if (workUnitID < total) { str->Filter->ThreadedGenerateData(splitRegion, workUnitID); -#if defined(ITKV4_COMPATIBILITY) - if (str->Filter->GetAbortGenerateData()) - { - std::string msg; - ProcessAborted e(__FILE__, __LINE__); - msg += "Object " + std::string(str->Filter->GetNameOfClass()) + ": AbortGenerateData was set!"; - e.SetDescription(msg); - throw e; - } - else if (!str->Filter->GetDynamicMultiThreading() // progress reporting is not done in MultiThreaders - && str->Filter->GetProgress() == 0.0f) // and progress was not set after at least the first chunk finished - { - str->Filter->UpdateProgress(static_cast(workUnitID + 1) / total); // this will be the only progress update - } -#endif } // else don't use this thread. Threads were not split conveniently. return ITK_THREAD_RETURN_DEFAULT_VALUE; diff --git a/Modules/Core/Common/include/itkImageToImageFilter.h b/Modules/Core/Common/include/itkImageToImageFilter.h index f294f6b066f..dd13b4277c1 100644 --- a/Modules/Core/Common/include/itkImageToImageFilter.h +++ b/Modules/Core/Common/include/itkImageToImageFilter.h @@ -244,7 +244,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageFilter * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override; + VerifyInputInformation() const override; /** What is the input requested region that is required to produce * the output requested region? The base assumption for image diff --git a/Modules/Core/Common/include/itkImageToImageFilter.hxx b/Modules/Core/Common/include/itkImageToImageFilter.hxx index c8ec806f39c..d3ba255822f 100644 --- a/Modules/Core/Common/include/itkImageToImageFilter.hxx +++ b/Modules/Core/Common/include/itkImageToImageFilter.hxx @@ -145,7 +145,7 @@ ImageToImageFilter::PrintSelf(std::ostream & os, Inde template void -ImageToImageFilter::VerifyInputInformation() ITKv5_CONST +ImageToImageFilter::VerifyInputInformation() const { using ImageBaseType = const ImageBase; diff --git a/Modules/Core/Common/include/itkIsBaseOf.h b/Modules/Core/Common/include/itkIsBaseOf.h index 34cc34b6129..6882791877b 100644 --- a/Modules/Core/Common/include/itkIsBaseOf.h +++ b/Modules/Core/Common/include/itkIsBaseOf.h @@ -18,39 +18,6 @@ #ifndef itkIsBaseOf_h #define itkIsBaseOf_h -#include - -#include "itkMacro.h" - -#if !defined(ITK_LEGACY_REMOVE) - -namespace itk -{ -/// \cond HIDE_META_PROGRAMMING -namespace mpl -{ -/** Traits that emulates \c std::is_base_of<>. - * \tparam TBase base type - * \tparam TDerived derived type - * \return (in \c Value) whether \c TDerived inherits (publicly) from \c TBase - * (directly, or indirectly) - * \author The definition provided follows the code snippet available in Andrei - * Alexandrescu's Modern C++ Design. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - */ -template -struct IsBaseOf -{ - static constexpr bool Value = std::is_base_of_v; -}; -} // end namespace mpl - -/// \endcond -} // end namespace itk - -#else // ITK_LEGACY_REMOVE -# error Use C++ 11 std::is_base_of directly -#endif +#error Use C++ 11 std::is_base_of directly #endif // itkIsBaseOf_h diff --git a/Modules/Core/Common/include/itkIsConvertible.h b/Modules/Core/Common/include/itkIsConvertible.h index 12193fd05b9..66c6ecffa6d 100644 --- a/Modules/Core/Common/include/itkIsConvertible.h +++ b/Modules/Core/Common/include/itkIsConvertible.h @@ -17,75 +17,7 @@ *=========================================================================*/ #ifndef itkIsConvertible_h #define itkIsConvertible_h - -#include "itkMacro.h" - -#if !defined(ITK_LEGACY_REMOVE) - -# include "itkMetaProgrammingLibrary.h" - -namespace itk -{ - -/** \cond HIDE_META_PROGRAMMING */ - -namespace mpl -{ -namespace Details -{ - -/** Helper root class for Meta-programming purpose. - * This class provides two types that help build SFINAE based meta-programs. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - */ -struct SfinaeTypes -{ - using TOne = char; - struct TTwo - { - char arr__[2]; - }; -}; -} // namespace Details - -/** Traits that emulates \c std::is_convertible<>. - * \tparam TFrom type to convert from - * \tparam TTo type to convert to - * \return (in \c Value) whether \c TFrom objects can be converted into \c TTo - * objects. - * \warning This version does not support \c void, function pointers, nor arrays. - * \author The definition provided follows the code snippet available in Andrei - * Alexandrescu's Modern C++ Design. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - */ -template -struct IsConvertible : private Details::SfinaeTypes -{ -private: - static TOne Test(TTo); - static TTwo - Test(...); - static TFrom - MakeT(); - -public: - static constexpr bool Value = sizeof(Test(MakeT())) == sizeof(TOne); -}; - -} // end namespace mpl - -// itk::IsConvertible has moved to itk::mpl. -// Expect itk::IsConvertible to be deprecated. -using mpl::IsConvertible; - -/** \endcond */ - -} // end namespace itk - -#else // ITK_LEGACY_REMOVE -# error Use C++ 11 std::is_convertible directly -#endif +// This file is no longer needed, C++11 provides support directly +#error Use C++ 11 std::is_convertible directly #endif // itkIsConvertible_h diff --git a/Modules/Core/Common/include/itkIsSame.h b/Modules/Core/Common/include/itkIsSame.h index 93cf498df08..fe195927b4d 100644 --- a/Modules/Core/Common/include/itkIsSame.h +++ b/Modules/Core/Common/include/itkIsSame.h @@ -18,44 +18,7 @@ #ifndef itkIsSame_h #define itkIsSame_h -#include "itkMacro.h" - -#if !defined(ITK_LEGACY_REMOVE) - -# include "itkMetaProgrammingLibrary.h" - -namespace itk -{ -/// \cond HIDE_META_PROGRAMMING -namespace mpl -{ - -/** Tells whether two types are identical. - * \ingroup MetaProgrammingLibrary - * \ingroup ITKCommon - */ -template -struct IsSame : public FalseType -{}; - -/// \cond SPECIALIZATION_IMPLEMENTATION -template -struct IsSame : public TrueType -{}; -/// \endcond - -} // end namespace mpl - -// itk::IsSame have move to itk::mpl -// Expect them to be deprecated. -using mpl::IsSame; - -/// \endcond - -} // end namespace itk - -#else // ITK_LEGACY_REMOVE -# error Use C++ 11 std::is_same directly -#endif +// This file is no longer needed, C++11 provides support directly +#error Use C++ 11 std::is_same directly #endif // itkIsSame_h diff --git a/Modules/Core/Common/include/itkLoggerBase.h b/Modules/Core/Common/include/itkLoggerBase.h index 2f3939b4b1e..4ea6041acaf 100644 --- a/Modules/Core/Common/include/itkLoggerBase.h +++ b/Modules/Core/Common/include/itkLoggerBase.h @@ -92,28 +92,11 @@ class ITKCommon_EXPORT LoggerBase : public Object using OutputType = MultipleLogOutput::OutputType; using PriorityLevelEnum = LoggerBaseEnums::PriorityLevel; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr PriorityLevelEnum MUSTFLUSH = PriorityLevelEnum::MUSTFLUSH; - static constexpr PriorityLevelEnum FATAL = PriorityLevelEnum::FATAL; - static constexpr PriorityLevelEnum CRITICAL = PriorityLevelEnum::CRITICAL; - static constexpr PriorityLevelEnum WARNING = PriorityLevelEnum::WARNING; - static constexpr PriorityLevelEnum INFO = PriorityLevelEnum::INFO; - static constexpr PriorityLevelEnum DEBUG = PriorityLevelEnum::DEBUG; - static constexpr PriorityLevelEnum NOTSET = PriorityLevelEnum::NOTSET; -#endif itkSetStringMacro(Name); itkGetStringMacro(Name); using TimeStampFormatEnum = LoggerBaseEnums::TimeStampFormat; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr TimeStampFormatEnum REALVALUE = TimeStampFormatEnum::REALVALUE; - static constexpr TimeStampFormatEnum HUMANREADABLE = TimeStampFormatEnum::HUMANREADABLE; -#endif /** Set/Get the type of format used for reporting the time stamp of a given * log message. The main options are REALVALUE and HUMANREADABLE. diff --git a/Modules/Core/Common/include/itkLoggerThreadWrapper.h b/Modules/Core/Common/include/itkLoggerThreadWrapper.h index ec95dbd7c4d..5fab7e0c2b4 100644 --- a/Modules/Core/Common/include/itkLoggerThreadWrapper.h +++ b/Modules/Core/Common/include/itkLoggerThreadWrapper.h @@ -85,15 +85,6 @@ class ITK_TEMPLATE_EXPORT LoggerThreadWrapper : public SimpleLoggerType using OperationEnum = LoggerThreadWrapperEnums::Operation; -#if !defined(ITK_LEGACY_REMOVE) - using LoggerThreadWrapperOperationType = OperationEnum; - - static constexpr OperationEnum SET_PRIORITY_LEVEL = OperationEnum::SET_PRIORITY_LEVEL; - static constexpr OperationEnum SET_LEVEL_FOR_FLUSHING = OperationEnum::SET_LEVEL_FOR_FLUSHING; - static constexpr OperationEnum ADD_LOG_OUTPUT = OperationEnum::ADD_LOG_OUTPUT; - static constexpr OperationEnum WRITE = OperationEnum::WRITE; -#endif - /** Set the priority level for the current logger. Only messages that have * priorities equal or greater than the one set here will be posted to the * current outputs */ diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index d5e590248b3..bd7e1cae70d 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -80,17 +80,7 @@ namespace itk * */ #define ITK_NOOP_STATEMENT static_assert(true, "") - -#if defined(ITK_FUTURE_LEGACY_REMOVE) - -# define ITK_MACROEND_NOOP_STATEMENT ITK_NOOP_STATEMENT -#else -/* NOTE: The ITK_MACROEND_NOOP_STATEMENT must be defined to nothing - * in order to maintain backwards compatibility with earlier macro - * uses that may or may not have ';' after the macro is used. */ -/* Purposefully empty */ -# define ITK_MACROEND_NOOP_STATEMENT -#endif +#define ITK_MACROEND_NOOP_STATEMENT ITK_NOOP_STATEMENT // clang-format on // Define ITK_PRAGMA macro. @@ -249,17 +239,6 @@ namespace itk # endif #endif - -//-*-*-* -// The following deprecations should be removed in ITKV6 and later -// NOTE DEPRECATED should be ITK_NOEXCEPT -#define ITK_NOEXCEPT_OR_THROW error "Replace ITK_NOEXCEPT_OR_THROW with ITK_NOEXCEPT" -// NOTE DEPRECATED! should be ITK_COMPILER_CXX_STATIC_ASSERT -#if !defined(ITK_LEGACY_REMOVE) -# define ITK_DELETE_FUNCTION = delete -#else -# define ITK_DELETE_FUNCTION error "Replace ITK_DELETE_FUNCTION with = delete" -#endif //-*-*-* // DEPRECATED: These macros are left here for compatibility with remote modules. @@ -1168,7 +1147,7 @@ compilers. ITK_MACROEND_NOOP_STATEMENT -#if defined(ITK_FUTURE_LEGACY_REMOVE) +#if defined(ITK_LEGACY_REMOVE) // In the future, the itkGetObjectMacro will be deprecated with the ITK_LEGACY_REMOVE // flag. For now, this very advanced feature is only available // through manual setting of a compiler define -DITK_FUTURE_LEGACY_REMOVE @@ -1359,35 +1338,18 @@ compilers. } \ ITK_MACROEND_NOOP_STATEMENT +// The following deprecations are removed in ITKV6 and later +#define ITK_ITERATOR_VIRTUAL static_assert(false, "ERROR: ITK_ITERATOR_VIRTUAL must be replaced with 'virtual'") +#define ITK_ITERATOR_OVERRIDE static_assert(false, "ERROR: ITK_ITERATOR_OVERRIDE must be replaced with 'override'") +#define ITK_ITERATOR_FINAL static_assert(false, "ERROR: ITK_ITERATOR_FINAL must be replaced with 'final'") +#define ITK_DELETE_FUNCTION static_assert(false, "ERROR: ITK_DELETE_FUNCTION must be replaced with 'delete'") +#define ITK_NOEXCEPT_OR_THROW static_assert(false, "ERROR: ITK_NOEXCEPT_OR_THROW must be replaced with 'ITK_NOEXCEPT'") -/** Defines to provide compatibility with derived iterators. - * - * With ITKv5 several methods for Image Iterators have been - * devirtualized for performance reasons. These definitions may help - * provide legacy compatibility, or help detecting derived iterators - * relying on the virtual interface. Compatibility for derived - * classes can be achieved with defining ITKV4_COMPATIBILITY. Code - * should be migrated to no longer rely on the old virtual interface. - */ -#if defined(ITKV4_COMPATIBILITY) -# define ITK_ITERATOR_VIRTUAL virtual -# define ITK_ITERATOR_OVERRIDE override -# define ITK_ITERATOR_FINAL -#elif !defined(ITK_LEGACY_REMOVE) -# define ITK_ITERATOR_VIRTUAL virtual -# define ITK_ITERATOR_OVERRIDE override -# define ITK_ITERATOR_FINAL final -#else -# define ITK_ITERATOR_VIRTUAL -# define ITK_ITERATOR_OVERRIDE -# define ITK_ITERATOR_FINAL -#endif - -#if defined(ITKV4_COMPATIBILITY) -// A macro for methods which are const in ITKv5, but not in ITKv4 -# define ITKv5_CONST +#if defined(ITK_LEGACY_REMOVE) +// A macro for methods which are const in ITKv5 and ITKv6 require const for functions +# define ITKv5_CONST static_assert(false, "ERROR: ITKv5_CONST must be replaced with 'const'") #else -// A macro for methods which are const in ITKv5, but not in ITKv4 +// A macro for methods which are const in after ITKv4 # define ITKv5_CONST const #endif @@ -1423,14 +1385,10 @@ itkDynamicCastInDebugMode(TSource x) #endif } -#ifdef ITK_LEGACY_REMOVE -# if __cplusplus >= 202002L -# define ITK_NODISCARD(message) [[nodiscard(message)]] -# else -# define ITK_NODISCARD(message) [[nodiscard]] -# endif +#if __cplusplus >= 202002L +# define ITK_NODISCARD(message) [[nodiscard(message)]] #else -# define ITK_NODISCARD(message) +# define ITK_NODISCARD(message) [[nodiscard]] #endif // Defines which used to be in itk_compiler_detection.h diff --git a/Modules/Core/Common/include/itkMultiThreaderBase.h b/Modules/Core/Common/include/itkMultiThreaderBase.h index 5aa630aca60..6dfe970e5b4 100644 --- a/Modules/Core/Common/include/itkMultiThreaderBase.h +++ b/Modules/Core/Common/include/itkMultiThreaderBase.h @@ -158,15 +158,6 @@ class ITKCommon_EXPORT MultiThreaderBase : public Object itkLegacyMacro(static bool GetGlobalDefaultUseThreadPool()); using ThreaderEnum = MultiThreaderBaseEnums::Threader; -#if !defined(ITK_LEGACY_REMOVE) - using ThreaderType = ThreaderEnum; - static constexpr ThreaderEnum Platform = ThreaderEnum::Platform; - static constexpr ThreaderEnum First = ThreaderEnum::First; - static constexpr ThreaderEnum Pool = ThreaderEnum::Pool; - static constexpr ThreaderEnum TBB = ThreaderEnum::TBB; - static constexpr ThreaderEnum Last = ThreaderEnum::Last; - static constexpr ThreaderEnum Unknown = ThreaderEnum::Unknown; -#endif /** Convert a threader name into its enum type. */ static ThreaderEnum @@ -215,57 +206,6 @@ class ITKCommon_EXPORT MultiThreaderBase : public Object static ThreadIdType GetGlobalDefaultNumberOfThreads(); -#if !defined(ITK_LEGACY_REMOVE) - /** Get/Set the number of threads to use. - * DEPRECATED! Use WorkUnits and MaximumNumberOfThreads instead. */ - itkLegacyMacro(virtual void SetNumberOfThreads(ThreadIdType numberOfThreads)) - { - this->SetMaximumNumberOfThreads(numberOfThreads); - this->SetNumberOfWorkUnits(this->GetMaximumNumberOfThreads()); // Might be clamped - } - itkLegacyMacro(virtual ThreadIdType GetNumberOfThreads()) { return this->GetNumberOfWorkUnits(); } - - /** This is the structure that is passed to the thread that is - * created from the SingleMethodExecute. It is passed in as a void *, - * and it is up to the method to cast correctly and extract the information. - * The ThreadID is a number between 0 and NumberOfThreads-1 that - * indicates the id of this thread. The UserData is the - * (void *)arg passed into the SetSingleMethod. - * - * DEPRECATED! Use WorkUnitInfo instead. */ - // clang-format off -ITK_GCC_PRAGMA_DIAG_PUSH() -ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") -INTEL_PRAGMA_WARN_PUSH -INTEL_SUPPRESS_warning_1292 - // clang-format on -# ifdef ITK_LEGACY_SILENT - struct ThreadInfoStruct -# else - struct [[deprecated("Use WorkUnitInfo, ThreadInfoStruct is deprecated since ITK 5.0")]] ThreadInfoStruct -# endif - // clang-format off -INTEL_PRAGMA_WARN_POP - // clang-format on - { - ThreadIdType ThreadID; - ThreadIdType NumberOfThreads; - void * UserData; - ThreadFunctionType ThreadFunction; - enum - { - SUCCESS, - ITK_EXCEPTION, - ITK_PROCESS_ABORTED_EXCEPTION, - STD_EXCEPTION, - UNKNOWN - } ThreadExitCode; - }; - // clang-format off -ITK_GCC_PRAGMA_DIAG_POP() - // clang-format on -#endif // ITK_LEGACY_REMOVE - /** This is the structure that is passed to the thread that is * created from the SingleMethodExecute. It is passed in as a void *, * and it is up to the method to cast correctly and extract the information. @@ -280,15 +220,6 @@ ITK_GCC_PRAGMA_DIAG_POP() ThreadFunctionType ThreadFunction; using ThreadExitCodeEnum = MultiThreaderBaseEnums::ThreadExitCode; ThreadExitCodeEnum ThreadExitCode; -#if !defined(ITK_LEGACY_REMOVE) - using ThreadExitCodeType = ThreadExitCodeEnum; - static constexpr ThreadExitCodeEnum SUCCESS = ThreadExitCodeEnum::SUCCESS; - static constexpr ThreadExitCodeEnum ITK_EXCEPTION = ThreadExitCodeEnum::ITK_EXCEPTION; - static constexpr ThreadExitCodeEnum ITK_PROCESS_ABORTED_EXCEPTION = - ThreadExitCodeEnum::ITK_PROCESS_ABORTED_EXCEPTION; - static constexpr ThreadExitCodeEnum STD_EXCEPTION = ThreadExitCodeEnum::STD_EXCEPTION; - static constexpr ThreadExitCodeEnum UNKNOWN = ThreadExitCodeEnum::UNKNOWN; -#endif }; /** Execute the SingleMethod (as define by SetSingleMethod) using @@ -309,7 +240,7 @@ ITK_GCC_PRAGMA_DIAG_POP() void SetSingleMethodAndExecute(ThreadFunctionType func, void * data); -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE // `TemplatedThreadingFunctorType` was previously used to declare the `funcP` parameter of `ParallelizeImageRegion` // and `ParallelizeImageRegionRestrictDirection` template member functions. template diff --git a/Modules/Core/Common/include/itkNeighborhoodIterator.h b/Modules/Core/Common/include/itkNeighborhoodIterator.h index a1d7f855bad..26a2a4181be 100644 --- a/Modules/Core/Common/include/itkNeighborhoodIterator.h +++ b/Modules/Core/Common/include/itkNeighborhoodIterator.h @@ -262,8 +262,8 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato } /** Returns the central pixel of the neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetCenterPixel(const PixelType & p) ITK_ITERATOR_FINAL + virtual void + SetCenterPixel(const PixelType & p) final { this->m_NeighborhoodAccessorFunctor.Set(this->operator[]((this->Size()) >> 1), p); } @@ -271,23 +271,23 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato /** Virtual function that replaces the pixel values in the image * neighborhood that are pointed to by this NeighborhoodIterator with * the pixel values contained in a Neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetNeighborhood(const NeighborhoodType &) ITK_ITERATOR_FINAL; + virtual void + SetNeighborhood(const NeighborhoodType &) final; /** Special SetPixel method which quietly ignores out-of-bounds attempts. * Sets status TRUE if pixel has been set, FALSE otherwise. */ - ITK_ITERATOR_VIRTUAL void - SetPixel(const unsigned int i, const PixelType & v, bool & status) ITK_ITERATOR_FINAL; + virtual void + SetPixel(const unsigned int i, const PixelType & v, bool & status) final; /** Set the pixel at the ith location. */ - ITK_ITERATOR_VIRTUAL void - SetPixel(const unsigned int i, const PixelType & v) ITK_ITERATOR_FINAL; + virtual void + SetPixel(const unsigned int i, const PixelType & v) final; // { *(this->operator[](i)) = v; } /** Set the pixel at offset o from the neighborhood center */ - ITK_ITERATOR_VIRTUAL void - SetPixel(const OffsetType o, const PixelType & v) ITK_ITERATOR_FINAL + virtual void + SetPixel(const OffsetType o, const PixelType & v) final { this->SetPixel(this->GetNeighborhoodIndex(o), v); } @@ -296,8 +296,8 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato /** Sets the pixel value located i pixels distant from the neighborhood center in the positive specified "axis" direction. No bounds checking is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetNext(const unsigned int axis, const unsigned int i, const PixelType & v) ITK_ITERATOR_FINAL + virtual void + SetNext(const unsigned int axis, const unsigned int i, const PixelType & v) final { this->SetPixel(this->GetCenterNeighborhoodIndex() + (i * this->GetStride(axis)), v); } @@ -305,8 +305,8 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato /** Sets the pixel value located one pixel distant from the neighborhood center in the specified positive axis direction. No bounds checking is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetNext(const unsigned int axis, const PixelType & v) ITK_ITERATOR_FINAL + virtual void + SetNext(const unsigned int axis, const PixelType & v) final { this->SetPixel(this->GetCenterNeighborhoodIndex() + this->GetStride(axis), v); } @@ -314,8 +314,8 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato /** Sets the pixel value located i pixels distant from the neighborhood center in the negative specified "axis" direction. No bounds checking is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetPrevious(const unsigned int axis, const unsigned int i, const PixelType & v) ITK_ITERATOR_FINAL + virtual void + SetPrevious(const unsigned int axis, const unsigned int i, const PixelType & v) final { this->SetPixel(this->GetCenterNeighborhoodIndex() - (i * this->GetStride(axis)), v); } @@ -323,8 +323,8 @@ class ITK_TEMPLATE_EXPORT NeighborhoodIterator : public ConstNeighborhoodIterato /** Sets the pixel value located one pixel distant from the neighborhood center in the specified negative axis direction. No bounds checking is done on the size of the neighborhood. */ - ITK_ITERATOR_VIRTUAL void - SetPrevious(const unsigned int axis, const PixelType & v) ITK_ITERATOR_FINAL + virtual void + SetPrevious(const unsigned int axis, const PixelType & v) final { this->SetPixel(this->GetCenterNeighborhoodIndex() - this->GetStride(axis), v); } diff --git a/Modules/Core/Common/include/itkNumericTraits.h b/Modules/Core/Common/include/itkNumericTraits.h index ae4bd04fbb2..3326c33f885 100644 --- a/Modules/Core/Common/include/itkNumericTraits.h +++ b/Modules/Core/Common/include/itkNumericTraits.h @@ -1981,11 +1981,9 @@ class NumericTraits> m = ValueType{}; } -#if defined(ITK_LEGACY_REMOVE) static_assert(std::is_floating_point_v, "As per https://en.cppreference.com/w/cpp/numeric/complex the behavior is unspecified and may fail to " "compile if TComponent is not float, double, or long double and undefined if T is not NumericType."); -#endif // defined(ITK_LEGACY_REMOVE) }; /// \endcond } // end namespace itk diff --git a/Modules/Core/Common/include/itkObjectFactoryBase.h b/Modules/Core/Common/include/itkObjectFactoryBase.h index 208cf97a23a..30718e599e8 100644 --- a/Modules/Core/Common/include/itkObjectFactoryBase.h +++ b/Modules/Core/Common/include/itkObjectFactoryBase.h @@ -104,13 +104,6 @@ class ITKCommon_EXPORT ObjectFactoryBase : public Object RegisterFactoryInternal(ObjectFactoryBase *); using InsertionPositionEnum = ObjectFactoryEnums::InsertionPosition; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr InsertionPositionEnum INSERT_AT_FRONT = InsertionPositionEnum::INSERT_AT_FRONT; - static constexpr InsertionPositionEnum INSERT_AT_BACK = InsertionPositionEnum::INSERT_AT_BACK; - static constexpr InsertionPositionEnum INSERT_AT_POSITION = InsertionPositionEnum::INSERT_AT_POSITION; -#endif /** Register a factory so it can be used to create itk objects. * diff --git a/Modules/Core/Common/include/itkObjectStore.h b/Modules/Core/Common/include/itkObjectStore.h index 73d53b1d317..fe012ee4602 100644 --- a/Modules/Core/Common/include/itkObjectStore.h +++ b/Modules/Core/Common/include/itkObjectStore.h @@ -105,12 +105,7 @@ class ITK_TEMPLATE_EXPORT ObjectStore : public Object using FreeListType = std::vector; using GrowthStrategyEnum = ObjectStoreEnums::GrowthStrategy; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr GrowthStrategyEnum LINEAR_GROWTH = GrowthStrategyEnum::LINEAR_GROWTH; - static constexpr GrowthStrategyEnum EXPONENTIAL_GROWTH = GrowthStrategyEnum::EXPONENTIAL_GROWTH; -#endif + /** Borrow a pointer to an object from the memory store. */ ObjectType * Borrow(); diff --git a/Modules/Core/Common/include/itkOctree.h b/Modules/Core/Common/include/itkOctree.h index 647468bf4cb..6914cb50e6e 100644 --- a/Modules/Core/Common/include/itkOctree.h +++ b/Modules/Core/Common/include/itkOctree.h @@ -46,15 +46,6 @@ class ITKCommon_EXPORT OctreeBase : public Object using OctreeEnum = OctreeEnums::Octree; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr OctreeEnum UNKNOWN_PLANE = OctreeEnum::UNKNOWN_PLANE; - static constexpr OctreeEnum SAGITAL_PLANE = OctreeEnum::SAGITAL_PLANE; - static constexpr OctreeEnum CORONAL_PLANE = OctreeEnum::CORONAL_PLANE; - static constexpr OctreeEnum TRANSVERSE_PLANE = OctreeEnum::TRANSVERSE_PLANE; -#endif - /** Get the actual tree base * * Returns the tree, or 0 if the Octree isn't built yet @@ -181,16 +172,6 @@ class ITK_TEMPLATE_EXPORT Octree : public OctreeBase unsigned int GetDepth() override; - /*** - * Exposes enum values for backwards compatibility - * */ -#if !defined(ITK_LEGACY_REMOVE) - static constexpr OctreeEnum UNKNOWN_PLANE = OctreeEnum::UNKNOWN_PLANE; - static constexpr OctreeEnum SAGITAL_PLANE = OctreeEnum::SAGITAL_PLANE; - static constexpr OctreeEnum CORONAL_PLANE = OctreeEnum::CORONAL_PLANE; - static constexpr OctreeEnum TRANSVERSE_PLANE = OctreeEnum::TRANSVERSE_PLANE; -#endif - OctreeNode * GetTree() override; diff --git a/Modules/Core/Common/include/itkOctreeNode.h b/Modules/Core/Common/include/itkOctreeNode.h index 0202f1cbb1b..1c2b17077d6 100644 --- a/Modules/Core/Common/include/itkOctreeNode.h +++ b/Modules/Core/Common/include/itkOctreeNode.h @@ -59,18 +59,6 @@ class ITKCommon_EXPORT OctreeNode virtual ~OctreeNode(); using LeafIdentifierEnum = OctreeEnums::LeafIdentifier; -#if !defined(ITK_LEGACY_REMOVE) - // We need to expose the enum values at the class level - // for backwards compatibility - static constexpr LeafIdentifierEnum ZERO = LeafIdentifierEnum::ZERO; - static constexpr LeafIdentifierEnum ONE = LeafIdentifierEnum::ONE; - static constexpr LeafIdentifierEnum TWO = LeafIdentifierEnum::TWO; - static constexpr LeafIdentifierEnum THREE = LeafIdentifierEnum::THREE; - static constexpr LeafIdentifierEnum FOUR = LeafIdentifierEnum::FOUR; - static constexpr LeafIdentifierEnum FIVE = LeafIdentifierEnum::FIVE; - static constexpr LeafIdentifierEnum SIX = LeafIdentifierEnum::SIX; - static constexpr LeafIdentifierEnum SEVEN = LeafIdentifierEnum::SEVEN; -#endif /** * Returns the value of the specified Child for this OctreeNode diff --git a/Modules/Core/Common/include/itkOrientationAdapterBase.h b/Modules/Core/Common/include/itkOrientationAdapterBase.h index 30f47b3b0b8..3caa5cf1396 100644 --- a/Modules/Core/Common/include/itkOrientationAdapterBase.h +++ b/Modules/Core/Common/include/itkOrientationAdapterBase.h @@ -28,44 +28,6 @@ #ifndef itkOrientationAdapterBase_h #define itkOrientationAdapterBase_h -#if !defined(ITK_LEGACY_REMOVE) -# include "itkImageBase.h" - -namespace itk -{ -/** \class OrientationAdapterBase - * \brief base class that converts Orientation representations to direction cosines. - * - * OrientationAdapterBase is a pure virtual base class that defines the - * member function signatures for any subclass that concretely defines the - * conversion relation between a method of representing orientation, and the - * direction cosines managed in itk::ImageBase. - * \ingroup ITKCommon - */ -template -class ITK_TEMPLATE_EXPORT [[deprecated("Since ITK 5.3 use SpatialOrientationAdapter.")]] OrientationAdapterBase -{ -public: - /** type alias for matching ImageBase */ - using ImageType = ImageBase; - - /** type alias for matching Direction Cosines type */ - using DirectionType = typename ImageType::DirectionType; - - /** Convert direction cosines to the Orientation type */ - virtual OrientationType FromDirectionCosines(const DirectionType & Dir) = 0; - - /** Convert Orientation type direction cosines */ - 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 +#error itkOrientationAdapterBase.h is a legacy file since ITK 5.3 and is removed in the ITKv6. #endif // itkOrientationAdapterBase_h diff --git a/Modules/Core/Common/include/itkPlatformMultiThreader.h b/Modules/Core/Common/include/itkPlatformMultiThreader.h index a03678e8f79..78357347b27 100644 --- a/Modules/Core/Common/include/itkPlatformMultiThreader.h +++ b/Modules/Core/Common/include/itkPlatformMultiThreader.h @@ -64,43 +64,6 @@ class ITKCommon_EXPORT PlatformMultiThreader : public MultiThreaderBase /** \see LightObject::GetNameOfClass() */ itkOverrideGetNameOfClassMacro(PlatformMultiThreader); -#if !defined(ITK_LEGACY_REMOVE) - /** Set/Get the maximum number of threads to use when multithreading. It - * will be clamped to the range [ 1, ITK_MAX_THREADS ] because several arrays - * are already statically allocated using the ITK_MAX_THREADS number. - * Therefore the caller of this method should check that the requested number - * of threads was accepted. Legacy: use MultiThreaderBase to invoke these. */ - itkLegacyMacro(static void SetGlobalMaximumNumberOfThreads(ThreadIdType val)) - { - itkGenericOutputMacro("Warning: SetGlobalMaximumNumberOfThreads should now be called on itk::MultiThreaderBase. It " - "can affect all MultiThreaderBase's derived classes in ITK"); - Superclass::SetGlobalMaximumNumberOfThreads(val); - } - itkLegacyMacro(static ThreadIdType GetGlobalMaximumNumberOfThreads()) - { - itkGenericOutputMacro("Warning: GetGlobalMaximumNumberOfThreads should now be called on itk::MultiThreaderBase. It " - "can affect all MultiThreaderBase's derived classes in ITK"); - return Superclass::GetGlobalMaximumNumberOfThreads(); - } - - /** Set/Get the value which is used to initialize the NumberOfThreads in the - * constructor. It will be clamped to the range [1, m_GlobalMaximumNumberOfThreads ]. - * Therefore the caller of this method should check that the requested number - * of threads was accepted. Legacy: use MultiThreaderBase to invoke these. */ - itkLegacyMacro(static void SetGlobalDefaultNumberOfThreads(ThreadIdType val)) - { - itkGenericOutputMacro("Warning: SetGlobalDefaultNumberOfThreads should now be called on itk::MultiThreaderBase. It " - "can affect all MultiThreaderBase's derived classes in ITK"); - Superclass::SetGlobalDefaultNumberOfThreads(val); - } - itkLegacyMacro(static ThreadIdType GetGlobalDefaultNumberOfThreads()) - { - itkGenericOutputMacro("Warning: GetGlobalDefaultNumberOfThreads should now be called on itk::MultiThreaderBase. It " - "can affect all MultiThreaderBase's derived classes in ITK"); - return Superclass::GetGlobalDefaultNumberOfThreads(); - } -#endif - /** Execute the SingleMethod (as define by SetSingleMethod) using * m_NumberOfWorkUnits threads. As a side effect the m_NumberOfWorkUnits will be * checked against the current m_GlobalMaximumNumberOfThreads and clamped if @@ -166,14 +129,6 @@ class ITKCommon_EXPORT PlatformMultiThreader : public MultiThreaderBase ThreadProcessIdType m_SpawnedThreadProcessID[ITK_MAX_THREADS]{}; WorkUnitInfo m_SpawnedThreadInfoArray[ITK_MAX_THREADS]{}; -#if !defined(ITK_LEGACY_REMOVE) - /** The methods to invoke. */ - ThreadFunctionType m_MultipleMethod[ITK_MAX_THREADS]{}; - - /** Internal storage of the data. */ - void * m_MultipleData[ITK_MAX_THREADS]{}; -#endif - /** spawn a new thread for the SingleMethod */ ThreadProcessIdType SpawnDispatchSingleMethodThread(WorkUnitInfo *); diff --git a/Modules/Core/Common/include/itkPoint.h b/Modules/Core/Common/include/itkPoint.h index acce71b6565..3e5b197d0a4 100644 --- a/Modules/Core/Common/include/itkPoint.h +++ b/Modules/Core/Common/include/itkPoint.h @@ -100,7 +100,6 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray : BaseArray(r) {} -#if defined(ITK_LEGACY_REMOVE) /** Prevents copy-initialization from `nullptr`, as well as from `0` (NULL). */ Point(std::nullptr_t) = delete; @@ -112,17 +111,6 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray explicit Point(const ValueType & v) : BaseArray(v) {} -#else - /** Pass-through constructors for single values - * \note ITK_LEGACY_REMOVE=ON will disallow implicit conversion from a single value. */ - template - Point(const TPointValueType & v) - : BaseArray(v) - {} - Point(const ValueType & v) - : BaseArray(v) - {} -#endif /** Explicit constructor for std::array. */ explicit Point(const std::array & stdArray) diff --git a/Modules/Core/Common/include/itkProcessObject.h b/Modules/Core/Common/include/itkProcessObject.h index 80f6630b2f9..43cfc371c24 100644 --- a/Modules/Core/Common/include/itkProcessObject.h +++ b/Modules/Core/Common/include/itkProcessObject.h @@ -301,22 +301,6 @@ class ITKCommon_EXPORT ProcessObject : public Object /** \brief Turn on and off the AbortGenerateData flag. */ itkBooleanMacro(AbortGenerateData); - /** \deprecated - * Set the execution progress of a process object. The progress is - * a floating number in [0,1] with 0 meaning no progress and 1 meaning - * the filter has completed execution. The ProgressEvent is NOT - * invoked. - * This method is deprecated because filters should not be calling - * SetProgress directly but should be using UpdateProgress or IncrementProgress instead. - */ -#if !defined(ITK_LEGACY_REMOVE) - void - SetProgress(float progress) - { - m_Progress = progressFloatToFixed(progress); - } -#endif - /** \brief Get the execution progress of a process object. * * The progress is a floating number in [0,1] with 0 meaning no @@ -494,12 +478,6 @@ class ITKCommon_EXPORT ProcessObject : public Object itkSetClampMacro(NumberOfWorkUnits, ThreadIdType, 1, ITK_MAX_THREADS); itkGetConstReferenceMacro(NumberOfWorkUnits, ThreadIdType); -#if !defined(ITK_LEGACY_REMOVE) || defined(ITKV4_COMPATIBILITY) - itkLegacyMacro(void SetNumberOfThreads(ThreadIdType count)) { this->SetNumberOfWorkUnits(count); } - - itkLegacyMacro(ThreadIdType GetNumberOfThreads() const) { return this->GetNumberOfWorkUnits(); } -#endif // !ITK_LEGACY_REMOVE - /** Return the multithreader used by this class. */ MultiThreaderType * GetMultiThreader() const @@ -788,7 +766,7 @@ class ITKCommon_EXPORT ProcessObject : public Object * */ virtual void - VerifyPreconditions() ITKv5_CONST; + VerifyPreconditions() const; /** \brief Verifies that the inputs meta-data is consistent and valid * for continued execution of the pipeline, throws an exception if @@ -801,7 +779,7 @@ class ITKCommon_EXPORT ProcessObject : public Object * */ virtual void - VerifyInputInformation() ITKv5_CONST; + VerifyInputInformation() const; /** What is the input requested region that is required to produce the * output requested region? By default, the largest possible region is diff --git a/Modules/Core/Common/include/itkProgressAccumulator.h b/Modules/Core/Common/include/itkProgressAccumulator.h index e8dedb84f1f..73e8d6fd50c 100644 --- a/Modules/Core/Common/include/itkProgressAccumulator.h +++ b/Modules/Core/Common/include/itkProgressAccumulator.h @@ -87,34 +87,6 @@ class ITKCommon_EXPORT ProgressAccumulator : public Object void UnregisterAllFilters(); - /** - * \deprecated - * Reset the progress accumulator. This method should not be necessary - * because this functionality is already present in the filter - * constructor. - */ -#if !defined(ITK_LEGACY_REMOVE) - void - ResetProgress(); -#endif - - /** - * \deprecated - * Reset the filter progress but keep the accumulated progress. - * This method is deprecated because the ProgressAccumulator - * now internally checks if a filter has been restarted and updates - * the accumulated progress automatically. - * This method also used to have the unfortunate side effect of forcing - * filters to rerun even if their parameters and input had not changed. - * This is because it called SetProgress(0) on the filters, which - * triggered a ModifiedTime and thus caused the filters to rerun. - * To avoid this behavior, the implementation of this method is now empty. - */ -#if !defined(ITK_LEGACY_REMOVE) - void - ResetFilterProgressAndKeepAccumulatedProgress(); -#endif - protected: ProgressAccumulator(); ~ProgressAccumulator() override; diff --git a/Modules/Core/Common/include/itkRGBAPixel.h b/Modules/Core/Common/include/itkRGBAPixel.h index 65205478704..a37de884e1a 100644 --- a/Modules/Core/Common/include/itkRGBAPixel.h +++ b/Modules/Core/Common/include/itkRGBAPixel.h @@ -78,11 +78,7 @@ class ITK_TEMPLATE_EXPORT RGBAPixel : public FixedArray /** Default-constructor. * \note The other five "special member functions" are defaulted implicitly, following the C++ "Rule of Zero". */ -#ifdef ITK_FUTURE_LEGACY_REMOVE RGBAPixel() = default; -#else - RGBAPixel() { this->Fill(0); } -#endif /** Pass-through constructor for the Array base class. */ template @@ -93,15 +89,11 @@ class ITK_TEMPLATE_EXPORT RGBAPixel : public FixedArray : BaseArray(r) {} -#if defined(ITK_LEGACY_REMOVE) /** Prevents copy-initialization from `nullptr`, as well as from `0` (NULL). */ RGBAPixel(std::nullptr_t) = delete; /** Explicit constructor */ explicit RGBAPixel(const ComponentType & r) { this->Fill(r); } -#else - RGBAPixel(const ComponentType & r) { this->Fill(r); } -#endif /** Pass-through assignment operator for the Array base class. */ RGBAPixel & diff --git a/Modules/Core/Common/include/itkRGBPixel.h b/Modules/Core/Common/include/itkRGBPixel.h index 643024b15ad..dcbad884f5f 100644 --- a/Modules/Core/Common/include/itkRGBPixel.h +++ b/Modules/Core/Common/include/itkRGBPixel.h @@ -77,23 +77,13 @@ class ITK_TEMPLATE_EXPORT RGBPixel : public FixedArray /** Default-constructor. * \note The other five "special member functions" are defaulted implicitly, following the C++ "Rule of Zero". */ -#ifdef ITK_FUTURE_LEGACY_REMOVE RGBPixel() = default; -#else - RGBPixel() { this->Fill(0); } -#endif -#if defined(ITK_LEGACY_REMOVE) /** Explicit constructor to fill Red=Blue=Green= r. */ explicit RGBPixel(const ComponentType & r) { this->Fill(r); } /** Prevents copy-initialization from `nullptr`, as well as from `0` (NULL). */ RGBPixel(std::nullptr_t) = delete; -#else - /** Constructor to fill Red=Blue=Green= r. - * \note ITK_LEGACY_REMOVE=ON will disallow implicit conversion from a component value. */ - RGBPixel(const ComponentType & r) { this->Fill(r); } -#endif /** Pass-through constructor for the Array base class. */ template diff --git a/Modules/Core/Common/include/itkRegion.h b/Modules/Core/Common/include/itkRegion.h index 1614cc80be9..8d4dfd96d4b 100644 --- a/Modules/Core/Common/include/itkRegion.h +++ b/Modules/Core/Common/include/itkRegion.h @@ -71,11 +71,6 @@ class ITKCommon_EXPORT Region using Self = Region; using RegionEnum = ObjectEnums::RegionEnum; -#if !defined(ITK_LEGACY_REMOVE) - /**Exposes enums values for backwards compatibility*/ - static constexpr RegionEnum ITK_UNSTRUCTURED_REGION = RegionEnum::ITK_UNSTRUCTURED_REGION; - static constexpr RegionEnum ITK_STRUCTURED_REGION = RegionEnum::ITK_STRUCTURED_REGION; -#endif /** \see LightObject::GetNameOfClass() */ itkVirtualGetNameOfClassMacro(Region); diff --git a/Modules/Core/Common/include/itkShapedNeighborhoodIterator.h b/Modules/Core/Common/include/itkShapedNeighborhoodIterator.h index 9f24917141d..f2bcf60d4e1 100644 --- a/Modules/Core/Common/include/itkShapedNeighborhoodIterator.h +++ b/Modules/Core/Common/include/itkShapedNeighborhoodIterator.h @@ -186,7 +186,7 @@ class ITK_TEMPLATE_EXPORT ShapedNeighborhoodIterator : ConstIterator(s) {} - ~Iterator() ITK_ITERATOR_OVERRIDE = default; + ~Iterator() override = default; Iterator & operator=(const Iterator & o) { diff --git a/Modules/Core/Common/include/itkSingleton.h b/Modules/Core/Common/include/itkSingleton.h index a0847f87323..f3bc99fd25d 100644 --- a/Modules/Core/Common/include/itkSingleton.h +++ b/Modules/Core/Common/include/itkSingleton.h @@ -23,7 +23,7 @@ #include #include -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE /** \brief A function which does nothing * \deprecated Preferably use the C++ `[[maybe_unused]]` attribute instead! * @@ -50,12 +50,6 @@ class ITKCommon_EXPORT SingletonIndex /** Standard class types. */ using Self = SingletonIndex; -#ifndef ITK_LEGACY_REMOVE - using SingletonData [[deprecated("The internal representation of the singleton data is private, and may not " - "correspond with SingletonData anymore.")]] = - std::map, std::function>>; -#endif - // obtain a global registered in the singleton index under the // globalName, if unknown then nullptr will be returned. template @@ -75,7 +69,7 @@ class ITKCommon_EXPORT SingletonIndex this->SetGlobalInstancePrivate(globalName, GlobalObject{ global, std::move(deleteFunc) }); } -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE template [[deprecated("Prefer calling the SetGlobalInstance(globalName, global, deleteFunc) overload (without the unused func " "parameter)!")]] bool @@ -145,7 +139,7 @@ Singleton(const char * globalName, std::function deleteFunc) } -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE template [[deprecated("Prefer calling the Singleton(globalName, deleteFunc) overload (without the unused func parameter)!")]] T * Singleton(const char * globalName, std::function itkNotUsed(func), std::function deleteFunc) diff --git a/Modules/Core/Common/include/itkSmartPointer.h b/Modules/Core/Common/include/itkSmartPointer.h index 6ed775ac68a..1511acd912d 100644 --- a/Modules/Core/Common/include/itkSmartPointer.h +++ b/Modules/Core/Common/include/itkSmartPointer.h @@ -183,14 +183,6 @@ class SmartPointer return m_Pointer; } -#if !defined(ITK_LEGACY_REMOVE) - void - swap(SmartPointer & other) noexcept - { - this->Swap(other); - } -#endif - void Swap(SmartPointer & other) noexcept { diff --git a/Modules/Core/Common/include/itkSpatialOrientation.h b/Modules/Core/Common/include/itkSpatialOrientation.h index 50d345f491e..65c22d53431 100644 --- a/Modules/Core/Common/include/itkSpatialOrientation.h +++ b/Modules/Core/Common/include/itkSpatialOrientation.h @@ -462,136 +462,6 @@ extern ITKCommon_EXPORT std::ostream & operator<<(std::ostream & out, const SpatialOrientationEnums::CoordinateMajornessTerms value); extern ITKCommon_EXPORT std::ostream & operator<<(std::ostream & out, const SpatialOrientationEnums::ValidCoordinateOrientations value); - -#ifndef ITK_LEGACY_REMOVE -namespace SpatialOrientation -{ - -using CoordinateTerms = SpatialOrientationEnums::CoordinateTerms; - -static constexpr CoordinateTerms ITK_COORDINATE_UNKNOWN = CoordinateTerms::ITK_COORDINATE_UNKNOWN; -static constexpr CoordinateTerms ITK_COORDINATE_Right = CoordinateTerms::ITK_COORDINATE_Right; -static constexpr CoordinateTerms ITK_COORDINATE_Left = CoordinateTerms::ITK_COORDINATE_Left; -static constexpr CoordinateTerms ITK_COORDINATE_Posterior = CoordinateTerms::ITK_COORDINATE_Posterior; -static constexpr CoordinateTerms ITK_COORDINATE_Anterior = CoordinateTerms::ITK_COORDINATE_Anterior; -static constexpr CoordinateTerms ITK_COORDINATE_Inferior = CoordinateTerms::ITK_COORDINATE_Inferior; -static constexpr CoordinateTerms ITK_COORDINATE_Superior = CoordinateTerms::ITK_COORDINATE_Superior; - -using CoordinateMajornessTerms = SpatialOrientationEnums::CoordinateMajornessTerms; - -static constexpr CoordinateMajornessTerms ITK_COORDINATE_PrimaryMinor = - CoordinateMajornessTerms::ITK_COORDINATE_PrimaryMinor; -static constexpr CoordinateMajornessTerms ITK_COORDINATE_SecondaryMinor = - CoordinateMajornessTerms::ITK_COORDINATE_SecondaryMinor; -static constexpr CoordinateMajornessTerms ITK_COORDINATE_TertiaryMinor = - CoordinateMajornessTerms::ITK_COORDINATE_TertiaryMinor; - -using ValidCoordinateOrientationFlags = SpatialOrientationEnums::ValidCoordinateOrientations; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RIP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RIP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LIP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LIP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RSP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RSP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LSP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LSP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RIA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RIA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LIA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LIA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RSA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RSA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LSA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LSA; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IRP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IRP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ILP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ILP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SRP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SRP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SLP = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SLP; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IRA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IRA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ILA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ILA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SRA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SRA; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SLA = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SLA; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RPI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RPI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LPI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LPI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RAI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RAI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LAI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LAI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RPS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RPS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LPS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LPS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_RAS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_RAS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_LAS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_LAS; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PRI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PRI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PLI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PLI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ARI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ARI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ALI = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ALI; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PRS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PRS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PLS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PLS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ARS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ARS; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ALS = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ALS; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IPR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IPR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SPR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SPR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IAR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IAR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SAR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SAR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IPL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IPL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SPL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SPL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_IAL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_IAL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_SAL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_SAL; - -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PIR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PIR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PSR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PSR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_AIR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_AIR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ASR = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ASR; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PIL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PIL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_PSL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_PSL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_AIL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_AIL; -static constexpr ValidCoordinateOrientationFlags ITK_COORDINATE_ORIENTATION_ASL = - ValidCoordinateOrientationFlags::ITK_COORDINATE_ORIENTATION_ASL; - -} // end of namespace SpatialOrientation -#endif // !ITK_LEGACY_REMOVE } // end namespace itk #endif diff --git a/Modules/Core/Common/include/itkStaticAssert.h b/Modules/Core/Common/include/itkStaticAssert.h index 83fbbda022c..f93c2b42db9 100644 --- a/Modules/Core/Common/include/itkStaticAssert.h +++ b/Modules/Core/Common/include/itkStaticAssert.h @@ -19,19 +19,8 @@ #ifndef itkStaticAssert_h #define itkStaticAssert_h -#include "itkMacro.h" - -#if !defined(ITK_LEGACY_REMOVE) -/** Static assertion. - * This macro will use C++11 \c static_assert() keyword. - * \param expr compile-time expression to check - * \param str string literal that will appear as compiler error if \c expr is \c false. - * \ingroup ITKCommon - */ -# define itkStaticAssert(expr, str) static_assert(expr, str) -#else -# define itkStaticAssert(expr, str) Use C++ 11 static_assert directly -#endif +// This is no longer needed as C++11 provides this support directly +#define itkStaticAssert(expr, str) static_assert(false, "Use C++ 11 static_assert directly") // TODO: remove this file entirely in the future (e.g. with ITKv6) diff --git a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h index ff6d65f46e8..c1446c81b57 100644 --- a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h +++ b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h @@ -156,13 +156,6 @@ Int2EigenValueOrderEnum(const uint8_t value) itkGenericExceptionMacro("Error: Invalid value for conversion."); } -#if !defined(ITK_LEGACY_REMOVE) -/** Enables reverse compatibility for enumeration values */ -static constexpr EigenValueOrderEnum OrderByValue = EigenValueOrderEnum::OrderByValue; -static constexpr EigenValueOrderEnum OrderByMagnitude = EigenValueOrderEnum::OrderByMagnitude; -static constexpr EigenValueOrderEnum DoNotOrder = EigenValueOrderEnum::DoNotOrder; -#endif - /** \class SymmetricEigenAnalysis * \brief Find Eigen values of a real 2D symmetric matrix. It * serves as a thread-safe alternative to the class: @@ -203,10 +196,6 @@ class ITK_TEMPLATE_EXPORT SymmetricEigenAnalysis { public: using EigenValueOrderEnum = itk::EigenValueOrderEnum; -#if !defined(ITK_LEGACY_REMOVE) - /** Enables reverse compatibility for enumeration values */ - using EigenValueOrderType = EigenValueOrderEnum; -#endif SymmetricEigenAnalysis() = default; @@ -752,18 +741,6 @@ template Fill(0); } diff --git a/Modules/Core/Common/include/itkThreadSupport.h b/Modules/Core/Common/include/itkThreadSupport.h index 467ced7a418..126129f997e 100644 --- a/Modules/Core/Common/include/itkThreadSupport.h +++ b/Modules/Core/Common/include/itkThreadSupport.h @@ -50,7 +50,7 @@ using MutexType = pthread_mutex_t; using FastMutexType = pthread_mutex_t; using ThreadFunctionType = void * (*)(void *); using ThreadProcessIdType = pthread_t; -# if !defined(ITK_FUTURE_LEGACY_REMOVE) +# if !defined(ITK_LEGACY_REMOVE) constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = 0; # endif using ITK_THREAD_RETURN_TYPE = void *; @@ -65,7 +65,7 @@ using MutexType = HANDLE; using FastMutexType = CRITICAL_SECTION; using ThreadFunctionType = unsigned int(__stdcall *)(void *); using ThreadProcessIdType = HANDLE; -# if !defined(ITK_FUTURE_LEGACY_REMOVE) +# if !defined(ITK_LEGACY_REMOVE) static const ThreadProcessIdType ITK_DEFAULT_THREAD_ID = INVALID_HANDLE_VALUE; # endif using ITK_THREAD_RETURN_TYPE = unsigned int; @@ -80,7 +80,7 @@ using MutexType = int; using FastMutexType = int; using ThreadFunctionType = void (*)(void *); using ThreadProcessIdType = int; -# if !defined(ITK_FUTURE_LEGACY_REMOVE) +# if !defined(ITK_LEGACY_REMOVE) constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = 0; # endif using ITK_THREAD_RETURN_TYPE = void; @@ -129,7 +129,7 @@ using itk::ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION; #endif // For backwards compatibility -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) using itk::ITK_MAX_THREADS; using itk::ITK_DEFAULT_THREAD_ID; #endif diff --git a/Modules/Core/Common/include/itkVector.h b/Modules/Core/Common/include/itkVector.h index 8a5e1cdf8af..63994c42d82 100644 --- a/Modules/Core/Common/include/itkVector.h +++ b/Modules/Core/Common/include/itkVector.h @@ -107,20 +107,12 @@ class ITK_TEMPLATE_EXPORT Vector : public FixedArray * \note The other five "special member functions" are defaulted implicitly, following the C++ "Rule of Zero". */ Vector() = default; -#if !defined(ITK_LEGACY_REMOVE) - /** Constructor to initialize entire vector to one value. - * \warning Not intended to convert a scalar value into - * a Vector filled with that value. - * \deprecated */ - Vector(const ValueType & r); -#else /** Constructor to initialize entire vector to one value, * if explicitly invoked. */ explicit Vector(const ValueType & r); /** Prevents copy-initialization from `nullptr`, as well as from `0` (NULL). */ Vector(std::nullptr_t) = delete; -#endif /** Pass-through constructor for the Array base class. */ template diff --git a/Modules/Core/Common/src/itkConfigure.h.in b/Modules/Core/Common/src/itkConfigure.h.in index a427cddb588..025d8a64088 100644 --- a/Modules/Core/Common/src/itkConfigure.h.in +++ b/Modules/Core/Common/src/itkConfigure.h.in @@ -71,7 +71,6 @@ #endif #cmakedefine ITK_DYNAMIC_LOADING -#cmakedefine ITKV4_COMPATIBILITY #cmakedefine ITK_LEGACY_REMOVE #cmakedefine ITK_LEGACY_SILENT #cmakedefine ITK_FUTURE_LEGACY_REMOVE diff --git a/Modules/Core/Common/src/itkPoolMultiThreader.cxx b/Modules/Core/Common/src/itkPoolMultiThreader.cxx index 5e829449859..1673f1bd73f 100644 --- a/Modules/Core/Common/src/itkPoolMultiThreader.cxx +++ b/Modules/Core/Common/src/itkPoolMultiThreader.cxx @@ -86,12 +86,6 @@ PoolMultiThreader::PoolMultiThreader() } ThreadIdType defaultThreads = std::max(1u, GetGlobalDefaultNumberOfThreads()); -#if !defined(ITKV4_COMPATIBILITY) - if (defaultThreads > 1) // one work unit for only one thread - { - defaultThreads *= 4; - } -#endif m_NumberOfWorkUnits = std::min(ITK_MAX_THREADS, defaultThreads); m_MaximumNumberOfThreads = m_ThreadPool->GetMaximumNumberOfThreads(); } diff --git a/Modules/Core/Common/src/itkProcessObject.cxx b/Modules/Core/Common/src/itkProcessObject.cxx index 27149b018a7..42fe97c8f06 100644 --- a/Modules/Core/Common/src/itkProcessObject.cxx +++ b/Modules/Core/Common/src/itkProcessObject.cxx @@ -1327,7 +1327,7 @@ ProcessObject::PropagateResetPipeline() void -ProcessObject::VerifyPreconditions() ITKv5_CONST +ProcessObject::VerifyPreconditions() const { /** * Make sure that all the required named inputs are there and non null @@ -1356,7 +1356,7 @@ ProcessObject::VerifyPreconditions() ITKv5_CONST void -ProcessObject::VerifyInputInformation() ITKv5_CONST +ProcessObject::VerifyInputInformation() const {} diff --git a/Modules/Core/Common/src/itkTBBMultiThreader.cxx b/Modules/Core/Common/src/itkTBBMultiThreader.cxx index 8fa18d81a56..7c49cac55e4 100644 --- a/Modules/Core/Common/src/itkTBBMultiThreader.cxx +++ b/Modules/Core/Common/src/itkTBBMultiThreader.cxx @@ -47,14 +47,10 @@ namespace itk TBBMultiThreader::TBBMultiThreader() { ThreadIdType defaultThreads = std::max(1u, GetGlobalDefaultNumberOfThreads()); -#if defined(ITKV4_COMPATIBILITY) - m_NumberOfWorkUnits = defaultThreads; -#else if (defaultThreads > 1) // one work unit for only one thread { m_NumberOfWorkUnits = 16 * defaultThreads; } -#endif } TBBMultiThreader::~TBBMultiThreader() = default; diff --git a/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h b/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h index 8e8879244c1..a5306517fb5 100644 --- a/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h +++ b/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h @@ -271,7 +271,7 @@ class ITK_TEMPLATE_EXPORT ImageAdaptor : public ImageBase(this->GetInputImage()->GetPixel(index))); } -/** Get the radius required for interpolation. - * - * This defines the number of surrounding pixels required to interpolate at - * a given point. - */ -#if defined(ITKV4_COMPATIBILITY) - virtual SizeType - GetRadius() const - { - // if ITKv4 compatibility is enabled then set the radius to the - // largest by default. - const InputImageType * input = this->GetInputImage(); - if (!input) - { - itkExceptionMacro("Input image required!"); - } - return input->GetLargestPossibleRegion().GetSize(); - } -#else + /** Get the radius required for interpolation. + * + * This defines the number of surrounding pixels required to interpolate at + * a given point. + */ virtual SizeType GetRadius() const = 0; -#endif protected: InterpolateImageFunction() = default; diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.h index 592f607c314..9f34efdd366 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.h @@ -152,7 +152,7 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMesh : public Mesh; using EdgeListType = std::list; -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE using EdgeListPointerType [[deprecated("Please just use `EdgeListType *` instead!")]] = EdgeListType *; #endif using MeshClassCellsAllocationMethodEnum = itk::MeshEnums::MeshClassCellsAllocationMethod; diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObject.h b/Modules/Core/SpatialObjects/include/itkSpatialObject.h index 063aa62fc39..b0917b4fb42 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/itkSpatialObject.h @@ -324,7 +324,7 @@ class ITK_TEMPLATE_EXPORT SpatialObject : public DataObject * `SetObjectToWorldTransform(transform)` * \note This member function is not meant to be overridden. In the future, it may not be declared `virtual` anymore. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual #endif bool @@ -339,7 +339,7 @@ class ITK_TEMPLATE_EXPORT SpatialObject : public DataObject * `SetObjectToWorldTransform(transform)` * \note This member function is not meant to be overridden. In the future, it may not be declared `virtual` anymore. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual #endif bool @@ -356,7 +356,7 @@ class ITK_TEMPLATE_EXPORT SpatialObject : public DataObject * `SetObjectToWorldTransform(transform)` * \note This member function is not meant to be overridden. In the future, it may not be declared `virtual` anymore. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual #endif bool @@ -378,7 +378,7 @@ class ITK_TEMPLATE_EXPORT SpatialObject : public DataObject * `SetObjectToWorldTransform(transform)` * \note This member function is not meant to be overridden. In the future, it may not be declared `virtual` anymore. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual #endif void diff --git a/Modules/Core/TestKernel/include/itkTestingComparisonImageFilter.h b/Modules/Core/TestKernel/include/itkTestingComparisonImageFilter.h index 00470a1ae27..8c1e550386b 100644 --- a/Modules/Core/TestKernel/include/itkTestingComparisonImageFilter.h +++ b/Modules/Core/TestKernel/include/itkTestingComparisonImageFilter.h @@ -135,7 +135,7 @@ class ITK_TEMPLATE_EXPORT ComparisonImageFilter : public ImageToImageFilter::AfterThreadedGenerateData() template void -ComparisonImageFilter::VerifyInputInformation() ITKv5_CONST +ComparisonImageFilter::VerifyInputInformation() const { if (m_VerifyInputInformation) { diff --git a/Modules/Core/TestKernel/include/itkTestingMacros.h b/Modules/Core/TestKernel/include/itkTestingMacros.h index 1d7d3a10721..81eb637ef44 100644 --- a/Modules/Core/TestKernel/include/itkTestingMacros.h +++ b/Modules/Core/TestKernel/include/itkTestingMacros.h @@ -35,47 +35,20 @@ namespace itk // DEPRECATED: These macros are left here for compatibility. // In the future, they will be removed in favor of the "ITK_" prefixed // versions. -#if defined(ITK_FUTURE_LEGACY_REMOVE) +#define EXERCISE_BASIC_OBJECT_METHODS \ + static_assert(false, "Replace EXERCISE_BASIC_OBJECT_METHODS with ITK_EXERCISE_BASIC_OBJECT_METHODS") +#define TRY_EXPECT_EXCEPTION static_assert(false, "Replace TRY_EXPECT_EXCEPTION with ITK_TRY_EXPECT_EXCEPTION") +#define TRY_EXPECT_NO_EXCEPTION static_assert(fasle, "Replace TRY_EXPECT_NO_EXCEPTION with ITK_TRY_EXPECT_NO_EXCEPTION") +#define TEST_EXPECT_TRUE_STATUS_VALUE \ + static_assert(false, "Replace TEST_EXPECT_TRUE_STATUS_VALUE with ITK_TEST_EXPECT_TRUE_STATUS_VALUE") +#define TEST_EXPECT_TRUE static_assert(false, "Replace TEST_EXPECT_TRUE with ITK_TEST_EXPECT_TRUE") +#define TEST_EXPECT_EQUAL_STATUS_VALUE "Replace TEST_EXPECT_EQUAL_STATUS_VALUE with ITK_TEST_EXPECT_EQUAL_STATUS_VALUE" +#define TEST_EXPECT_EQUAL static_assert(false, "Replace TEST_EXPECT_EQUAL with ITK_TEST_EXPECT_EQUAL") +#define TEST_SET_GET static_assert(false, "Replace TEST_SET_GET with ITK_TEST_SET_GET") +#define TEST_SET_GET_VALUE static_assert(false, "Replace TEST_SET_GET_VALUE with ITK_TEST_SET_GET_VALUE") +#define TEST_SET_GET_NULL_VALUE static_assert(false, "Replace TEST_SET_GET_NULL_VALUE with ITK_TEST_SET_GET_NULL_VALUE") +#define TEST_SET_GET_BOOLEAN static_assert(false, "Replace TEST_SET_GET_BOOLEAN with ITK_TEST_SET_GET_BOOLEAN") -# if defined(__clang__) || defined(__GNUC__) -# pragma GCC poison EXERCISE_BASIC_OBJECT_METHODS -# pragma GCC poison TRY_EXPECT_EXCEPTION -# pragma GCC poison TRY_EXPECT_NO_EXCEPTION -# pragma GCC poison TEST_EXPECT_TRUE_STATUS_VALUE -# pragma GCC poison TEST_EXPECT_TRUE -# pragma GCC poison TEST_EXPECT_EQUAL_STATUS_VALUE -# pragma GCC poison TEST_EXPECT_EQUAL -# pragma GCC poison TEST_SET_GET -# pragma GCC poison TEST_SET_GET_VALUE -# pragma GCC poison TEST_SET_GET_NULL_VALUE -# pragma GCC poison TEST_SET_GET_BOOLEAN -# else -# define EXERCISE_BASIC_OBJECT_METHODS "Replace EXERCISE_BASIC_OBJECT_METHODS with ITK_EXERCISE_BASIC_OBJECT_METHODS" -# define TRY_EXPECT_EXCEPTION "Replace TRY_EXPECT_EXCEPTION with ITK_TRY_EXPECT_EXCEPTION" -# define TRY_EXPECT_NO_EXCEPTION "Replace TRY_EXPECT_NO_EXCEPTION with ITK_TRY_EXPECT_NO_EXCEPTION" -# define TEST_EXPECT_TRUE_STATUS_VALUE "Replace TEST_EXPECT_TRUE_STATUS_VALUE with ITK_TEST_EXPECT_TRUE_STATUS_VALUE" -# define TEST_EXPECT_TRUE "Replace TEST_EXPECT_TRUE with ITK_TEST_EXPECT_TRUE" -# define TEST_EXPECT_EQUAL_STATUS_VALUE \ - "Replace TEST_EXPECT_EQUAL_STATUS_VALUE with ITK_TEST_EXPECT_EQUAL_STATUS_VALUE" -# define TEST_EXPECT_EQUAL "Replace TEST_EXPECT_EQUAL with ITK_TEST_EXPECT_EQUAL" -# define TEST_SET_GET "Replace TEST_SET_GET with ITK_TEST_SET_GET" -# define TEST_SET_GET_VALUE "Replace TEST_SET_GET_VALUE with ITK_TEST_SET_GET_VALUE" -# define TEST_SET_GET_NULL_VALUE "Replace TEST_SET_GET_NULL_VALUE with ITK_TEST_SET_GET_NULL_VALUE" -# define TEST_SET_GET_BOOLEAN "Replace TEST_SET_GET_BOOLEAN with ITK_TEST_SET_GET_BOOLEAN" -# endif -#else -# define EXERCISE_BASIC_OBJECT_METHODS ITK_EXERCISE_BASIC_OBJECT_METHODS -# define TRY_EXPECT_EXCEPTION ITK_TRY_EXPECT_EXCEPTION -# define TRY_EXPECT_NO_EXCEPTION ITK_TRY_EXPECT_NO_EXCEPTION -# define TEST_EXPECT_TRUE_STATUS_VALUE ITK_TEST_EXPECT_TRUE_STATUS_VALUE -# define TEST_EXPECT_TRUE ITK_TEST_EXPECT_TRUE -# define TEST_EXPECT_EQUAL_STATUS_VALUE ITK_TEST_EXPECT_EQUAL_STATUS_VALUE -# define TEST_EXPECT_EQUAL ITK_TEST_EXPECT_EQUAL -# define TEST_SET_GET ITK_TEST_SET_GET -# define TEST_SET_GET_VALUE ITK_TEST_SET_GET_VALUE -# define TEST_SET_GET_NULL_VALUE ITK_TEST_SET_GET_NULL_VALUE -# define TEST_SET_GET_BOOLEAN ITK_TEST_SET_GET_BOOLEAN -#endif /* clang-format off */ #if defined(__GNUC__) diff --git a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.h b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.h index f174a3cb5ff..eb4b3737acb 100644 --- a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.h +++ b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.h @@ -155,7 +155,7 @@ class ITK_TEMPLATE_EXPORT TransformGeometryImageFilter : public InPlaceImageFilt GenerateOutputInformation() override; void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; void GenerateData() override; diff --git a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx index 75d73d63f30..924060ff7d4 100644 --- a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx +++ b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx @@ -36,7 +36,7 @@ TransformGeometryImageFilter::TransformGeometryImageF template void -TransformGeometryImageFilter::VerifyPreconditions() ITKv5_CONST +TransformGeometryImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h index 9ffdb5e605a..e4bca732f18 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h @@ -89,7 +89,7 @@ class ITK_TEMPLATE_EXPORT ConvolutionImageFilterBase : public ImageToImageFilter /** Typedef to describe the boundary condition. */ using BoundaryConditionType = ImageBoundaryCondition; -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE using BoundaryConditionPointerType [[deprecated("Please just use `BoundaryConditionType *` instead!")]] = BoundaryConditionType *; #endif @@ -154,7 +154,7 @@ class ITK_TEMPLATE_EXPORT ConvolutionImageFilterBase : public ImageToImageFilter /** Default superclass implementation ensures that input images * occupy same physical space. This is not needed for this filter. */ void - VerifyInputInformation() ITKv5_CONST override{}; + VerifyInputInformation() const override{}; private: bool m_Normalize{ false }; diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h index a52a73c4330..a46d23f7ccd 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h @@ -248,7 +248,7 @@ class ITK_TEMPLATE_EXPORT MaskedFFTNormalizedCorrelationImageFilter /** Overlap the VerifyInputInformation method */ void - VerifyInputInformation() ITKv5_CONST override; + VerifyInputInformation() const override; /** Standard pipeline method.*/ void diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx index d084069d2f7..231a8cf0d0f 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx @@ -600,7 +600,7 @@ MaskedFFTNormalizedCorrelationImageFilter template void -MaskedFFTNormalizedCorrelationImageFilter::VerifyInputInformation() ITKv5_CONST +MaskedFFTNormalizedCorrelationImageFilter::VerifyInputInformation() const { // Call the superclass' implementation of this method. Superclass::VerifyInputInformation(); diff --git a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h index 5f1ebde8e1b..dd03036153b 100644 --- a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h +++ b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h @@ -312,7 +312,7 @@ class ITK_TEMPLATE_EXPORT DiffusionTensor3DReconstructionImageFilter DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override; void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; /** Enables backwards compatibility for enum values */ using GradientImageTypeEnumeration = DiffusionTensor3DReconstructionImageFilterEnums::GradientImageFormat; diff --git a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx index 57d5cc73366..fcdb7d17a17 100644 --- a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx +++ b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx @@ -642,7 +642,7 @@ void DiffusionTensor3DReconstructionImageFilter::VerifyPreconditions() ITKv5_CONST + TMaskImageType>::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.h b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.h index cf9e1dabc77..e94ecf1e726 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.h +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.h @@ -181,7 +181,7 @@ class ITK_TEMPLATE_EXPORT DisplacementFieldJacobianDeterminantFilter itkGetConstMacro(UseImageSpacing, bool); itkBooleanMacro(UseImageSpacing); -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) /** Set the derivative weights according to the spacing of the input image (1/spacing). Use this option if you want to calculate the Jacobian determinant in the space in which the data was acquired. Default diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h index f479b88b8b2..c9c7a1b1e36 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h @@ -246,7 +246,7 @@ class ITK_TEMPLATE_EXPORT FastMarchingUpwindGradientImageFilter : public FastMar PrintSelf(std::ostream & os, Indent indent) const override; virtual void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; void Initialize(LevelSetImageType *) override; diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx index efedce1475e..4dda3e042ca 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx @@ -60,7 +60,7 @@ FastMarchingUpwindGradientImageFilter::PrintSelf(std::os template void -FastMarchingUpwindGradientImageFilter::VerifyPreconditions() ITKv5_CONST +FastMarchingUpwindGradientImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageCompose/include/itkJoinSeriesImageFilter.h b/Modules/Filtering/ImageCompose/include/itkJoinSeriesImageFilter.h index 81f14031349..555d3a57a15 100644 --- a/Modules/Filtering/ImageCompose/include/itkJoinSeriesImageFilter.h +++ b/Modules/Filtering/ImageCompose/include/itkJoinSeriesImageFilter.h @@ -104,7 +104,7 @@ class ITK_TEMPLATE_EXPORT JoinSeriesImageFilter : public ImageToImageFilter::JoinSeriesImageFilter() template void -JoinSeriesImageFilter::VerifyInputInformation() ITKv5_CONST +JoinSeriesImageFilter::VerifyInputInformation() const { Superclass::VerifyInputInformation(); diff --git a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.h b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.h index 88988e36482..1c6a752be2a 100644 --- a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.h @@ -100,7 +100,7 @@ class ITK_TEMPLATE_EXPORT DerivativeImageFilter : public ImageToImageFilter::HessianToObjec template void -HessianToObjectnessMeasureImageFilter::VerifyPreconditions() ITKv5_CONST +HessianToObjectnessMeasureImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); if (m_ObjectDimension >= ImageDimension) diff --git a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.h b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.h index cfb977cc883..f12682fa9aa 100644 --- a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.h @@ -107,7 +107,7 @@ class ITK_TEMPLATE_EXPORT HoughTransform2DCirclesImageFilter /** Verifies the preconditions of this filter. */ void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; /** Method for evaluating the implicit function over the image. */ void diff --git a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.hxx index 482614b1f3a..dcd9e59974f 100644 --- a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DCirclesImageFilter.hxx @@ -65,8 +65,7 @@ HoughTransform2DCirclesImageFilter void -HoughTransform2DCirclesImageFilter::VerifyPreconditions() - ITKv5_CONST +HoughTransform2DCirclesImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h index d881459b699..1114af87ed2 100644 --- a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h @@ -155,7 +155,7 @@ class ITK_TEMPLATE_EXPORT UnsharpMaskImageFilter : public ImageToImageFilter::GenerateI template void -UnsharpMaskImageFilter::VerifyPreconditions() ITKv5_CONST +UnsharpMaskImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); if (m_Threshold < 0.0) diff --git a/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.h b/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.h index 09cd6e1c7a7..310d12d48ab 100644 --- a/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.h +++ b/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.h @@ -188,7 +188,7 @@ class ITK_TEMPLATE_EXPORT FrequencyBandImageFilter : public UnaryFrequencyDomain /* Checks the logic of FrequencyThresholds. */ void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; /* This is the box functor, which implements the filter's behavior. */ void diff --git a/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.hxx b/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.hxx index 5035c4b1697..19c8814a0cc 100644 --- a/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.hxx +++ b/Modules/Filtering/ImageFrequency/include/itkFrequencyBandImageFilter.hxx @@ -111,7 +111,7 @@ FrequencyBandImageFilter::SetFrequencyThresholds template void -FrequencyBandImageFilter::VerifyPreconditions() ITKv5_CONST +FrequencyBandImageFilter::VerifyPreconditions() const { this->Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageGradient/include/itkGradientImageFilter.h b/Modules/Filtering/ImageGradient/include/itkGradientImageFilter.h index 735dfbe694f..63edd6272ad 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientImageFilter.h +++ b/Modules/Filtering/ImageGradient/include/itkGradientImageFilter.h @@ -118,7 +118,7 @@ class ITK_TEMPLATE_EXPORT GradientImageFilter : public ImageToImageFilter::GenerateOutputInformation() template void -CropImageFilter::VerifyInputInformation() ITKv5_CONST +CropImageFilter::VerifyInputInformation() const { Superclass::VerifyInputInformation(); diff --git a/Modules/Filtering/ImageGrid/include/itkInterpolateImagePointsFilter.h b/Modules/Filtering/ImageGrid/include/itkInterpolateImagePointsFilter.h index 5f2756f262a..db4700819b3 100644 --- a/Modules/Filtering/ImageGrid/include/itkInterpolateImagePointsFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkInterpolateImagePointsFilter.h @@ -179,7 +179,7 @@ class ITK_TEMPLATE_EXPORT InterpolateImagePointsFilter : public ImageToImageFilt * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override + VerifyInputInformation() const override {} private: diff --git a/Modules/Filtering/ImageGrid/include/itkPadImageFilterBase.h b/Modules/Filtering/ImageGrid/include/itkPadImageFilterBase.h index b44e0d96481..a9ab39e72f9 100644 --- a/Modules/Filtering/ImageGrid/include/itkPadImageFilterBase.h +++ b/Modules/Filtering/ImageGrid/include/itkPadImageFilterBase.h @@ -77,7 +77,7 @@ class ITK_TEMPLATE_EXPORT PadImageFilterBase : public ImageToImageFilter; -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE using BoundaryConditionPointerType [[deprecated("Please just use `BoundaryConditionType *` instead!")]] = BoundaryConditionType *; #endif diff --git a/Modules/Filtering/ImageGrid/include/itkPasteImageFilter.h b/Modules/Filtering/ImageGrid/include/itkPasteImageFilter.h index f66d9d79833..451d2148bd0 100644 --- a/Modules/Filtering/ImageGrid/include/itkPasteImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkPasteImageFilter.h @@ -167,11 +167,11 @@ class ITK_TEMPLATE_EXPORT PasteImageFilter : public InPlaceImageFilter::GenerateInputRequeste template void -PasteImageFilter::VerifyPreconditions() ITKv5_CONST +PasteImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.h b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.h index 6b17b7b59b6..f5707978a84 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.h @@ -185,7 +185,7 @@ class ITK_TEMPLATE_EXPORT ResampleImageFilter : public ImageToImageFilter void ResampleImageFilter:: - VerifyPreconditions() ITKv5_CONST + VerifyPreconditions() const { this->Superclass::VerifyPreconditions(); const ReferenceImageBaseType * const referenceImage = this->GetReferenceImage(); diff --git a/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.h b/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.h index 69e522610fe..9ad88c76146 100644 --- a/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.h @@ -166,7 +166,7 @@ class ITK_TEMPLATE_EXPORT SliceBySliceImageFilter : public ImageToImageFilter::VerifyInputInformation() ITKv5_CONST + TInternalOutputImageType>::VerifyInputInformation() const { Superclass::VerifyInputInformation(); diff --git a/Modules/Filtering/ImageGrid/include/itkSliceImageFilter.h b/Modules/Filtering/ImageGrid/include/itkSliceImageFilter.h index 9b5be1a2ada..72011c4f2d7 100644 --- a/Modules/Filtering/ImageGrid/include/itkSliceImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkSliceImageFilter.h @@ -154,7 +154,7 @@ class ITK_TEMPLATE_EXPORT SliceImageFilter : public ImageToImageFilter::GenerateOutputInformation() template void -SliceImageFilter::VerifyInputInformation() ITKv5_CONST +SliceImageFilter::VerifyInputInformation() const { Superclass::VerifyInputInformation(); diff --git a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.h b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.h index f9b3074a03f..544aa347bd5 100644 --- a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.h @@ -148,7 +148,7 @@ class ITK_TEMPLATE_EXPORT TileImageFilter : public ImageToImageFilter::GenerateOutputInformation() template void -TileImageFilter::VerifyInputInformation() ITKv5_CONST +TileImageFilter::VerifyInputInformation() const { // Do not call superclass's VerifyInputInformation method. diff --git a/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h b/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h index 3799be21acc..99130cd50b0 100644 --- a/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h @@ -251,7 +251,7 @@ class ITK_TEMPLATE_EXPORT WarpImageFilter : public ImageToImageFilter::SetOutputParamet template void -WarpImageFilter::VerifyInputInformation() ITKv5_CONST +WarpImageFilter::VerifyInputInformation() const { if (ImageDimension != GetDisplacementField()->GetNumberOfComponentsPerPixel()) { diff --git a/Modules/Filtering/ImageIntensity/include/itkArithmeticOpsFunctors.h b/Modules/Filtering/ImageIntensity/include/itkArithmeticOpsFunctors.h index cf59e130382..b0d525beaa0 100644 --- a/Modules/Filtering/ImageIntensity/include/itkArithmeticOpsFunctors.h +++ b/Modules/Filtering/ImageIntensity/include/itkArithmeticOpsFunctors.h @@ -228,7 +228,7 @@ class ITK_TEMPLATE_EXPORT Modulus } }; -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) /** * \class ModulusTransform diff --git a/Modules/Filtering/ImageIntensity/include/itkDivideImageFilter.h b/Modules/Filtering/ImageIntensity/include/itkDivideImageFilter.h index 925e14d577d..5ed5b8652ff 100644 --- a/Modules/Filtering/ImageIntensity/include/itkDivideImageFilter.h +++ b/Modules/Filtering/ImageIntensity/include/itkDivideImageFilter.h @@ -98,7 +98,7 @@ class ITK_TEMPLATE_EXPORT DivideImageFilter ~DivideImageFilter() override = default; void - VerifyPreconditions() ITKv5_CONST override + VerifyPreconditions() const override { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.h b/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.h index 69b948741dc..42c876d6c24 100644 --- a/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.h +++ b/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.h @@ -204,11 +204,11 @@ class ITK_TEMPLATE_EXPORT HistogramMatchingImageFilter : public ImageToImageFilt * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override + VerifyInputInformation() const override {} void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; /** Compute min, max and mean of an image. */ void diff --git a/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.hxx index 3c0d6cc87ff..fc8e27b1d70 100644 --- a/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkHistogramMatchingImageFilter.hxx @@ -110,7 +110,7 @@ HistogramMatchingImageFilter:: template void -HistogramMatchingImageFilter::VerifyPreconditions() ITKv5_CONST +HistogramMatchingImageFilter::VerifyPreconditions() const { Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.h b/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.h index e0907e97d9f..42c1ec92bc1 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.h +++ b/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.h @@ -118,7 +118,7 @@ class ITK_TEMPLATE_EXPORT AdaptiveHistogramEqualizationImageFilter itkSetMacro(Beta, float); itkGetConstMacro(Beta, float); -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) /** Set/Get whether an optimized lookup table for the intensity * mapping function is used. Default is off. * \deprecated diff --git a/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx index 7c591da613e..c3ecc929748 100644 --- a/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx @@ -64,32 +64,9 @@ BoxMeanImageFilter::DynamicThreadedGenerateData( accImage->SetRegions(accumRegion); accImage->Allocate(); -#if defined(ITKV4_COMPATIBILITY) - // Dummy reporter for compatibility - ProgressReporter progress(this, 1, 2 * accumRegion.GetNumberOfPixels()); -#endif - - BoxAccumulateFunction(inputImage, - accImage, - accumRegion, - accumRegion -#if defined(ITKV4_COMPATIBILITY) - , - progress); -#else - ); -#endif - BoxMeanCalculatorFunction(accImage.GetPointer(), - outputImage, - accumRegion, - outputRegionForThread, - this->GetRadius() -#if defined(ITKV4_COMPATIBILITY) - , - progress); -#else - ); -#endif + BoxAccumulateFunction(inputImage, accImage, accumRegion, accumRegion); + BoxMeanCalculatorFunction( + accImage.GetPointer(), outputImage, accumRegion, outputRegionForThread, this->GetRadius()); } } // end namespace itk #endif diff --git a/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx index e01bf91fc5b..134e1f11b5e 100644 --- a/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx @@ -66,32 +66,9 @@ BoxSigmaImageFilter::DynamicThreadedGenerateData( accImage->SetRegions(accumRegion); accImage->Allocate(); -#if defined(ITKV4_COMPATIBILITY) - // Dummy reporter for compatibility - ProgressReporter progress(this, 1, 2 * accumRegion.GetNumberOfPixels()); -#endif - - BoxSquareAccumulateFunction(inputImage, - accImage, - accumRegion, - accumRegion -#if defined(ITKV4_COMPATIBILITY) - , - progress); -#else - ); -#endif - BoxSigmaCalculatorFunction(accImage, - outputImage, - accumRegion, - outputRegionForThread, - this->GetRadius() -#if defined(ITKV4_COMPATIBILITY) - , - progress); -#else - ); -#endif + BoxSquareAccumulateFunction(inputImage, accImage, accumRegion, accumRegion); + BoxSigmaCalculatorFunction( + accImage, outputImage, accumRegion, outputRegionForThread, this->GetRadius()); } } // end namespace itk #endif diff --git a/Modules/Filtering/Smoothing/include/itkBoxUtilities.h b/Modules/Filtering/Smoothing/include/itkBoxUtilities.h index 425c8c3a847..08b7566a635 100644 --- a/Modules/Filtering/Smoothing/include/itkBoxUtilities.h +++ b/Modules/Filtering/Smoothing/include/itkBoxUtilities.h @@ -99,13 +99,7 @@ void BoxAccumulateFunction(const TInputImage * inputImage, const TOutputImage * outputImage, typename TInputImage::RegionType inputRegion, - typename TOutputImage::RegionType outputRegion -#if defined(ITKV4_COMPATIBILITY) - , - ProgressReporter & progress) -#else -) -#endif + typename TOutputImage::RegionType outputRegion) { // type alias using InputImageType = TInputImage; @@ -162,9 +156,6 @@ BoxAccumulateFunction(const TInputImage * inputImage, sum += sIt.Get() * weights[k]; } noutIt.SetCenterPixel(sum + inIt.Get()); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } @@ -207,13 +198,7 @@ BoxMeanCalculatorFunction(const TInputImage * accImage, TOutputImage * outputImage, typename TInputImage::RegionType inputRegion, typename TOutputImage::RegionType outputRegion, - typename TInputImage::SizeType radius -#if defined(ITKV4_COMPATIBILITY) - , - ProgressReporter & progress) -#else -) -#endif + typename TInputImage::SizeType radius) { // type alias using InputImageType = TInputImage; @@ -313,9 +298,6 @@ BoxMeanCalculatorFunction(const TInputImage * accImage, ++(cornerItVec[k]); } oIt.Set(static_cast(sum / pixelscount)); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } else @@ -378,9 +360,6 @@ BoxMeanCalculatorFunction(const TInputImage * accImage, } oIt.Set(static_cast(sum / (AccPixType)edgepixelscount)); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } } @@ -392,13 +371,7 @@ BoxSigmaCalculatorFunction(const TInputImage * accImage, TOutputImage * outputImage, typename TInputImage::RegionType inputRegion, typename TOutputImage::RegionType outputRegion, - typename TInputImage::SizeType radius -#if defined(ITKV4_COMPATIBILITY) - , - ProgressReporter & progress) -#else -) -#endif + typename TInputImage::SizeType radius) { // type alias using InputImageType = TInputImage; @@ -502,9 +475,6 @@ BoxSigmaCalculatorFunction(const TInputImage * accImage, } oIt.Set(static_cast(std::sqrt((squareSum - sum * sum / pixelscount) / (pixelscount - 1)))); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } else @@ -571,9 +541,6 @@ BoxSigmaCalculatorFunction(const TInputImage * accImage, oIt.Set( static_cast(std::sqrt((squareSum - sum * sum / edgepixelscount) / (edgepixelscount - 1)))); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } } @@ -584,13 +551,7 @@ void BoxSquareAccumulateFunction(const TInputImage * inputImage, TOutputImage * outputImage, typename TInputImage::RegionType inputRegion, - typename TOutputImage::RegionType outputRegion -#if defined(ITKV4_COMPATIBILITY) - , - ProgressReporter & progress) -#else -) -#endif + typename TOutputImage::RegionType outputRegion) { // type alias using InputImageType = TInputImage; @@ -655,9 +616,6 @@ BoxSquareAccumulateFunction(const TInputImage * inputImage, o[0] = sum + i; o[1] = squareSum + i * i; noutIt.SetCenterPixel(o); -#if defined(ITKV4_COMPATIBILITY) - progress.CompletedPixel(); -#endif } } } // namespace itk diff --git a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.h b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.h index 6268a644b6f..be463975cb7 100644 --- a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.h +++ b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.h @@ -104,7 +104,7 @@ class ITK_TEMPLATE_EXPORT DiscreteGaussianImageFilter : public ImageToImageFilte /** Typedef to describe the boundary condition. */ using BoundaryConditionType = ImageBoundaryCondition; -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE using InputBoundaryConditionPointerType [[deprecated("Please just use `BoundaryConditionType *` instead!")]] = BoundaryConditionType *; #endif @@ -286,7 +286,7 @@ class ITK_TEMPLATE_EXPORT DiscreteGaussianImageFilter : public ImageToImageFilte itkGetConstMacro(UseImageSpacing, bool); itkBooleanMacro(UseImageSpacing); -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) /** Use the image spacing information in calculations. Use this option if you * want to specify Gaussian variance in real world units. Default is * ImageSpacingOn. diff --git a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.h b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.h index de2de01fffd..22f3266bfcf 100644 --- a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.h +++ b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.h @@ -217,7 +217,7 @@ class ITK_TEMPLATE_EXPORT RecursiveGaussianImageFilter : public RecursiveSeparab /* See superclass for doxygen. This method adds the additional check * that sigma is greater than zero. */ void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; private: /** Compute the N coefficients in the recursive filter. */ diff --git a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx index b8bbb4bb1fb..32a7eeafb62 100644 --- a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx @@ -323,7 +323,7 @@ RecursiveGaussianImageFilter::ComputeRemainingCoeffic template void -RecursiveGaussianImageFilter::VerifyPreconditions() ITKv5_CONST +RecursiveGaussianImageFilter::VerifyPreconditions() const { this->Superclass::VerifyPreconditions(); diff --git a/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.h b/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.h index 8e3d80bf5ae..73586ea8ed2 100644 --- a/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.h +++ b/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.h @@ -201,7 +201,7 @@ class ITK_TEMPLATE_EXPORT HistogramThresholdImageFilter : public ImageToImageFil GenerateData() override; void - VerifyPreconditions() ITKv5_CONST override + VerifyPreconditions() const override { Superclass::VerifyPreconditions(); if (m_Calculator.IsNull()) diff --git a/Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.h b/Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.h index 28d1e492b07..c42a4eb8c8f 100644 --- a/Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.h +++ b/Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.h @@ -118,7 +118,7 @@ class ITK_TEMPLATE_EXPORT IntermodesThresholdImageFilter ~IntermodesThresholdImageFilter() override = default; void - VerifyPreconditions() ITKv5_CONST override + VerifyPreconditions() const override { Superclass::VerifyPreconditions(); if (dynamic_cast(Superclass::GetCalculator()) == nullptr) diff --git a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.h b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.h index 887d562a40b..d7f6e1a7ab8 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.h +++ b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.h @@ -118,11 +118,7 @@ class ITK_TEMPLATE_EXPORT OtsuMultipleThresholdsCalculator : public HistogramAlg SizeValueType m_NumberOfThresholds{ 1 }; OutputType m_Output{}; bool m_ValleyEmphasis{ false }; -#if defined(ITKV4_COMPATIBILITY) - bool m_ReturnBinMidpoint{ true }; -#else - bool m_ReturnBinMidpoint{ false }; -#endif + bool m_ReturnBinMidpoint{ false }; }; } // end of namespace itk diff --git a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.h b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.h index a065df15774..4bc4165bf29 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.h +++ b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.h @@ -155,11 +155,7 @@ class ITK_TEMPLATE_EXPORT OtsuMultipleThresholdsImageFilter : public ImageToImag OutputPixelType m_LabelOffset{}; ThresholdVectorType m_Thresholds{}; bool m_ValleyEmphasis{ false }; -#if defined(ITKV4_COMPATIBILITY) - bool m_ReturnBinMidpoint{ true }; -#else - bool m_ReturnBinMidpoint{ false }; -#endif + bool m_ReturnBinMidpoint{ false }; }; } // end namespace itk diff --git a/Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.h b/Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.h index 19aecbb7d50..d5cb94e6609 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.h +++ b/Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.h @@ -90,11 +90,7 @@ class ITK_TEMPLATE_EXPORT OtsuThresholdCalculator : public HistogramThresholdCal private: typename OtsuMultipleThresholdsCalculator::Pointer m_OtsuMultipleThresholdsCalculator{}; -#if defined(ITKV4_COMPATIBILITY) - bool m_ReturnBinMidpoint{ true }; -#else - bool m_ReturnBinMidpoint{ false }; -#endif + bool m_ReturnBinMidpoint{ false }; }; } // end namespace itk diff --git a/Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h b/Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h index 2bbb6d3c392..9e4d0494428 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h +++ b/Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h @@ -119,7 +119,7 @@ class ITK_TEMPLATE_EXPORT OtsuThresholdImageFilter } void - VerifyPreconditions() ITKv5_CONST override + VerifyPreconditions() const override { Superclass::VerifyPreconditions(); if (dynamic_cast(Superclass::GetCalculator()) == nullptr) @@ -128,13 +128,8 @@ class ITK_TEMPLATE_EXPORT OtsuThresholdImageFilter } } - private: -#if defined(ITKV4_COMPATIBILITY) - bool m_ReturnBinMidpoint{ true }; -#else bool m_ReturnBinMidpoint{ false }; -#endif }; } // end namespace itk diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx index 79d97e08428..b935e6ea940 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx @@ -81,11 +81,7 @@ itkOtsuMultipleThresholdsCalculatorTest(int argc, char * argv[]) auto otsuThresholdCalculator = OtsuMultipleThresholdCalculatorType::New(); -#if defined(ITKV4_COMPATIBILITY) - ITK_TEST_EXPECT_TRUE(otsuThresholdCalculator->GetReturnBinMidpoint()); -#else ITK_TEST_EXPECT_TRUE(!otsuThresholdCalculator->GetReturnBinMidpoint()); -#endif otsuThresholdCalculator->SetInputHistogram(histogram); otsuThresholdCalculator->SetNumberOfThresholds(numberOfThresholds); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx index 0e719cb3f1f..6bbc2c559fb 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx @@ -72,11 +72,7 @@ itkOtsuMultipleThresholdsImageFilterTest(int argc, char * argv[]) // Set up the filter parameters -#if defined(ITKV4_COMPATIBILITY) - ITK_TEST_EXPECT_TRUE(filter->GetReturnBinMidpoint()); -#else ITK_TEST_EXPECT_TRUE(!filter->GetReturnBinMidpoint()); -#endif filter->ReturnBinMidpointOff(); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx index 666d6cd5dda..86a9e88065d 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx @@ -90,12 +90,7 @@ itkOtsuThresholdCalculatorTest(int, char *[]) auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, OtsuThresholdCalculator, HistogramThresholdCalculator); - -#if defined(ITKV4_COMPATIBILITY) - bool returnBinMidpoint{ true }; -#else - bool returnBinMidpoint{ false }; -#endif + const bool returnBinMidpoint{ false }; ITK_TEST_SET_GET_BOOLEAN(calculator, ReturnBinMidpoint, returnBinMidpoint); calculator->SetInput(histGenerator->GetOutput()); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx index 8a791f9b38f..e1dad12a688 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx @@ -62,13 +62,7 @@ itkOtsuThresholdImageFilterTest(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, OtsuThresholdImageFilter, HistogramThresholdImageFilter); - -#if defined(ITKV4_COMPATIBILITY) - ITK_TEST_EXPECT_TRUE(filter->GetReturnBinMidpoint()); -#else ITK_TEST_EXPECT_TRUE(!filter->GetReturnBinMidpoint()); -#endif - auto numberOfHistogramBins = static_cast(std::stoi(argv[3])); filter->SetNumberOfHistogramBins(numberOfHistogramBins); diff --git a/Modules/IO/TransformBase/include/itkTransformFileWriter.h b/Modules/IO/TransformBase/include/itkTransformFileWriter.h index 4db55116e02..7f77837927d 100644 --- a/Modules/IO/TransformBase/include/itkTransformFileWriter.h +++ b/Modules/IO/TransformBase/include/itkTransformFileWriter.h @@ -67,7 +67,7 @@ class ITKIOTransformBase_TEMPLATE_EXPORT TransformFileWriterTemplate : public Li /** Get the filename */ itkGetStringMacro(FileName); -#if !defined(ITK_FUTURE_LEGACY_REMOVE) +#if !defined(ITK_LEGACY_REMOVE) /** Set/Get the write mode (append/overwrite) for the Filter. * Deprecated. */ void diff --git a/Modules/Numerics/Optimizers/include/itkVersorRigid3DTransformOptimizer.h b/Modules/Numerics/Optimizers/include/itkVersorRigid3DTransformOptimizer.h index a55edfc30fe..d96422d292b 100644 --- a/Modules/Numerics/Optimizers/include/itkVersorRigid3DTransformOptimizer.h +++ b/Modules/Numerics/Optimizers/include/itkVersorRigid3DTransformOptimizer.h @@ -21,7 +21,7 @@ #include "itkVersorTransformOptimizer.h" // At some point in the distant future, remove support for VersorRigid3DTransformOptimizer -// #if defined(ITK_FUTURE_LEGACY_REMOVE) +// #if defined(ITK_LEGACY_REMOVE) // #warning "itkVersorRigid3DTransformOptimizer is identical to itkVersorTransformOptimizer, please replace" // #else namespace itk diff --git a/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h b/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h index 534dd7fa72a..117ee142af6 100644 --- a/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h +++ b/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h @@ -164,18 +164,6 @@ class ITK_TEMPLATE_EXPORT LBFGS2Optimizerv4Template ITK_DISALLOW_COPY_AND_MOVE(LBFGS2Optimizerv4Template); using LineSearchMethodEnum = LBFGS2Optimizerv4Enums::LineSearchMethod; -#if !defined(ITK_LEGACY_REMOVE) - /**Exposes enums values for backwards compatibility*/ - static constexpr LineSearchMethodEnum LINESEARCH_DEFAULT = LineSearchMethodEnum::LINESEARCH_DEFAULT; - static constexpr LineSearchMethodEnum LINESEARCH_MORETHUENTE = LineSearchMethodEnum::LINESEARCH_MORETHUENTE; - static constexpr LineSearchMethodEnum LINESEARCH_BACKTRACKING_ARMIJO = - LineSearchMethodEnum::LINESEARCH_BACKTRACKING_ARMIJO; - static constexpr LineSearchMethodEnum LINESEARCH_BACKTRACKING = LineSearchMethodEnum::LINESEARCH_BACKTRACKING; - static constexpr LineSearchMethodEnum LINESEARCH_BACKTRACKING_WOLFE = - LineSearchMethodEnum::LINESEARCH_BACKTRACKING_WOLFE; - static constexpr LineSearchMethodEnum LINESEARCH_BACKTRACKING_STRONG_WOLFE = - LineSearchMethodEnum::LINESEARCH_BACKTRACKING_STRONG_WOLFE; -#endif /** * TODO: currently only double is used in lbfgs need to figure diff --git a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h index fcc368afbd7..555bd0d73c4 100644 --- a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h +++ b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h @@ -161,7 +161,7 @@ class ITK_TEMPLATE_EXPORT RegistrationParameterScalesEstimator itkBooleanMacro(TransformForward); /** Get/Set a point set for virtual domain sampling. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetVirtualDomainPointSet(VirtualPointSetType * const arg) { diff --git a/Modules/Registration/Common/include/itkImageToImageMetric.h b/Modules/Registration/Common/include/itkImageToImageMetric.h index 95876d23679..49fae8ebb9a 100644 --- a/Modules/Registration/Common/include/itkImageToImageMetric.h +++ b/Modules/Registration/Common/include/itkImageToImageMetric.h @@ -172,7 +172,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType); /** Set/Get the moving image mask. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetMovingImageMask(MovingImageMaskType * const arg) { @@ -185,7 +185,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType); /** Set/Get the fixed image mask. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetFixedImageMask(FixedImageMaskType * const arg) { @@ -459,7 +459,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction * only inspecting the parameters within the support region * of a mapped point. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE /** Boolean to indicate if the transform is BSpline deformable. \deprecated `m_TransformIsBSpline` is intended to be removed, in the future. Please use `m_BSplineTransform` instead. For example, `if (m_TransformIsBSpline)` may be rewritten as `if (m_BSplineTransform)`. */ @@ -541,7 +541,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction ImageDerivativesType & movingImageGradient, ThreadIdType threadId) const; -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE /** Boolean to indicate if the interpolator BSpline. \deprecated `m_InterpolatorIsBSpline` is intended to be removed, in the future. Please use `m_BSplineInterpolator` instead. For example, `if (m_InterpolatorIsBSpline)` may be rewritten as `if (m_BSplineInterpolator)`. */ diff --git a/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h b/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h index bd97c52e312..5ab46a61a3c 100644 --- a/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h +++ b/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h @@ -407,7 +407,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 itkGetModifiableObjectMacro(MovingInterpolator, MovingInterpolatorType); /** Set/Get the moving image mask. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetMovingImageMask(MovingImageMaskType * const arg) { @@ -420,7 +420,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType); /** Set/Get the fixed image mask. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetFixedImageMask(FixedImageMaskType * const arg) { @@ -435,7 +435,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 /** Set/Get the fixed image domain sampling point set * See main documentation regarding using fixed vs virtual domain * for the point set. */ -#ifndef ITK_FUTURE_LEGACY_REMOVE +#ifndef ITK_LEGACY_REMOVE virtual void SetFixedSampledPointSet(FixedSampledPointSetType * const arg) { diff --git a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.h b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.h index bcd742d53ee..a53b37c80f5 100644 --- a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.h +++ b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.h @@ -144,7 +144,7 @@ class ITK_TEMPLATE_EXPORT DemonsRegistrationFilter * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override + VerifyInputInformation() const override {} private: diff --git a/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h b/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h index 72d079afd25..d6bc2157a20 100644 --- a/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h +++ b/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h @@ -283,7 +283,7 @@ class ITK_TEMPLATE_EXPORT MultiResolutionPDEDeformableRegistration * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override + VerifyInputInformation() const override {} private: diff --git a/Modules/Remote/Deprecated/NeuralNetworks.remote.cmake b/Modules/Remote/Deprecated/NeuralNetworks.remote.cmake deleted file mode 100644 index 84fe42f856d..00000000000 --- a/Modules/Remote/Deprecated/NeuralNetworks.remote.cmake +++ /dev/null @@ -1,64 +0,0 @@ -#-- # Grading Level Criteria Report -#-- EVALUATION DATE: 2020-03-01 -#-- EVALUATORS: [<>,<>] -#-- -#-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules) -#-- - [ ] Widespread community dependance -#-- - [ ] Above 90% code coverage -#-- - [ ] CI dashboards and testing monitored rigorously -#-- - [ ] All requirements of Levels 4,3,2,1 -#-- -#-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance) -#-- - [ ] Meets all ITK code style standards -#-- - [ ] No external requirements beyond those needed by ITK proper -#-- - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release -#-- - [ ] Active developer community dedicated to maintaining code-base -#-- - [ ] 75% code coverage demonstrated for testing suite -#-- - [ ] Continuous integration testing performed -#-- - [ ] All requirements of Levels 3,2,1 -#-- -#-- ## Compliance Level 3 star (Quality beta code) -#-- - [ ] API | executable interface is considered mostly stable and feature complete -#-- - [ ] Some tests exist and pass on at least some platform -#-- - [ ] All requirements of Levels 2,1 -#-- -#-- ## Compliance Level 2 star (Alpha code feature API development or niche community/execution environment dependance ) -#-- - [ ] Compiles for at least 1 niche set of execution envirionments, and perhaps others -#-- (may depend on specific external tools like a java environment, or specific external libraries to work ) -#-- - [ ] All requirements of Levels 1 -#-- -#-- ## Compliance Level 1 star (Pre-alpha features under development and code of unknown quality) -#-- - [ ] Code complies on at least 1 platform -#-- -#-- ## Compliance Level 0 star ( Code/Feature of known poor-quality or deprecated status ) -#-- - [X] Code reviewed and explicitly identified as not recommended for use -#-- -#-- ### Please document here any justification for the criteria above -# This outdated code is not recommended for use. It is not optimized or rigourously tested -# This module has not received updates or testing for many many years -# Core developers should *NOT* expend energy or resources keeping this codebase consistent with ITK - -if(NOT ITK_LEGACY_REMOVE - AND ITKV4_COMPATIBILITY - AND Module_ITKDeprecated) - - itk_fetch_module( - NeuralNetworks - "This deprecated remote module contains classes and support classes -for the calculation of artificial neural networks. - -This can be used, for instance, for image classification. - -This historical set of features is likely not appropriate for modern neural -network implementations due to performance issues." - MODULE_COMPLIANCE_LEVEL 0 - GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKNeuralNetworks.git - GIT_TAG c293e56699d6d102dcde567baf1cf5b704819c17 - ) - - if(NOT ITK_LEGACY_SILENT AND Module_NeuralNetworks) - message(WARNING "NeuralNetworks remote module is deprecated. - Development of this module has ended, and it will be removed - in future ITK versions.") - endif() -endif() diff --git a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.h b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.h index 4e31775f26a..c38175c4351 100644 --- a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.h +++ b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.h @@ -167,7 +167,7 @@ class ITK_TEMPLATE_EXPORT ScalarImageKmeansImageFilter : public ImageToImageFilt /* See superclass for doxygen. This methods additionally checks that * the number of means is not 0. */ void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; private: using MeansContainer = std::vector; diff --git a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx index 737c60feb68..1f2fa545252 100644 --- a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx +++ b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx @@ -42,7 +42,7 @@ ScalarImageKmeansImageFilter::SetImageRegion(const Im template void -ScalarImageKmeansImageFilter::VerifyPreconditions() ITKv5_CONST +ScalarImageKmeansImageFilter::VerifyPreconditions() const { this->Superclass::VerifyPreconditions(); diff --git a/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.h b/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.h index 54a22bc9cab..82bc1180be9 100644 --- a/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.h +++ b/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.h @@ -141,7 +141,7 @@ class ITK_TEMPLATE_EXPORT IsolatedWatershedImageFilter : public ImageToImageFilt EnlargeOutputRequestedRegion(DataObject * output) override; void - VerifyInputInformation() ITKv5_CONST override; + VerifyInputInformation() const override; void GenerateData() override; }; diff --git a/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.hxx index 2f6669c929a..2a81ee485bd 100644 --- a/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.hxx @@ -61,7 +61,7 @@ IsolatedWatershedImageFilter::EnlargeOutputRequestedR template void -IsolatedWatershedImageFilter::VerifyInputInformation() ITKv5_CONST +IsolatedWatershedImageFilter::VerifyInputInformation() const { Superclass::VerifyInputInformation(); diff --git a/Utilities/ITKv5Preparation/ReplaceOutdatedMacroNames.sh b/Utilities/ITKv5Preparation/ReplaceOutdatedMacroNames.sh index e653a353f78..b1d16b55d89 100755 --- a/Utilities/ITKv5Preparation/ReplaceOutdatedMacroNames.sh +++ b/Utilities/ITKv5Preparation/ReplaceOutdatedMacroNames.sh @@ -34,3 +34,6 @@ ReplaceCXXString ITK_NOEXCEPT_OR_THROW ITK_NOEXCEPT ReplaceCXXString ITK_HAS_CXX11_STATIC_ASSERT ITK_COMPILER_CXX_STATIC_ASSERT ReplaceCXXString ITK_DELETE_FUNCTION ITK_DELETED_FUNCTION ReplaceCXXString ITK_HAS_CPP11_ALIGNAS ITK_COMPILER_CXX_ALIGNAS +ReplaceCXXString ITK_ITERATOR_VIRTUAL virtual +ReplaceCXXString ITK_ITERATOR_OVERRIDE override +ReplaceCXXString ITK_ITERATOR_FINAL final