From 7d1e437dab8f71062b4978a91c433adb70d202b4 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 28 Dec 2023 01:30:03 +0100 Subject: [PATCH] STYLE: Add `const` to `auto [index, size] = region` structured bindings Added `const`, whenever the values of the bindings were not modified, after the declaration. --- Modules/Bridge/VTK/include/itkVTKImageExport.hxx | 4 ++-- Modules/Bridge/VTK/include/itkVTKImageImport.hxx | 2 +- .../Core/Common/include/itkPeriodicBoundaryCondition.hxx | 6 +++--- .../Common/include/itkZeroFluxNeumannBoundaryCondition.hxx | 6 +++--- Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx | 2 +- .../include/itkGaussianInterpolateImageFunction.hxx | 2 +- .../include/itkSpatialObjectToImageStatisticsCalculator.hxx | 2 +- .../include/itkMRIBiasFieldCorrectionFilter.hxx | 2 +- .../Convolution/include/itkFFTConvolutionImageFilter.hxx | 6 +++--- ...anSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx | 2 +- .../FFT/include/itkHalfToFullHermitianImageFilter.hxx | 4 ++-- ...uencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h | 2 +- Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx | 2 +- .../Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx | 2 +- .../ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx | 6 +++--- .../ImageStatistics/include/itkProjectionImageFilter.hxx | 4 ++-- .../Filtering/LabelMap/include/itkCropLabelMapFilter.hxx | 2 +- Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx | 2 +- .../include/itkSharedMorphologyUtilities.hxx | 4 ++-- .../Smoothing/include/itkBinomialBlurImageFilter.hxx | 2 +- Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx | 2 +- .../itkImageFileWriterUpdateLargestPossibleRegionTest.cxx | 2 +- .../NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx | 2 +- .../Statistics/include/itkSpatialNeighborSubsampler.hxx | 2 +- .../include/itkUniformRandomSpatialNeighborSubsampler.hxx | 2 +- .../include/itkMultiResolutionImageRegistrationMethod.hxx | 2 +- ...meVaryingBSplineVelocityFieldImageRegistrationMethod.hxx | 2 +- .../include/itkParallelSparseFieldLevelSetImageFilter.hxx | 2 +- Modules/Video/Core/include/itkImageToVideoFilter.hxx | 2 +- 29 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Modules/Bridge/VTK/include/itkVTKImageExport.hxx b/Modules/Bridge/VTK/include/itkVTKImageExport.hxx index eb97c368acef..72a97d00bf2e 100644 --- a/Modules/Bridge/VTK/include/itkVTKImageExport.hxx +++ b/Modules/Bridge/VTK/include/itkVTKImageExport.hxx @@ -145,7 +145,7 @@ VTKImageExport::WholeExtentCallback() } InputRegionType region = input->GetLargestPossibleRegion(); - auto [index, size] = region; + const auto [index, size] = region; unsigned int i = 0; // Fill in the known portion of the extent. @@ -386,7 +386,7 @@ VTKImageExport::DataExtentCallback() } InputRegionType region = input->GetBufferedRegion(); - auto [index, size] = region; + const auto [index, size] = region; unsigned int i = 0; for (; i < InputImageDimension; ++i) diff --git a/Modules/Bridge/VTK/include/itkVTKImageImport.hxx b/Modules/Bridge/VTK/include/itkVTKImageImport.hxx index 06847f12ec16..d8611e6fa856 100644 --- a/Modules/Bridge/VTK/include/itkVTKImageImport.hxx +++ b/Modules/Bridge/VTK/include/itkVTKImageImport.hxx @@ -113,7 +113,7 @@ VTKImageImport::PropagateRequestedRegion(DataObject * outputPtr) if (m_PropagateUpdateExtentCallback) { OutputRegionType region = output->GetRequestedRegion(); - auto [index, size] = region; + const auto [index, size] = region; int updateExtent[6]; unsigned int i = 0; diff --git a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx index 39eea96f0d3a..5b682670a598 100644 --- a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx @@ -138,9 +138,9 @@ PeriodicBoundaryCondition::GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const -> RegionType { - auto [imageIndex, imageSize] = inputLargestPossibleRegion; + const auto [imageIndex, imageSize] = inputLargestPossibleRegion; - auto [outputIndex, outputSize] = outputRequestedRegion; + const auto [outputIndex, outputSize] = outputRequestedRegion; IndexType inputRequestedIndex; SizeType inputRequestedSize; @@ -182,7 +182,7 @@ PeriodicBoundaryCondition::GetPixel(const IndexType & -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); - auto [imageIndex, imageSize] = imageRegion; + const auto [imageIndex, imageSize] = imageRegion; IndexType lookupIndex; diff --git a/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx b/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx index f7a1ea29390b..0d4fb4e401c2 100644 --- a/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx @@ -86,9 +86,9 @@ ZeroFluxNeumannBoundaryCondition::GetInputRequestedRe const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const -> RegionType { - auto [inputIndex, inputSize] = inputLargestPossibleRegion; + const auto [inputIndex, inputSize] = inputLargestPossibleRegion; - auto [outputIndex, outputSize] = outputRequestedRegion; + const auto [outputIndex, outputSize] = outputRequestedRegion; IndexType requestIndex; SizeType requestSize; @@ -154,7 +154,7 @@ ZeroFluxNeumannBoundaryCondition::GetPixel(const Inde -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); - auto [imageIndex, imageSize] = imageRegion; + const auto [imageIndex, imageSize] = imageRegion; IndexType lookupIndex; diff --git a/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx b/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx index 48292018cd4b..d400b37b9938 100644 --- a/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx @@ -33,7 +33,7 @@ GPUImageDataManager::SetImagePointer(ImageType * img) using SizeType = typename ImageType::SizeType; RegionType region = m_Image->GetBufferedRegion(); - auto [index, size] = region; + const auto [index, size] = region; for (unsigned int d = 0; d < ImageDimension; ++d) { diff --git a/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx index 7099fffc353c..fd59347656d7 100644 --- a/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx @@ -58,7 +58,7 @@ GaussianInterpolateImageFunction::ComputeBoundingBox() typename InputImageType::ConstPointer input = this->GetInputImage(); typename InputImageType::SpacingType spacing = input->GetSpacing(); - auto [index, size] = input->GetLargestPossibleRegion(); + const auto [index, size] = input->GetLargestPossibleRegion(); for (unsigned int d = 0; d < ImageDimension; ++d) { diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx b/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx index 9211c61aed55..3877173f56c3 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx @@ -163,7 +163,7 @@ SpatialObjectToImageStatisticsCalculatorTransformPhysicalPointToIndex(ptMin); auto indMax = m_Image->TransformPhysicalPointToIndex(ptMax); - auto [imageIndex, imageSize] = m_Image->GetLargestPossibleRegion(); + const auto [imageIndex, imageSize] = m_Image->GetLargestPossibleRegion(); for (unsigned int i = 0; i < Self::ObjectDimension; ++i) { if (indMin[i] > indMax[i]) diff --git a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx index 434127772f70..18d1b217ace8 100644 --- a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx @@ -881,7 +881,7 @@ MRIBiasFieldCorrectionFilter::AdjustSlabR SlabRegionVectorType & slabs, OutputImageRegionType requestedRegion) { - auto [indexFirst, size] = requestedRegion; + const auto [indexFirst, size] = requestedRegion; OutputImageIndexType indexLast = indexFirst; for (SizeValueType i = 0; i < ImageDimension; ++i) diff --git a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx index 4fb4013f5d74..1182227332f2 100644 --- a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx @@ -150,11 +150,11 @@ FFTConvolutionImageFilterGetLargestPossibleRegion(); - auto [inputLargestIndex, inputLargestSize] = inputLargestRegion; + const auto [inputLargestIndex, inputLargestSize] = inputLargestRegion; InputRegionType inputRequestedRegion = input->GetRequestedRegion(); - auto [inputRequestedIndex, inputRequestedSize] = inputRequestedRegion; + const auto [inputRequestedIndex, inputRequestedSize] = inputRequestedRegion; OutputRegionType outputRequestedRegion = this->GetOutput()->GetRequestedRegion(); - auto [outputRequestedIndex, outputRequestedSize] = outputRequestedRegion; + const auto [outputRequestedIndex, outputRequestedSize] = outputRequestedRegion; // Pad the input image such that the requested region, expanded by // twice the kernel radius, lies entirely within the buffered region. diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx index 3bbd773c57bf..20cb3fe585c0 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx @@ -198,7 +198,7 @@ GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransformGetLargestPossibleRegion(); + const auto [startIndex, size] = field->GetLargestPossibleRegion(); ImageRegionIteratorWithIndex fieldIt(field, field->GetLargestPossibleRegion()); ImageRegionConstIteratorWithIndex smoothedFieldIt(smoothField, diff --git a/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx b/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx index fd80b4d7b943..8a7ba98dddb0 100644 --- a/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx @@ -119,7 +119,7 @@ HalfToFullHermitianImageFilter::DynamicThreadedGenerateData( // Now copy the redundant complex conjugate region, if there is one // in this thread's output region. - auto [outputRegionIndex, outputRegionSize] = outputRegionForThread; + const auto [outputRegionIndex, outputRegionSize] = outputRegionForThread; OutputImageIndexType outputRegionMaximumIndex = outputRegionIndex + outputRegionSize; if (outputRegionMaximumIndex[0] > inputRegionMaximumIndex[0]) @@ -140,7 +140,7 @@ HalfToFullHermitianImageFilter::DynamicThreadedGenerateData( for (unsigned int i = 0; i < ImageDimension; ++i) { OutputImageRegionType outputLargestPossibleRegion = outputPtr->GetLargestPossibleRegion(); - auto [outputLargestPossibleRegionIndex, outputLargestPossibleRegionSize] = outputLargestPossibleRegion; + const auto [outputLargestPossibleRegionIndex, outputLargestPossibleRegionSize] = outputLargestPossibleRegion; if (conjugateIndex[i] != outputLargestPossibleRegionIndex[i]) { index[i] = outputLargestPossibleRegionSize[i] - conjugateIndex[i] + 2 * outputLargestPossibleRegionIndex[i]; diff --git a/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h b/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h index 538f5603cd3c..30c228fd55c3 100644 --- a/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h +++ b/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h @@ -249,7 +249,7 @@ class ITK_TEMPLATE_EXPORT FrequencyShiftedFFTLayoutImageRegionConstIteratorWithI void Init() { - auto [minIndex, sizeImage] = this->m_Image->GetLargestPossibleRegion(); + const auto [minIndex, sizeImage] = this->m_Image->GetLargestPossibleRegion(); for (unsigned int dim = 0; dim < ImageType::ImageDimension; ++dim) { this->m_ZeroFrequencyIndex[dim] = diff --git a/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx index d070afb669fa..fd8abc1af7b3 100644 --- a/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx @@ -36,7 +36,7 @@ CropImageFilter::GenerateOutputInformation() SizeType sz; OutputImageIndexType idx; - auto [input_idx, input_sz] = inputPtr->GetLargestPossibleRegion(); + const auto [input_idx, input_sz] = inputPtr->GetLargestPossibleRegion(); for (unsigned int i = 0; i < InputImageDimension; ++i) { diff --git a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx index 2f9e5f7bd061..921d0f456b37 100644 --- a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx @@ -185,7 +185,7 @@ MirrorPadImageFilter::ConvertOutputIndexToInputIndex( long a, b, c; // Output region goes from a to a+b-1 // Input region goes from c to c+b-1 OutputImageIndexType outputRegionStart = outputRegion.GetIndex(); - auto [inputRegionStart, inputSizes] = inputRegion; + const auto [inputRegionStart, inputSizes] = inputRegion; for (dimCtr = 0; dimCtr < ImageDimension; ++dimCtr) { diff --git a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx index ba813fc81b29..2f3649bb7267 100644 --- a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx @@ -33,7 +33,7 @@ static bool VerifyFilterOutput(const ShortImage * inputImage, const FloatImage * outputImage) { ShortImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - auto [inputIndex, inputSize] = inputRegion; + const auto [inputIndex, inputSize] = inputRegion; ShortImage::RegionType outputRegion = outputImage->GetLargestPossibleRegion(); itk::ImageRegionConstIteratorWithIndex outputIterator(outputImage, outputRegion); @@ -105,10 +105,10 @@ VerifyFilter(const ShortImage * inputImage, } ShortImage::RegionType outputRegion = padFilter->GetOutput()->GetLargestPossibleRegion(); - auto [outputIndex, outputSize] = outputRegion; + const auto [outputIndex, outputSize] = outputRegion; ShortImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - auto [inputIndex, inputSize] = inputRegion; + const auto [inputIndex, inputSize] = inputRegion; ShortImage::IndexType expectedIndex; ShortImage::SizeType expectedSize; diff --git a/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx index 934dc4fd6b1a..e6e690314b8b 100644 --- a/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx @@ -217,11 +217,11 @@ ProjectionImageFilter::DynamicThreadedG typename TInputImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - auto [inputIndex, inputSize] = inputRegion; + const auto [inputIndex, inputSize] = inputRegion; typename TOutputImage::Pointer outputImage = this->GetOutput(); - auto [outputIndexForThread, outputSizeForThread] = outputRegionForThread; + const auto [outputIndexForThread, outputSizeForThread] = outputRegionForThread; // compute the input region for this thread typename TInputImage::RegionType inputRegionForThread = inputRegion; diff --git a/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx index 9be1e89d136d..e1ea39539009 100644 --- a/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx @@ -46,7 +46,7 @@ CropLabelMapFilter::GenerateOutputInformation() SizeType size; IndexType index; - auto [inputIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); + const auto [inputIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); SizeType originalCropSize = m_UpperBoundaryCropSize + m_LowerBoundaryCropSize; diff --git a/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx index a29e7e5e56f7..fee53ddf8d02 100644 --- a/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx @@ -45,7 +45,7 @@ PadLabelMapFilter::GenerateOutputInformation() SizeType size; IndexType index; - auto [inputIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); + const auto [inputIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); SizeType originalPadSize = m_UpperBoundaryPadSize + m_LowerBoundaryPadSize; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx b/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx index 709c8c10bd6c..013ed801292b 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx @@ -45,7 +45,7 @@ NeedToDoFace(const TRegion AllImage, const TRegion face, const TLine line) // find the small dimension of the face - should only be one typename TRegion::IndexType ISt = AllImage.GetIndex(); - auto [FSt, FSz] = face; + const auto [FSt, FSz] = face; unsigned int smallDim = 0; for (unsigned int i = 0; i < AllImage.GetImageDimension(); ++i) @@ -89,7 +89,7 @@ ComputeStartEnd(const typename TImage::IndexType StartIndex, unsigned int & end) { // compute intersection between ray and box - auto [ImStart, ImSize] = AllImage; + const auto [ImStart, ImSize] = AllImage; float Tfar = NumericTraits::max(); float Tnear = NumericTraits::NonpositiveMin(); float domdir = NumericTraits::NonpositiveMin(); diff --git a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index 0bfb6a1486e0..a332e376fbbc 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -118,7 +118,7 @@ BinomialBlurImageFilter::GenerateData() tempPtr->Allocate(); // How big is the input image? - auto [startIndex, size] = inputPtr->GetRequestedRegion(); + const auto [startIndex, size] = inputPtr->GetRequestedRegion(); // Iterator Typedefs for this routine using TempIterator = ImageRegionIterator; diff --git a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx index 17863b624a73..35a5c44fbd66 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx @@ -84,7 +84,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(gdcmIO, seriesWriter->GetImageIO()); ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - auto [start, size] = region; + const auto [start, size] = region; std::string format = outputDirectory; diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx index 75ca0b073bb4..a05bb3a1b717 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx @@ -46,7 +46,7 @@ itkImageFileWriterUpdateLargestPossibleRegionTest(int argc, char * argv[]) writer->SetFileName(argv[2]); ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - auto [index, size] = region; + const auto [index, size] = region; itk::ImageIORegion ioregion(2); ioregion.SetIndex(0, index[0]); diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index b2c2ab40a9d7..2d9aecfa21d0 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -73,7 +73,7 @@ class NbTestClass : public NarrowBandImageFilterBaseGetInput()->GetRequestedRegion(); + const auto [tl, sz] = this->GetInput()->GetRequestedRegion(); typename Superclass::IndexType in; for (in [0] = 32 + tl[0]; in[0] < tl[0] + static_cast(sz[0]); in[0]++) diff --git a/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx b/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx index 467f01d28728..67f3855c61fc 100644 --- a/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx +++ b/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx @@ -101,7 +101,7 @@ SpatialNeighborSubsampler::Search(const InstanceIdentifier & q SizeType searchSize; IndexType endIndex; - auto [constraintIndex, constraintSize] = this->m_RegionConstraint; + const auto [constraintIndex, constraintSize] = this->m_RegionConstraint; IndexType queryIndex; typename RegionType::OffsetTableType offsetTable; diff --git a/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx b/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx index 218b06c7a774..c33224f8f6c4 100644 --- a/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx +++ b/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx @@ -75,7 +75,7 @@ UniformRandomSpatialNeighborSubsampler::Search(const InstanceI IndexType searchStartIndex; IndexType searchEndIndex; - auto [constraintIndex, constraintSize] = this->m_RegionConstraint; + const auto [constraintIndex, constraintSize] = this->m_RegionConstraint; IndexType queryIndex; typename RegionType::OffsetTableType offsetTable; diff --git a/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx b/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx index 657edff43830..0c000ba1a18e 100644 --- a/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx +++ b/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx @@ -227,7 +227,7 @@ MultiResolutionImageRegistrationMethod::PreparePyrami ScheduleType movingschedule = m_MovingImagePyramid->GetSchedule(); itkDebugMacro("MovingImage schedule: " << movingschedule); - auto [inputStart, inputSize] = m_FixedImageRegion; + const auto [inputStart, inputSize] = m_FixedImageRegion; const SizeValueType numberOfLevels = m_FixedImagePyramid->GetNumberOfLevels(); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx index 88215382ece3..467f65373c3e 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx @@ -776,7 +776,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< gradientField->SetRegions(virtualDomainImage->GetRequestedRegion()); gradientField->Allocate(); - auto [gradientFieldIndex, gradientFieldSize] = gradientField->GetRequestedRegion(); + const auto [gradientFieldIndex, gradientFieldSize] = gradientField->GetRequestedRegion(); SizeValueType localCount = 0; for (ImageRegionConstIteratorWithOnlyIndex ItG(gradientField, diff --git a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx index cc3a3ed22c3e..ebbf1a4661db 100644 --- a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx @@ -350,7 +350,7 @@ ParallelSparseFieldLevelSetImageFilter::ConstructActi ValueType value; StatusType layer_number; - auto [startIndex, regionSize] = m_OutputImage->GetRequestedRegion(); + const auto [startIndex, regionSize] = m_OutputImage->GetRequestedRegion(); using StartIndexValueType = IndexValueType; for (NeighborhoodIterator outputIt( diff --git a/Modules/Video/Core/include/itkImageToVideoFilter.hxx b/Modules/Video/Core/include/itkImageToVideoFilter.hxx index 0c4ce14b94fb..e691fd7e7df6 100644 --- a/Modules/Video/Core/include/itkImageToVideoFilter.hxx +++ b/Modules/Video/Core/include/itkImageToVideoFilter.hxx @@ -99,7 +99,7 @@ ImageToVideoFilter::GenerateOutputInformation() // Get first input frame's largest possible spatial region InputImageRegionType inputRegion = input->GetLargestPossibleRegion(); - auto [inputIndex, inputSize] = inputRegion; + const auto [inputIndex, inputSize] = inputRegion; typename InputImageType::SpacingType inputSpacing = input->GetSpacing(); typename InputImageType::PointType inputOrigin = input->GetOrigin();