diff --git a/Modules/Bridge/VTK/include/itkVTKImageExport.hxx b/Modules/Bridge/VTK/include/itkVTKImageExport.hxx index c6fcc23a94fc..eb97c368acef 100644 --- a/Modules/Bridge/VTK/include/itkVTKImageExport.hxx +++ b/Modules/Bridge/VTK/include/itkVTKImageExport.hxx @@ -145,8 +145,7 @@ VTKImageExport::WholeExtentCallback() } InputRegionType region = input->GetLargestPossibleRegion(); - InputSizeType size = region.GetSize(); - InputIndexType index = region.GetIndex(); + auto [index, size] = region; unsigned int i = 0; // Fill in the known portion of the extent. @@ -387,8 +386,7 @@ VTKImageExport::DataExtentCallback() } InputRegionType region = input->GetBufferedRegion(); - InputSizeType size = region.GetSize(); - InputIndexType index = region.GetIndex(); + 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 5e53427ecf3b..06847f12ec16 100644 --- a/Modules/Bridge/VTK/include/itkVTKImageImport.hxx +++ b/Modules/Bridge/VTK/include/itkVTKImageImport.hxx @@ -113,8 +113,7 @@ VTKImageImport::PropagateRequestedRegion(DataObject * outputPtr) if (m_PropagateUpdateExtentCallback) { OutputRegionType region = output->GetRequestedRegion(); - OutputSizeType size = region.GetSize(); - OutputIndexType index = region.GetIndex(); + auto [index, size] = region; int updateExtent[6]; unsigned int i = 0; diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx index 5dc14d963645..fbba888a3667 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx @@ -392,10 +392,8 @@ ConstNeighborhoodIterator::SetRegion(const RegionTyp m_End = m_ConstImage->GetBufferPointer() + m_ConstImage->ComputeOffset(m_EndIndex); // now determine whether boundary conditions are going to be needed - const IndexType bStart = m_ConstImage->GetBufferedRegion().GetIndex(); - const SizeType bSize = m_ConstImage->GetBufferedRegion().GetSize(); - const IndexType rStart = region.GetIndex(); - const SizeType rSize = region.GetSize(); + const auto [bStart, bSize] = m_ConstImage->GetBufferedRegion(); + const auto [rStart, rSize] = region; m_NeedToUseBoundaryCondition = false; for (DimensionValueType i = 0; i < Dimension; ++i) @@ -627,8 +625,7 @@ ConstNeighborhoodIterator::SetBound(const SizeType & { SizeType radius = this->GetRadius(); const OffsetValueType * offset = m_ConstImage->GetOffsetTable(); - const IndexType imageBRStart = m_ConstImage->GetBufferedRegion().GetIndex(); - SizeType imageBRSize = m_ConstImage->GetBufferedRegion().GetSize(); + auto [imageBRStart, imageBRSize] = m_ConstImage->GetBufferedRegion(); // Set the bounds and the wrapping offsets. Inner bounds are the loop // indices where the iterator will begin to overlap the edge of the image diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx index 2d87290e5aa5..2542a5f05542 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx @@ -205,10 +205,8 @@ ConstNeighborhoodIteratorWithOnlyIndex::Initialize(const SizeType & ra this->SetEndIndex(); // now determine whether boundary conditions are going to be needed - const IndexType bStart = ptr->GetBufferedRegion().GetIndex(); - const SizeType bSize = ptr->GetBufferedRegion().GetSize(); - const IndexType rStart = region.GetIndex(); - const SizeType rSize = region.GetSize(); + const auto [bStart, bSize] = ptr->GetBufferedRegion(); + const auto [rStart, rSize] = region; m_NeedToUseBoundaryCondition = false; for (DimensionValueType i = 0; i < Dimension; ++i) @@ -456,9 +454,8 @@ template void ConstNeighborhoodIteratorWithOnlyIndex::SetBound(const SizeType & size) { - SizeType radius = this->GetRadius(); - const IndexType imageBRStart = m_ConstImage->GetBufferedRegion().GetIndex(); - SizeType imageBRSize = m_ConstImage->GetBufferedRegion().GetSize(); + SizeType radius = this->GetRadius(); + auto [imageBRStart, imageBRSize] = m_ConstImage->GetBufferedRegion(); // Set the bounds and the wrapping offsets. Inner bounds are the loop // indices where the iterator will begin to overlap the edge of the image diff --git a/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx b/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx index db0f2d8279c6..4925234b6894 100644 --- a/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx +++ b/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx @@ -49,10 +49,8 @@ ImageBoundaryFacesCalculator::Compute(const TImage & img, RegionType reg return result; } - const IndexType bStart = bufferedRegion.GetIndex(); - const SizeType bSize = bufferedRegion.GetSize(); - const IndexType rStart = regionToProcess.GetIndex(); - const SizeType rSize = regionToProcess.GetSize(); + const auto [bStart, bSize] = bufferedRegion; + const auto [rStart, rSize] = regionToProcess; SizeType nbSize = rSize; // Non-boundary region IndexType nbStart = rStart; // data. diff --git a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx index caba00b56586..39eea96f0d3a 100644 --- a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx @@ -138,11 +138,9 @@ PeriodicBoundaryCondition::GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const -> RegionType { - IndexType imageIndex = inputLargestPossibleRegion.GetIndex(); - SizeType imageSize = inputLargestPossibleRegion.GetSize(); + auto [imageIndex, imageSize] = inputLargestPossibleRegion; - IndexType outputIndex = outputRequestedRegion.GetIndex(); - SizeType outputSize = outputRequestedRegion.GetSize(); + auto [outputIndex, outputSize] = outputRequestedRegion; IndexType inputRequestedIndex; SizeType inputRequestedSize; @@ -184,8 +182,7 @@ PeriodicBoundaryCondition::GetPixel(const IndexType & -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); - IndexType imageIndex = imageRegion.GetIndex(); - SizeType imageSize = imageRegion.GetSize(); + auto [imageIndex, imageSize] = imageRegion; IndexType lookupIndex; diff --git a/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx b/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx index b2f07b1ed1d3..f7a1ea29390b 100644 --- a/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.hxx @@ -86,11 +86,9 @@ ZeroFluxNeumannBoundaryCondition::GetInputRequestedRe const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const -> RegionType { - IndexType inputIndex = inputLargestPossibleRegion.GetIndex(); - SizeType inputSize = inputLargestPossibleRegion.GetSize(); + auto [inputIndex, inputSize] = inputLargestPossibleRegion; - IndexType outputIndex = outputRequestedRegion.GetIndex(); - SizeType outputSize = outputRequestedRegion.GetSize(); + auto [outputIndex, outputSize] = outputRequestedRegion; IndexType requestIndex; SizeType requestSize; @@ -156,8 +154,7 @@ ZeroFluxNeumannBoundaryCondition::GetPixel(const Inde -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); - IndexType imageIndex = imageRegion.GetIndex(); - SizeType imageSize = imageRegion.GetSize(); + auto [imageIndex, imageSize] = imageRegion; IndexType lookupIndex; diff --git a/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx b/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx index 6d7984088e68..48292018cd4b 100644 --- a/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUImageDataManager.hxx @@ -33,8 +33,7 @@ GPUImageDataManager::SetImagePointer(ImageType * img) using SizeType = typename ImageType::SizeType; RegionType region = m_Image->GetBufferedRegion(); - IndexType index = region.GetIndex(); - SizeType size = region.GetSize(); + 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 e5fa893c9db9..7099fffc353c 100644 --- a/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkGaussianInterpolateImageFunction.hxx @@ -58,8 +58,7 @@ GaussianInterpolateImageFunction::ComputeBoundingBox() typename InputImageType::ConstPointer input = this->GetInputImage(); typename InputImageType::SpacingType spacing = input->GetSpacing(); - typename InputImageType::IndexType index = input->GetLargestPossibleRegion().GetIndex(); - typename InputImageType::SizeType size = input->GetLargestPossibleRegion().GetSize(); + 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 5ea83e60bd3f..9211c61aed55 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx @@ -161,10 +161,9 @@ SpatialObjectToImageStatisticsCalculatorTransformPhysicalPointToIndex(ptMin); - auto indMax = m_Image->TransformPhysicalPointToIndex(ptMax); - IndexType imageIndex = m_Image->GetLargestPossibleRegion().GetIndex(); - SizeType imageSize = m_Image->GetLargestPossibleRegion().GetSize(); + auto indMin = m_Image->TransformPhysicalPointToIndex(ptMin); + auto indMax = m_Image->TransformPhysicalPointToIndex(ptMax); + 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 bce52154eb29..434127772f70 100644 --- a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx @@ -599,8 +599,7 @@ MRIBiasFieldCorrectionFilter::CorrectInte IndexValueType lastSlice = region.GetIndex()[m_SlicingDirection] + static_cast(region.GetSize()[m_SlicingDirection]); InputImageRegionType sliceRegion; - InputImageIndexType index = region.GetIndex(); - InputImageSizeType size = region.GetSize(); + auto [index, size] = region; sliceRegion.SetSize(size); BiasFieldType bias = this->EstimateBiasField(sliceRegion, 0, m_InterSliceCorrectionMaximumIteration); @@ -882,8 +881,7 @@ MRIBiasFieldCorrectionFilter::AdjustSlabR SlabRegionVectorType & slabs, OutputImageRegionType requestedRegion) { - OutputImageIndexType indexFirst = requestedRegion.GetIndex(); - OutputImageSizeType size = requestedRegion.GetSize(); + auto [indexFirst, size] = requestedRegion; OutputImageIndexType indexLast = indexFirst; for (SizeValueType i = 0; i < ImageDimension; ++i) diff --git a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.hxx b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.hxx index 6f03d1618b2c..bf1eab4374bf 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.hxx +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.hxx @@ -54,8 +54,7 @@ ConvolutionImageFilterBase::GetValidReg InputRegionType inputLargestPossibleRegion = inputPtr->GetLargestPossibleRegion(); - OutputIndexType validIndex = inputLargestPossibleRegion.GetIndex(); - OutputSizeType validSize = inputLargestPossibleRegion.GetSize(); + auto [validIndex, validSize] = inputLargestPossibleRegion; // Shrink the output largest possible region by the kernel radius. KernelSizeType kernelSize = this->GetKernelImage()->GetLargestPossibleRegion().GetSize(); diff --git a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx index 7219745fa8ec..4fb4013f5d74 100644 --- a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx @@ -149,15 +149,12 @@ FFTConvolutionImageFilterGetLargestPossibleRegion(); - InputSizeType inputLargestSize = inputLargestRegion.GetSize(); - InputIndexType inputLargestIndex = inputLargestRegion.GetIndex(); - InputRegionType inputRequestedRegion = input->GetRequestedRegion(); - InputSizeType inputRequestedSize = inputRequestedRegion.GetSize(); - InputIndexType inputRequestedIndex = inputRequestedRegion.GetIndex(); + InputRegionType inputLargestRegion = input->GetLargestPossibleRegion(); + auto [inputLargestIndex, inputLargestSize] = inputLargestRegion; + InputRegionType inputRequestedRegion = input->GetRequestedRegion(); + auto [inputRequestedIndex, inputRequestedSize] = inputRequestedRegion; OutputRegionType outputRequestedRegion = this->GetOutput()->GetRequestedRegion(); - OutputSizeType outputRequestedSize = outputRequestedRegion.GetSize(); - OutputIndexType outputRequestedIndex = outputRequestedRegion.GetIndex(); + 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/itkGaussianExponentialDiffeomorphicTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx index 206d6929d165..4a9b67436885 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx @@ -191,8 +191,7 @@ GaussianExponentialDiffeomorphicTransform::Gau ScalarType weight2 = 1.0 - weight1; const typename ConstantVelocityFieldType::RegionType region = field->GetLargestPossibleRegion(); - const typename ConstantVelocityFieldType::SizeType size = region.GetSize(); - const typename ConstantVelocityFieldType::IndexType startIndex = region.GetIndex(); + const auto [startIndex, size] = region; ImageRegionIteratorWithIndex fieldIt(field, field->GetLargestPossibleRegion()); ImageRegionConstIteratorWithIndex smoothedFieldIt(smoothField, diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx index f10ff333fe89..263f4d08c36a 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx @@ -184,8 +184,7 @@ GaussianSmoothingOnUpdateDisplacementFieldTransformGetLargestPossibleRegion(); - const typename DisplacementFieldType::SizeType size = region.GetSize(); - const typename DisplacementFieldType::IndexType startIndex = region.GetIndex(); + const auto [startIndex, size] = region; ImageRegionIteratorWithIndex fieldIt(field, field->GetLargestPossibleRegion()); ImageRegionConstIteratorWithIndex smoothedFieldIt(smoothField, diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx index 43ab17477370..2a1e2c45b5e5 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx @@ -199,8 +199,7 @@ GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransformGetLargestPossibleRegion().GetSize(); - TimeVaryingVelocityFieldIndexType startIndex = field->GetLargestPossibleRegion().GetIndex(); + auto [startIndex, size] = field->GetLargestPossibleRegion(); ImageRegionIteratorWithIndex fieldIt(field, field->GetLargestPossibleRegion()); ImageRegionConstIteratorWithIndex smoothedFieldIt(smoothField, diff --git a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx index 94b1d7bf9b58..f2b59d3fffe7 100644 --- a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx @@ -169,9 +169,8 @@ void InvertDisplacementFieldImageFilter::DynamicThreadedGenerateData(const RegionType & region) { const typename DisplacementFieldType::RegionType fullRegion = this->m_ComposedField->GetRequestedRegion(); - const typename DisplacementFieldType::SizeType size = fullRegion.GetSize(); - const typename DisplacementFieldType::IndexType startIndex = fullRegion.GetIndex(); - const typename DisplacementFieldType::PixelType zeroVector{}; + const auto [startIndex, size] = fullRegion; + const typename DisplacementFieldType::PixelType zeroVector{}; ImageRegionIterator ItE(this->m_ComposedField, region); ImageRegionIterator ItS(this->m_ScaledNormImage, region); diff --git a/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldIntegrationImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldIntegrationImageFilter.hxx index 4e19482db0ba..322bd11ccc14 100644 --- a/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldIntegrationImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldIntegrationImageFilter.hxx @@ -190,8 +190,7 @@ TimeVaryingVelocityFieldIntegrationImageFilterGetLargestPossibleRegion(); - typename RegionType::IndexType lastIndex = region.GetIndex(); - typename RegionType::SizeType size = region.GetSize(); + auto [lastIndex, size] = region; for (unsigned int d = 0; d < InputImageDimension; ++d) { lastIndex[d] += (size[d] - 1); diff --git a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx index 44f4e7c4ac59..0c8d3d6e5095 100644 --- a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx @@ -53,8 +53,7 @@ SignedMaurerDistanceMapImageFilter::SplitRequestedReg const OutputSizeType & requestedRegionSize = splitRegion.GetSize(); - OutputIndexType splitIndex = splitRegion.GetIndex(); - OutputSizeType splitSize = splitRegion.GetSize(); + auto [splitIndex, splitSize] = splitRegion; // split on the outermost dimension available // and avoid the current dimension diff --git a/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx b/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx index 772f359c295f..fd80b4d7b943 100644 --- a/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx @@ -119,8 +119,7 @@ HalfToFullHermitianImageFilter::DynamicThreadedGenerateData( // Now copy the redundant complex conjugate region, if there is one // in this thread's output region. - OutputImageIndexType outputRegionIndex = outputRegionForThread.GetIndex(); - OutputImageSizeType outputRegionSize = outputRegionForThread.GetSize(); + auto [outputRegionIndex, outputRegionSize] = outputRegionForThread; OutputImageIndexType outputRegionMaximumIndex = outputRegionIndex + outputRegionSize; if (outputRegionMaximumIndex[0] > inputRegionMaximumIndex[0]) @@ -141,8 +140,7 @@ HalfToFullHermitianImageFilter::DynamicThreadedGenerateData( for (unsigned int i = 0; i < ImageDimension; ++i) { OutputImageRegionType outputLargestPossibleRegion = outputPtr->GetLargestPossibleRegion(); - OutputImageIndexType outputLargestPossibleRegionIndex = outputLargestPossibleRegion.GetIndex(); - OutputImageSizeType outputLargestPossibleRegionSize = outputLargestPossibleRegion.GetSize(); + auto [outputLargestPossibleRegionIndex, outputLargestPossibleRegionSize] = outputLargestPossibleRegion; if (conjugateIndex[i] != outputLargestPossibleRegionIndex[i]) { index[i] = outputLargestPossibleRegionSize[i] - conjugateIndex[i] + 2 * outputLargestPossibleRegionIndex[i]; diff --git a/Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.hxx b/Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.hxx index 857e7a299f2f..298799336a0b 100644 --- a/Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.hxx @@ -43,8 +43,7 @@ RealToHalfHermitianForwardFFTImageFilter::GenerateOut // This is all based on the same function in itk::ShrinkImageFilter // ShrinkImageFilter also modifies the image spacing, but spacing // has no meaning in the result of an FFT. - const InputSizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize(); - const InputIndexType inputStartIndex = inputPtr->GetLargestPossibleRegion().GetIndex(); + const auto [inputStartIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); OutputSizeType outputSize; OutputIndexType outputStartIndex; diff --git a/Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.hxx b/Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.hxx index 80509d81ac9d..82bac3847d47 100644 --- a/Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.hxx @@ -41,10 +41,8 @@ VnlHalfHermitianToRealInverseFFTImageFilter::Generate // reports the beginning and the end of the process. ProgressReporter progress(this, 0, 1); - const InputSizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize(); - const InputIndexType inputIndex = inputPtr->GetLargestPossibleRegion().GetIndex(); - const OutputSizeType outputSize = outputPtr->GetLargestPossibleRegion().GetSize(); - const OutputIndexType outputIndex = outputPtr->GetLargestPossibleRegion().GetIndex(); + const auto [inputIndex, inputSize] = inputPtr->GetLargestPossibleRegion(); + const auto [outputIndex, outputSize] = outputPtr->GetLargestPossibleRegion(); // Allocate output buffer memory outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); diff --git a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx index aa3583041644..fc9196246b93 100644 --- a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx @@ -146,8 +146,7 @@ MaskFeaturePointSelectionFilter::GenerateData() } // set safe region for picking feature points depending on whether tensors are computed - IndexType safeIndex = region.GetIndex(); - SizeType safeSize = region.GetSize(); + auto [safeIndex, safeSize] = region; if (m_ComputeStructureTensors) { diff --git a/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h b/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h index a0bec95e5528..538f5603cd3c 100644 --- a/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h +++ b/Modules/Filtering/ImageFrequency/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h @@ -249,8 +249,7 @@ class ITK_TEMPLATE_EXPORT FrequencyShiftedFFTLayoutImageRegionConstIteratorWithI void Init() { - IndexType minIndex = this->m_Image->GetLargestPossibleRegion().GetIndex(); - SizeType sizeImage = this->m_Image->GetLargestPossibleRegion().GetSize(); + 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 b9dfb9a91416..d070afb669fa 100644 --- a/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkCropImageFilter.hxx @@ -36,8 +36,7 @@ CropImageFilter::GenerateOutputInformation() SizeType sz; OutputImageIndexType idx; - InputImageSizeType input_sz = inputPtr->GetLargestPossibleRegion().GetSize(); - InputImageIndexType input_idx = inputPtr->GetLargestPossibleRegion().GetIndex(); + auto [input_idx, input_sz] = inputPtr->GetLargestPossibleRegion(); for (unsigned int i = 0; i < InputImageDimension; ++i) { diff --git a/Modules/Filtering/ImageGrid/include/itkCyclicShiftImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkCyclicShiftImageFilter.hxx index c7c42a7e5ffc..3d5efeea078e 100644 --- a/Modules/Filtering/ImageGrid/include/itkCyclicShiftImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkCyclicShiftImageFilter.hxx @@ -57,8 +57,7 @@ CyclicShiftImageFilter::DynamicThreadedGenerateData( const InputImageType * inputImage = this->GetInput(); // The index and size of the image needed to compute the shift - const IndexType outIdx = this->GetOutput()->GetLargestPossibleRegion().GetIndex(); - const SizeType outSize = this->GetOutput()->GetLargestPossibleRegion().GetSize(); + const auto [outIdx, outSize] = this->GetOutput()->GetLargestPossibleRegion(); TotalProgressReporter progress(this, this->GetOutput()->GetRequestedRegion().GetNumberOfPixels()); diff --git a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx index 5a6748f4f8de..2f9e5f7bd061 100644 --- a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx @@ -39,10 +39,9 @@ MirrorPadImageFilter::GenerateNextOutputRegion(long * std::vector * sizes, OutputImageRegionType & outputRegion) { - unsigned int ctr; - int done = 0; - OutputImageIndexType nextIndex = outputRegion.GetIndex(); - OutputImageSizeType nextSize = outputRegion.GetSize(); + unsigned int ctr; + int done = 0; + auto [nextIndex, nextSize] = outputRegion; // // Starting at the first dimension, increment the counter and set a new @@ -96,10 +95,9 @@ MirrorPadImageFilter::GenerateNextInputRegion(long * std::vector * sizes, InputImageRegionType & inputRegion) { - unsigned int ctr; - int done = 0; - InputImageIndexType nextIndex = inputRegion.GetIndex(); - InputImageSizeType nextSize = inputRegion.GetSize(); + unsigned int ctr; + int done = 0; + auto [nextIndex, nextSize] = inputRegion; // // Starting at the first dimension, increment the counter and set a new @@ -187,8 +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(); - InputImageIndexType inputRegionStart = inputRegion.GetIndex(); - InputImageSizeType inputSizes = inputRegion.GetSize(); + auto [inputRegionStart, inputSizes] = inputRegion; for (dimCtr = 0; dimCtr < ImageDimension; ++dimCtr) { diff --git a/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.hxx index 28807410136c..ff2ced950f3a 100644 --- a/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkSliceBySliceImageFilter.hxx @@ -226,8 +226,7 @@ SliceBySliceImageFilterAllocateOutputs(); const RegionType requestedRegion = this->GetOutput(0)->GetRequestedRegion(); - const IndexType requestedIndex = requestedRegion.GetIndex(); - const SizeType requestedSize = requestedRegion.GetSize(); + const auto [requestedIndex, requestedSize] = requestedRegion; InternalRegionType internalOutputRegion; InternalRegionType internalInputRegion; diff --git a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx index 580bb555b202..ba813fc81b29 100644 --- a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx @@ -33,8 +33,7 @@ static bool VerifyFilterOutput(const ShortImage * inputImage, const FloatImage * outputImage) { ShortImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - ShortImage::IndexType inputIndex = inputRegion.GetIndex(); - ShortImage::SizeType inputSize = inputRegion.GetSize(); + auto [inputIndex, inputSize] = inputRegion; ShortImage::RegionType outputRegion = outputImage->GetLargestPossibleRegion(); itk::ImageRegionConstIteratorWithIndex outputIterator(outputImage, outputRegion); @@ -106,12 +105,10 @@ VerifyFilter(const ShortImage * inputImage, } ShortImage::RegionType outputRegion = padFilter->GetOutput()->GetLargestPossibleRegion(); - ShortImage::IndexType outputIndex = outputRegion.GetIndex(); - ShortImage::SizeType outputSize = outputRegion.GetSize(); + auto [outputIndex, outputSize] = outputRegion; ShortImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - ShortImage::IndexType inputIndex = inputRegion.GetIndex(); - ShortImage::SizeType inputSize = inputRegion.GetSize(); + auto [inputIndex, inputSize] = inputRegion; ShortImage::IndexType expectedIndex; ShortImage::SizeType expectedSize; diff --git a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx index b0767ce61f3f..0a3a392557f3 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx @@ -157,8 +157,7 @@ AccumulateImageFilter::GenerateData() outputIterType outputIter(outputImage, outputImage->GetBufferedRegion()); using inputIterType = ImageRegionConstIterator; - typename TInputImage::SizeType AccumulatedSize = inputImage->GetLargestPossibleRegion().GetSize(); - typename TInputImage::IndexType AccumulatedIndex = inputImage->GetLargestPossibleRegion().GetIndex(); + auto [AccumulatedIndex, AccumulatedSize] = inputImage->GetLargestPossibleRegion(); typename TInputImage::SizeValueType SizeAccumulateDimension = AccumulatedSize[m_AccumulateDimension]; const auto sizeAccumulateDimensionDouble = static_cast(SizeAccumulateDimension); diff --git a/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx index 506f4ca7fdc5..934dc4fd6b1a 100644 --- a/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx @@ -217,13 +217,11 @@ ProjectionImageFilter::DynamicThreadedG typename TInputImage::RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - typename TInputImage::SizeType inputSize = inputRegion.GetSize(); - typename TInputImage::IndexType inputIndex = inputRegion.GetIndex(); + auto [inputIndex, inputSize] = inputRegion; typename TOutputImage::Pointer outputImage = this->GetOutput(); - typename TOutputImage::SizeType outputSizeForThread = outputRegionForThread.GetSize(); - typename TOutputImage::IndexType outputIndexForThread = outputRegionForThread.GetIndex(); + 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 c0d521ab002e..9be1e89d136d 100644 --- a/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkCropLabelMapFilter.hxx @@ -46,8 +46,7 @@ CropLabelMapFilter::GenerateOutputInformation() SizeType size; IndexType index; - SizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize(); - IndexType inputIndex = inputPtr->GetLargestPossibleRegion().GetIndex(); + 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 6c7673f1682b..a29e7e5e56f7 100644 --- a/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkPadLabelMapFilter.hxx @@ -45,8 +45,7 @@ PadLabelMapFilter::GenerateOutputInformation() SizeType size; IndexType index; - SizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize(); - IndexType inputIndex = inputPtr->GetLargestPossibleRegion().GetIndex(); + 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 5b26410bbea0..9aac9d070f91 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx @@ -45,8 +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(); - typename TRegion::SizeType FSz = face.GetSize(); - typename TRegion::IndexType FSt = face.GetIndex(); + auto [FSt, FSz] = face; unsigned int smallDim = 0; for (unsigned int i = 0; i < AllImage.GetImageDimension(); ++i) @@ -90,13 +89,12 @@ ComputeStartEnd(const typename TImage::IndexType StartIndex, unsigned int & end) { // compute intersection between ray and box - typename TImage::IndexType ImStart = AllImage.GetIndex(); - typename TImage::SizeType ImSize = AllImage.GetSize(); - float Tfar = NumericTraits::max(); - float Tnear = NumericTraits::NonpositiveMin(); - float domdir = NumericTraits::NonpositiveMin(); - int sPos, ePos; - unsigned int perpdir = 0; + auto [ImStart, ImSize] = AllImage; + float Tfar = NumericTraits::max(); + float Tnear = NumericTraits::NonpositiveMin(); + float domdir = NumericTraits::NonpositiveMin(); + int sPos, ePos; + unsigned int perpdir = 0; for (unsigned int i = 0; i < TImage::RegionType::ImageDimension; ++i) { const auto abs_line_elmt_tmp = itk::Math::abs(line[i]); @@ -306,8 +304,7 @@ MakeEnlargedFace(const typename TInputImage::ConstPointer itkNotUsed(input), for (unsigned int i = 0; i < TInputImage::ImageDimension; ++i) { RegionType R1, R2; - SizeType S1 = AllImage.GetSize(); - IndexType I2 = AllImage.GetIndex(); + auto [I2, S1] = AllImage; S1[i] = 1; R1 = AllImage; @@ -386,9 +383,8 @@ MakeEnlargedFace(const typename TInputImage::ConstPointer itkNotUsed(input), } // figure out how much extra each other dimension needs to be extended - typename TInputImage::SizeType NewSize = RelevantRegion.GetSize(); - typename TInputImage::IndexType NewStart = RelevantRegion.GetIndex(); - unsigned int NonFaceLen = AllImage.GetSize()[NonFaceDim]; + auto [NewStart, NewSize] = RelevantRegion; + unsigned int NonFaceLen = AllImage.GetSize()[NonFaceDim]; for (unsigned int i = 0; i < TInputImage::RegionType::ImageDimension; ++i) { if (i != NonFaceDim) diff --git a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index aa27f2f586bc..0bfb6a1486e0 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -118,8 +118,7 @@ BinomialBlurImageFilter::GenerateData() tempPtr->Allocate(); // How big is the input image? - typename TInputImage::SizeType size = inputPtr->GetRequestedRegion().GetSize(); - typename TInputImage::IndexType startIndex = inputPtr->GetRequestedRegion().GetIndex(); + 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 b0b4e6269e59..17863b624a73 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx @@ -84,8 +84,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(gdcmIO, seriesWriter->GetImageIO()); ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - ImageType::IndexType start = region.GetIndex(); - ImageType::SizeType size = region.GetSize(); + 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 e100274a298b..75ca0b073bb4 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx @@ -46,8 +46,7 @@ itkImageFileWriterUpdateLargestPossibleRegionTest(int argc, char * argv[]) writer->SetFileName(argv[2]); ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - ImageType::IndexType index = region.GetIndex(); - ImageType::SizeType size = region.GetSize(); + auto [index, size] = region; itk::ImageIORegion ioregion(2); ioregion.SetIndex(0, index[0]); diff --git a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx index 13eed8cdc3a0..970eedc05abe 100644 --- a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx @@ -79,8 +79,7 @@ DirectFourierReconstructionImageToImageFilter::Genera } RegionType inputRegion = inputImage->GetLargestPossibleRegion(); - IndexType inputStart = inputRegion.GetIndex(); - SizeType inputSize = inputRegion.GetSize(); + auto [inputStart, inputSize] = inputRegion; IndexType outputStart; SizeType outputSize; @@ -131,8 +130,7 @@ DirectFourierReconstructionImageToImageFilter::Genera // request maximum angular and radial information / to be optimized - SizeType inputSize = inputImage->GetLargestPossibleRegion().GetSize(); - IndexType inputStart = inputImage->GetLargestPossibleRegion().GetIndex(); + auto [inputStart, inputSize] = inputImage->GetLargestPossibleRegion(); // crop to requested z-axis inputSize[m_ZDirection] = outputImage->GetRequestedRegion().GetSize()[2]; @@ -162,8 +160,7 @@ DirectFourierReconstructionImageToImageFilter::Genera // Crop angular input image size to 180 degrees typename InputImageType::RegionType inputROI = m_InputRequestedRegion; - typename InputImageType::SizeType inputROISize = inputROI.GetSize(); - typename InputImageType::IndexType inputROIStart = inputROI.GetIndex(); + auto [inputROIStart, inputROISize] = inputROI; // the number of projections needed to cover 180 degrees const auto alpha_size = Math::Floor((180 * (inputROISize[m_AlphaDirection])) / m_AlphaRange); diff --git a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx index 0eec0cc4c91b..83c83a53a563 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx @@ -230,8 +230,7 @@ itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) function->SetInterpolationMode(HessianGaussianImageFunctionType::InterpolationModeEnum::LinearInterpolation); const ImageType * inputImage = reader->GetOutput(); typename ImageType::RegionType region = inputImage->GetBufferedRegion(); - typename ImageType::SizeType size = region.GetSize(); - typename ImageType::IndexType index = region.GetIndex(); + auto [index, size] = region; // Aim for the pixel at the center of the image for (unsigned int i = 0; i < Dimension; ++i) { diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index 2eaefa6f41b1..b2c2ab40a9d7 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -73,8 +73,7 @@ class NbTestClass : public NarrowBandImageFilterBaseGetInput()->GetRequestedRegion().GetSize(); - typename ImageType::IndexType tl = this->GetInput()->GetRequestedRegion().GetIndex(); + 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 540226da5d7b..467f01d28728 100644 --- a/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx +++ b/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx @@ -101,8 +101,7 @@ SpatialNeighborSubsampler::Search(const InstanceIdentifier & q SizeType searchSize; IndexType endIndex; - IndexType constraintIndex = this->m_RegionConstraint.GetIndex(); - SizeType constraintSize = this->m_RegionConstraint.GetSize(); + 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 b76f73b74a04..218b06c7a774 100644 --- a/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx +++ b/Modules/Numerics/Statistics/include/itkUniformRandomSpatialNeighborSubsampler.hxx @@ -75,8 +75,7 @@ UniformRandomSpatialNeighborSubsampler::Search(const InstanceI IndexType searchStartIndex; IndexType searchEndIndex; - IndexType constraintIndex = this->m_RegionConstraint.GetIndex(); - SizeType constraintSize = this->m_RegionConstraint.GetSize(); + 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 4530d4ad2209..657edff43830 100644 --- a/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx +++ b/Modules/Registration/Common/include/itkMultiResolutionImageRegistrationMethod.hxx @@ -227,8 +227,7 @@ MultiResolutionImageRegistrationMethod::PreparePyrami ScheduleType movingschedule = m_MovingImagePyramid->GetSchedule(); itkDebugMacro("MovingImage schedule: " << movingschedule); - SizeType inputSize = m_FixedImageRegion.GetSize(); - IndexType inputStart = m_FixedImageRegion.GetIndex(); + auto [inputStart, inputSize] = m_FixedImageRegion; const SizeValueType numberOfLevels = m_FixedImagePyramid->GetNumberOfLevels(); diff --git a/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx b/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx index f7e82c812ea0..552079738be2 100644 --- a/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx +++ b/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx @@ -422,8 +422,7 @@ MultiResolutionPyramidImageFilter::GenerateOutputRequ IndexType outputIndex; SizeType outputSize; RegionType outputRegion; - IndexType baseIndex = ptr->GetRequestedRegion().GetIndex(); - SizeType baseSize = ptr->GetRequestedRegion().GetSize(); + auto [baseIndex, baseSize] = ptr->GetRequestedRegion(); for (idim = 0; idim < TOutputImage::ImageDimension; ++idim) { @@ -487,8 +486,7 @@ MultiResolutionPyramidImageFilter::GenerateInputReque using RegionType = typename OutputImageType::RegionType; unsigned int refLevel = m_NumberOfLevels - 1; - SizeType baseSize = this->GetOutput(refLevel)->GetRequestedRegion().GetSize(); - IndexType baseIndex = this->GetOutput(refLevel)->GetRequestedRegion().GetIndex(); + auto [baseIndex, baseSize] = this->GetOutput(refLevel)->GetRequestedRegion(); unsigned int idim; for (idim = 0; idim < ImageDimension; ++idim) diff --git a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx index da780a8ca59d..a46369aeb1b3 100644 --- a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx +++ b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx @@ -353,8 +353,7 @@ RecursiveMultiResolutionPyramidImageFilter::GenerateI using RegionType = typename OutputImageType::RegionType; unsigned int refLevel = this->GetNumberOfLevels() - 1; - SizeType baseSize = this->GetOutput(refLevel)->GetRequestedRegion().GetSize(); - IndexType baseIndex = this->GetOutput(refLevel)->GetRequestedRegion().GetIndex(); + auto [baseIndex, baseSize] = this->GetOutput(refLevel)->GetRequestedRegion(); unsigned int idim; for (idim = 0; idim < ImageDimension; ++idim) diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx index 3d0d8c039c37..974fa07c93d4 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx @@ -792,8 +792,7 @@ typename SyNImageRegistrationMethodGetLargestPossibleRegion(); - const typename DisplacementFieldType::SizeType size = region.GetSize(); - const typename DisplacementFieldType::IndexType startIndex = region.GetIndex(); + const auto [startIndex, size] = region; ImageRegionConstIteratorWithIndex ItF(field, field->GetLargestPossibleRegion()); ImageRegionIteratorWithIndex ItS(smoothField, smoothField->GetLargestPossibleRegion()); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx index 460185a1e971..88215382ece3 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx @@ -776,8 +776,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< gradientField->SetRegions(virtualDomainImage->GetRequestedRegion()); gradientField->Allocate(); - typename DisplacementFieldType::IndexType gradientFieldIndex = gradientField->GetRequestedRegion().GetIndex(); - typename DisplacementFieldType::SizeType gradientFieldSize = gradientField->GetRequestedRegion().GetSize(); + auto [gradientFieldIndex, gradientFieldSize] = gradientField->GetRequestedRegion(); SizeValueType localCount = 0; for (ImageRegionConstIteratorWithOnlyIndex ItG(gradientField, diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx index 39d6d4015cc4..defd92a6e061 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx @@ -206,8 +206,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) velocityFieldSpacing.Fill(1.0); velocityFieldDirection.SetIdentity(); - typename FixedImageType::IndexType fixedImageIndex = fixedImage->GetBufferedRegion().GetIndex(); - typename FixedImageType::SizeType fixedImageSize = fixedImage->GetBufferedRegion().GetSize(); + auto [fixedImageIndex, fixedImageSize] = fixedImage->GetBufferedRegion(); typename FixedImageType::PointType fixedImageOrigin = fixedImage->GetOrigin(); typename FixedImageType::SpacingType fixedImageSpacing = fixedImage->GetSpacing(); typename FixedImageType::DirectionType fixedImageDirection = fixedImage->GetDirection(); diff --git a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx index 8557a57870b8..cc3a3ed22c3e 100644 --- a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx @@ -350,8 +350,7 @@ ParallelSparseFieldLevelSetImageFilter::ConstructActi ValueType value; StatusType layer_number; - typename OutputImageType::SizeType regionSize = m_OutputImage->GetRequestedRegion().GetSize(); - typename OutputImageType::IndexType startIndex = m_OutputImage->GetRequestedRegion().GetIndex(); + auto [startIndex, regionSize] = m_OutputImage->GetRequestedRegion(); using StartIndexValueType = IndexValueType; for (NeighborhoodIterator outputIt( diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx index fd9e28eeb793..e0ef2c717d15 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx @@ -94,15 +94,12 @@ Segmenter::GenerateData() ImageRegionType thresholdLargestPossibleRegion = this->GetLargestPossibleRegion(); // First we have to find the boundaries and adjust the threshold image size - typename ImageRegionType::IndexType tidx = thresholdImageRegion.GetIndex(); - typename ImageRegionType::SizeType tsz = thresholdImageRegion.GetSize(); - typename ImageRegionType::IndexType tlidx = thresholdLargestPossibleRegion.GetIndex(); - typename ImageRegionType::SizeType tlsz = thresholdLargestPossibleRegion.GetSize(); + auto [tidx, tsz] = thresholdImageRegion; + auto [tlidx, tlsz] = thresholdLargestPossibleRegion; for (i = 0; i < ImageDimension; ++i) { - ImageRegionType reg; - typename ImageRegionType::IndexType idx = regionToProcess.GetIndex(); - typename ImageRegionType::SizeType sz = regionToProcess.GetSize(); + ImageRegionType reg; + auto [idx, sz] = regionToProcess; // Set LOW face idx[i] = regionToProcess.GetIndex()[i]; diff --git a/Modules/Video/Core/include/itkImageToVideoFilter.hxx b/Modules/Video/Core/include/itkImageToVideoFilter.hxx index 5dee3ed595a7..0c4ce14b94fb 100644 --- a/Modules/Video/Core/include/itkImageToVideoFilter.hxx +++ b/Modules/Video/Core/include/itkImageToVideoFilter.hxx @@ -98,9 +98,8 @@ ImageToVideoFilter::GenerateOutputInformation() const InputImageType * input = this->GetInput(); // Get first input frame's largest possible spatial region - InputImageRegionType inputRegion = input->GetLargestPossibleRegion(); - typename InputImageType::SizeType inputSize = inputRegion.GetSize(); - typename InputImageType::IndexType inputIndex = inputRegion.GetIndex(); + InputImageRegionType inputRegion = input->GetLargestPossibleRegion(); + auto [inputIndex, inputSize] = inputRegion; typename InputImageType::SpacingType inputSpacing = input->GetSpacing(); typename InputImageType::PointType inputOrigin = input->GetOrigin();