From 9969e6c2b19830ce7517b27642d3775892f2e5d2 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Mon, 17 Apr 2023 15:40:02 +0200 Subject: [PATCH] STYLE: Add `const` to TransformPhysicalPointToIndex results in "Review" Declared local "IndexType" variables in "Nonunit/Review" that are initialized by the result of a TransformPhysicalPointToIndex(point) call `const`. Follow-up to commit 49ece7f60841b79c306b9a709ffcee228ce9c347 "COMP: Fix TransformPhysicalPointToIndex `nodiscard` warnings" Suggested by Matt McCormick at https://github.com/InsightSoftwareConsortium/ITK/pull/4000#discussion_r1160226814 --- .../include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx | 2 +- .../include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx | 2 +- .../include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx | 2 +- .../include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/Nonunit/Review/include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx index 71448390e7a..9a397404474 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx @@ -49,7 +49,7 @@ MultiphaseDenseFiniteDifferenceImageFilterTransformPhysicalPointToIndex(origin); + const OutputIndexType start = output->TransformPhysicalPointToIndex(origin); OutputRegionType region; region.SetSize(size); diff --git a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx index ccda2e2505c..e3a56ffd82e 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx @@ -1353,7 +1353,7 @@ MultiphaseSparseFiniteDifferenceImageFilter inIt(this->m_LevelSet[fId], this->m_LevelSet[fId]->GetRequestedRegion()); // In the context of the global coordinates - OutputIndexType start = output->TransformPhysicalPointToIndex(origin); + const OutputIndexType start = output->TransformPhysicalPointToIndex(origin); // Defining sub-region in the global coordinates OutputRegionType region; diff --git a/Modules/Nonunit/Review/include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx b/Modules/Nonunit/Review/include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx index 9ef330a0b0d..6130c54da9e 100644 --- a/Modules/Nonunit/Review/include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx @@ -33,7 +33,7 @@ ScalarChanAndVeseDenseLevelSetImageFilterGetOrigin(); // In the context of the global coordinates - FeatureIndexType start = this->GetInput()->TransformPhysicalPointToIndex(origin); + const FeatureIndexType start = this->GetInput()->TransformPhysicalPointToIndex(origin); // Defining roi region FeatureRegionType region; diff --git a/Modules/Nonunit/Review/include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx b/Modules/Nonunit/Review/include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx index 6901bdd8f04..067535b42d4 100644 --- a/Modules/Nonunit/Review/include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx @@ -38,7 +38,7 @@ ScalarChanAndVeseSparseLevelSetImageFilterGetOrigin(); // In the context of the global coordinates - FeatureIndexType start = this->GetInput()->TransformPhysicalPointToIndex(origin); + const FeatureIndexType start = this->GetInput()->TransformPhysicalPointToIndex(origin); // Defining roi region FeatureRegionType region;