From 289550e88df15f7633694f5efcce77626bad76fd Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Fri, 31 May 2024 14:22:13 -0500 Subject: [PATCH 1/2] ENH: Finalize ITKv5 const function API change The non-const API variants are no longer supported at compiletime. Replace 'ITKv5_CONST' with 'const'. --- Modules/Core/Common/include/itkImageSink.h | 2 +- Modules/Core/Common/include/itkImageSink.hxx | 2 +- Modules/Core/Common/include/itkImageToImageFilter.h | 2 +- Modules/Core/Common/include/itkImageToImageFilter.hxx | 2 +- Modules/Core/Common/include/itkMacro.h | 8 ++++---- Modules/Core/Common/include/itkProcessObject.h | 4 ++-- Modules/Core/Common/src/itkProcessObject.cxx | 4 ++-- .../TestKernel/include/itkTestingComparisonImageFilter.h | 2 +- .../include/itkTestingComparisonImageFilter.hxx | 2 +- .../Transform/include/itkTransformGeometryImageFilter.h | 2 +- .../Transform/include/itkTransformGeometryImageFilter.hxx | 2 +- .../Convolution/include/itkConvolutionImageFilterBase.h | 2 +- .../itkMaskedFFTNormalizedCorrelationImageFilter.h | 2 +- .../itkMaskedFFTNormalizedCorrelationImageFilter.hxx | 2 +- .../itkDiffusionTensor3DReconstructionImageFilter.h | 2 +- .../itkDiffusionTensor3DReconstructionImageFilter.hxx | 2 +- .../include/itkFastMarchingUpwindGradientImageFilter.h | 2 +- .../include/itkFastMarchingUpwindGradientImageFilter.hxx | 2 +- .../ImageCompose/include/itkJoinSeriesImageFilter.h | 2 +- .../ImageCompose/include/itkJoinSeriesImageFilter.hxx | 2 +- .../include/itkHessianToObjectnessMeasureImageFilter.h | 2 +- .../include/itkHessianToObjectnessMeasureImageFilter.hxx | 2 +- .../include/itkHoughTransform2DCirclesImageFilter.h | 2 +- .../include/itkHoughTransform2DCirclesImageFilter.hxx | 3 +-- .../ImageFeature/include/itkUnsharpMaskImageFilter.h | 2 +- .../ImageFeature/include/itkUnsharpMaskImageFilter.hxx | 2 +- .../ImageFrequency/include/itkFrequencyBandImageFilter.h | 2 +- .../include/itkFrequencyBandImageFilter.hxx | 2 +- .../ImageGrid/include/itkChangeInformationImageFilter.h | 2 +- Modules/Filtering/ImageGrid/include/itkCropImageFilter.h | 2 +- .../Filtering/ImageGrid/include/itkCropImageFilter.hxx | 2 +- .../ImageGrid/include/itkInterpolateImagePointsFilter.h | 2 +- Modules/Filtering/ImageGrid/include/itkPasteImageFilter.h | 4 ++-- .../Filtering/ImageGrid/include/itkPasteImageFilter.hxx | 2 +- .../Filtering/ImageGrid/include/itkResampleImageFilter.h | 4 ++-- .../ImageGrid/include/itkResampleImageFilter.hxx | 2 +- .../ImageGrid/include/itkSliceBySliceImageFilter.h | 2 +- .../ImageGrid/include/itkSliceBySliceImageFilter.hxx | 2 +- Modules/Filtering/ImageGrid/include/itkSliceImageFilter.h | 2 +- .../Filtering/ImageGrid/include/itkSliceImageFilter.hxx | 2 +- Modules/Filtering/ImageGrid/include/itkTileImageFilter.h | 2 +- .../Filtering/ImageGrid/include/itkTileImageFilter.hxx | 2 +- Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h | 2 +- .../Filtering/ImageGrid/include/itkWarpImageFilter.hxx | 2 +- .../ImageIntensity/include/itkDivideImageFilter.h | 2 +- .../include/itkHistogramMatchingImageFilter.h | 4 ++-- .../include/itkHistogramMatchingImageFilter.hxx | 2 +- .../Smoothing/include/itkRecursiveGaussianImageFilter.h | 2 +- .../Smoothing/include/itkRecursiveGaussianImageFilter.hxx | 2 +- .../include/itkHistogramThresholdImageFilter.h | 2 +- .../include/itkIntermodesThresholdImageFilter.h | 2 +- .../Thresholding/include/itkOtsuThresholdImageFilter.h | 2 +- .../PDEDeformable/include/itkDemonsRegistrationFilter.h | 2 +- .../include/itkMultiResolutionPDEDeformableRegistration.h | 2 +- .../Classifiers/include/itkScalarImageKmeansImageFilter.h | 2 +- .../include/itkScalarImageKmeansImageFilter.hxx | 2 +- .../Watersheds/include/itkIsolatedWatershedImageFilter.h | 2 +- .../include/itkIsolatedWatershedImageFilter.hxx | 2 +- 58 files changed, 66 insertions(+), 67 deletions(-) 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/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/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 7a4ed76db34..830d3fc7465 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -1376,11 +1376,11 @@ compilers. # 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 diff --git a/Modules/Core/Common/include/itkProcessObject.h b/Modules/Core/Common/include/itkProcessObject.h index 07595daa28a..068767a06d6 100644 --- a/Modules/Core/Common/include/itkProcessObject.h +++ b/Modules/Core/Common/include/itkProcessObject.h @@ -782,7 +782,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 @@ -795,7 +795,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/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/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/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..4b5379d6b12 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h @@ -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/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/itkHessianToObjectnessMeasureImageFilter.h b/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.h index 2f1e6a2719e..7657a368c87 100644 --- a/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.h @@ -135,7 +135,7 @@ class ITK_TEMPLATE_EXPORT HessianToObjectnessMeasureImageFilter : public ImageTo PrintSelf(std::ostream & os, Indent indent) const override; void - VerifyPreconditions() ITKv5_CONST override; + VerifyPreconditions() const override; void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override; diff --git a/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.hxx index 79fdd201636..bd0a8f3b601 100644 --- a/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHessianToObjectnessMeasureImageFilter.hxx @@ -40,7 +40,7 @@ HessianToObjectnessMeasureImageFilter::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/ImageGrid/include/itkChangeInformationImageFilter.h b/Modules/Filtering/ImageGrid/include/itkChangeInformationImageFilter.h index 55b9e6f0a63..6cf0eee6b34 100644 --- a/Modules/Filtering/ImageGrid/include/itkChangeInformationImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkChangeInformationImageFilter.h @@ -235,7 +235,7 @@ class ITK_TEMPLATE_EXPORT ChangeInformationImageFilter : public ImageToImageFilt * \sa ProcessObject::VerifyInputInformation */ void - VerifyInputInformation() ITKv5_CONST override + VerifyInputInformation() const override {} private: diff --git a/Modules/Filtering/ImageGrid/include/itkCropImageFilter.h b/Modules/Filtering/ImageGrid/include/itkCropImageFilter.h index a803fc8b6a2..cb86641a72b 100644 --- a/Modules/Filtering/ImageGrid/include/itkCropImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkCropImageFilter.h @@ -113,7 +113,7 @@ class ITK_TEMPLATE_EXPORT CropImageFilter : public ExtractImageFilter::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/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/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/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/itkOtsuThresholdImageFilter.h b/Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h index bfb7efee2b2..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) 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/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(); From 6523b287b6cb23eaf97c8af8a8db1a4bb98014a9 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Tue, 4 Jun 2024 11:01:35 -0500 Subject: [PATCH 2/2] DOC: Update migration guide for v6.0 changes. --- Documentation/docs/migration_guides/itk_6_migration_guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/docs/migration_guides/itk_6_migration_guide.md b/Documentation/docs/migration_guides/itk_6_migration_guide.md index f488cb38704..89618eccf25 100644 --- a/Documentation/docs/migration_guides/itk_6_migration_guide.md +++ b/Documentation/docs/migration_guides/itk_6_migration_guide.md @@ -9,6 +9,8 @@ Require modern C++ language feature use --------------------------------------- Many backward compatible/ forward enabling compiler features are now required to be used. +Replace `ITKv5_CONST` with `const` + Remove support for ITKv4 interfaces -----------------------------------