Skip to content

Commit badfa18

Browse files
authored
Merge pull request #6504 from hjmjohnson/future-legacy-ingested-trivial
COMP: Modernize deprecated macros in ingested filter/IO modules
2 parents bc1a458 + 60640e0 commit badfa18

10 files changed

Lines changed: 32 additions & 11 deletions

File tree

Documentation/docs/migration_guides/itk_6_migration_guide.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,24 @@ whereas `vnl_svd`'s signs depend on solver internals. Sign-invariant operations
845845
reads individual `U`/`V` columns as directions may see the same geometry from a
846846
different, equally-valid representative. Pass `canonicalizeSigns = false` to
847847
reproduce `vnl_svd`'s raw signs (e.g. for equivalence testing).
848+
849+
## `FixedPointInverseDisplacementFieldImageFilter::OutputIterator` is now `ImageRegionIteratorWithIndex`
850+
851+
The public nested type alias
852+
`FixedPointInverseDisplacementFieldImageFilter<...>::OutputIterator` changed from
853+
`ImageRegionIterator<OutputImageType>` to
854+
`ImageRegionIteratorWithIndex<OutputImageType>`. The filter calls `GetIndex()` on
855+
this iterator, which `ImageRegionIterator` only provides under the removed
856+
`ITK_FUTURE_LEGACY_REMOVE` API; `ImageRegionIteratorWithIndex` supplies it
857+
natively.
858+
859+
### What you need to do
860+
861+
Downstream code that names the concrete alias explicitly -- e.g. a template
862+
specialization or overload keyed on `ImageRegionIterator<OutputImageType>`, or a
863+
variable declared as `FilterType::OutputIterator` and then passed where an
864+
`ImageRegionIterator` is required -- must accept
865+
`ImageRegionIteratorWithIndex<OutputImageType>` instead. The two iterators are
866+
siblings in the iterator hierarchy, not subclasses, so such uses do not convert
867+
implicitly. Code that only iterates (`GoToBegin`/`IsAtEnd`/`Get`/`Set`) needs no
868+
change.

Modules/Filtering/Cuberille/include/itkCuberilleImageToMeshFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class CuberilleImageToMeshFilter : public ImageToMeshFilter<TInputImage, TOutput
127127
itkNewMacro(Self);
128128

129129
/** Run-time type information (and related methods). */
130-
itkTypeMacro(CuberilleImageToMeshFilter, ImageToMeshFilter);
130+
itkOverrideGetNameOfClassMacro(CuberilleImageToMeshFilter);
131131

132132
/** Compile-time configuration flags (formerly preprocessor macros).
133133
* Flip a flag to true and rebuild to enable the corresponding alternative

Modules/Filtering/FixedPointInverseDisplacementField/include/itkFixedPointInverseDisplacementFieldImageFilter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "itkWarpVectorImageFilter.h"
2525
#include "itkVectorLinearInterpolateImageFunction.h"
2626
#include "itkImageRegionIterator.h"
27+
#include "itkImageRegionIteratorWithIndex.h"
2728
#include "itkTimeProbe.h"
2829

2930
namespace itk
@@ -70,7 +71,7 @@ class ITK_TEMPLATE_EXPORT FixedPointInverseDisplacementFieldImageFilter
7071
itkNewMacro(Self);
7172

7273
/** Run-time type information (and related methods). */
73-
itkTypeMacro(FixedPointInverseDisplacementFieldImageFilter, ImageToImageFilter);
74+
itkOverrideGetNameOfClassMacro(FixedPointInverseDisplacementFieldImageFilter);
7475

7576

7677
/** Some type alias. */
@@ -101,7 +102,7 @@ class ITK_TEMPLATE_EXPORT FixedPointInverseDisplacementFieldImageFilter
101102
using InputConstIterator = ImageRegionConstIterator<InputImageType>;
102103
using InputIterator = ImageRegionIterator<InputImageType>;
103104
using OutputConstIterator = ImageRegionConstIterator<OutputImageType>;
104-
using OutputIterator = ImageRegionIterator<OutputImageType>;
105+
using OutputIterator = ImageRegionIteratorWithIndex<OutputImageType>;
105106

106107
using VectorWarperType = WarpVectorImageFilter<TOutputImage, TInputImage, TOutputImage>;
107108
using InterpolatorVectorType = typename NumericTraits<typename TOutputImage::PixelType>::RealType;

Modules/Filtering/SubdivisionQuadEdgeMeshFilter/include/itkModifiedButterflyTriangleEdgeCellSubdivisionQuadEdgeMeshFilter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ class ModifiedButterflyTriangleEdgeCellSubdivisionQuadEdgeMeshFilter
7676
using OutputPointIdIterator = typename Superclass::OutputPointIdIterator;
7777

7878
/** Run-time type information (and related methods). */
79-
itkTypeMacro(ModifiedButterflyTriangleEdgeCellSubdivisionQuadEdgeMeshFilter,
80-
TriangleEdgeCellSubdivisionQuadEdgeMeshFilter);
79+
itkOverrideGetNameOfClassMacro(ModifiedButterflyTriangleEdgeCellSubdivisionQuadEdgeMeshFilter);
8180

8281
/** New macro for creation of through a Smart Pointer */
8382
itkNewMacro(Self);

Modules/Filtering/TotalVariation/include/itkProxTVImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ProxTVImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
5656
using ConstPointer = SmartPointer<const Self>;
5757

5858
/** Run-time type information. */
59-
itkTypeMacro(ProxTVImageFilter, ImageToImageFilter);
59+
itkOverrideGetNameOfClassMacro(ProxTVImageFilter);
6060

6161
/** Standard New macro. */
6262
itkNewMacro(Self);

Modules/IO/IOMeshSTL/include/itkSTLMeshIO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class IOMeshSTL_EXPORT STLMeshIO : public MeshIOBase
5050
itkNewMacro(Self);
5151

5252
/** Run-time type information (and related methods). */
53-
itkTypeMacro(STLMeshIO, MeshIOBase);
53+
itkOverrideGetNameOfClassMacro(STLMeshIO);
5454

5555
/**-------- This part of the interfaces deals with reading data. ----- */
5656

Modules/IO/IOMeshSTL/include/itkSTLMeshIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class IOMeshSTL_EXPORT STLMeshIOFactory : public ObjectFactoryBase
5252
itkFactorylessNewMacro(Self);
5353

5454
/** Run-time type information (and related methods). */
55-
itkTypeMacro(STLMeshIOFactory, ObjectFactoryBase);
55+
itkOverrideGetNameOfClassMacro(STLMeshIOFactory);
5656

5757
/** Register one factory of this type */
5858
static void

Modules/Registration/RANSAC/include/itkLandmarkRegistrationEstimator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class LandmarkRegistrationEstimator : public itk::ParametersEstimator<Point<doub
5050
using PointsLocatorType = itk::PointsLocator<itk::VectorContainer<IdentifierType, itk::Point<double, 3>>>;
5151
using PointsContainer = itk::VectorContainer<IdentifierType, itk::Point<double, 3>>;
5252

53-
itkTypeMacro(LandmarkRegistrationEstimator, ParametersEstimator);
53+
itkOverrideGetNameOfClassMacro(LandmarkRegistrationEstimator);
5454
/** New method for creating an object using a factory. */
5555
itkNewMacro(Self);
5656

Modules/Registration/RANSAC/include/itkParametersEstimator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ITK_TEMPLATE_EXPORT ParametersEstimator : public Object
5555
typedef SmartPointer<Self> Pointer;
5656
typedef SmartPointer<const Self> ConstPointer;
5757

58-
itkTypeMacro(ParametersEstimator, Object);
58+
itkOverrideGetNameOfClassMacro(ParametersEstimator);
5959

6060
/**
6161
* Exact estimation of parameters.

Modules/Registration/RANSAC/include/itkRANSAC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ITK_TEMPLATE_EXPORT RANSAC : public Object
8686
using ParametersEstimatorPointer = typename itk::ParametersEstimator<T, SType>::Pointer;
8787
using ParametersEstimatorType = typename itk::ParametersEstimator<T, SType>;
8888

89-
itkTypeMacro(RANSAC, Object);
89+
itkOverrideGetNameOfClassMacro(RANSAC);
9090
/** New method for creating an object using a factory. */
9191
itkNewMacro(Self);
9292

0 commit comments

Comments
 (0)