Skip to content

Commit a694cf9

Browse files
authored
Merge pull request InsightSoftwareConsortium#5932 from N-Dekker/Use-CTAD-for-iterators-with-index
STYLE: Use CTAD for iterators "with index", in hxx files
2 parents 0e0dbd6 + 50210af commit a694cf9

88 files changed

Lines changed: 161 additions & 183 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Modules/Core/Common/include/itkMinimumMaximumImageCalculator.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ MinimumMaximumImageCalculator<TInputImage>::Compute()
3232
m_Region = m_Image->GetRequestedRegion();
3333
}
3434

35-
ImageRegionConstIteratorWithIndex<TInputImage> it(m_Image, m_Region);
35+
ImageRegionConstIteratorWithIndex it(m_Image, m_Region);
3636
m_Maximum = NumericTraits<PixelType>::NonpositiveMin();
3737
m_Minimum = NumericTraits<PixelType>::max();
3838

@@ -61,7 +61,7 @@ MinimumMaximumImageCalculator<TInputImage>::ComputeMinimum()
6161
{
6262
m_Region = m_Image->GetRequestedRegion();
6363
}
64-
ImageRegionConstIteratorWithIndex<TInputImage> it(m_Image, m_Region);
64+
ImageRegionConstIteratorWithIndex it(m_Image, m_Region);
6565
m_Minimum = NumericTraits<PixelType>::max();
6666

6767
while (!it.IsAtEnd())
@@ -84,7 +84,7 @@ MinimumMaximumImageCalculator<TInputImage>::ComputeMaximum()
8484
{
8585
m_Region = m_Image->GetRequestedRegion();
8686
}
87-
ImageRegionConstIteratorWithIndex<TInputImage> it(m_Image, m_Region);
87+
ImageRegionConstIteratorWithIndex it(m_Image, m_Region);
8888
m_Maximum = NumericTraits<PixelType>::NonpositiveMin();
8989

9090
while (!it.IsAtEnd())

Modules/Core/ImageFunction/include/itkGaussianBlurImageFunction.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ GaussianBlurImageFunction<TInputImage, TOutput>::EvaluateAtIndex(const IndexType
231231
typename InternalImageType::RegionType regionS = region;
232232
regionS.Crop(inputImage->GetBufferedRegion());
233233

234-
ImageLinearConstIteratorWithIndex<InputImageType> it(inputImage, regionS);
235-
ImageLinearIteratorWithIndex<InternalImageType> itN(m_InternalImage, regionN);
234+
ImageLinearConstIteratorWithIndex it(inputImage, regionS);
235+
ImageLinearIteratorWithIndex itN(m_InternalImage, regionN);
236236
it.SetDirection(1);
237237
itN.SetDirection(1);
238238
it.GoToBeginOfLine();
@@ -266,7 +266,7 @@ GaussianBlurImageFunction<TInputImage, TOutput>::EvaluateAtIndex(const IndexType
266266
m_OperatorInternalImageFunction->SetInputImage(m_InternalImage);
267267
m_OperatorInternalImageFunction->SetOperator(operatorArray[direction]);
268268

269-
ImageLinearIteratorWithIndex<InternalImageType> itr(m_InternalImage, region);
269+
ImageLinearIteratorWithIndex itr(m_InternalImage, region);
270270

271271
unsigned int dir = direction + 1;
272272
if (dir == Self::ImageDimension)

Modules/Core/Mesh/include/itkImageToParametricSpaceFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ ImageToParametricSpaceFilter<TInputImage, TOutputMesh>::GenerateData()
121121
{
122122
PointDataContainerIterator data = pointData->Begin();
123123
image = this->GetInput(0);
124-
ImageRegionConstIteratorWithIndex<InputImageType> itr(image, image->GetRequestedRegion());
124+
ImageRegionConstIteratorWithIndex itr(image, image->GetRequestedRegion());
125125
while (!itr.IsAtEnd())
126126
{
127127
// The data at each point is the index

Modules/Core/SpatialObjects/include/itkSpatialObjectToImageFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ SpatialObjectToImageFilter<TInputSpatialObject, TOutputImage>::GenerateData()
278278
OutputImage->Allocate(); // allocate the image
279279

280280

281-
ImageRegionIteratorWithIndex<OutputImageType> it(OutputImage, region);
281+
ImageRegionIteratorWithIndex it(OutputImage, region);
282282

283283
itk::Point<double, ObjectDimension> objectPoint;
284284
itk::Point<double, OutputImageDimension> imagePoint;

Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ SpatialObjectToImageStatisticsCalculator<TInputImage, TInputSpatialObject, TSamp
114114

115115
const typename MaskImageType::ConstPointer maskImage = maskSpatialObject->GetImage();
116116

117-
ImageRegionConstIteratorWithIndex<MaskImageType> it(maskImage, maskImage->GetLargestPossibleRegion());
118-
IndexType ind;
119-
PointType pnt;
120-
PointType tPnt;
121-
VectorType mv;
117+
ImageRegionConstIteratorWithIndex it(maskImage, maskImage->GetLargestPossibleRegion());
118+
IndexType ind;
119+
PointType pnt;
120+
PointType tPnt;
121+
VectorType mv;
122122
while (!it.IsAtEnd())
123123
{
124124
if (it.Get() > 0) // if inside the mask
@@ -179,10 +179,10 @@ SpatialObjectToImageStatisticsCalculator<TInputImage, TInputSpatialObject, TSamp
179179

180180
const RegionType region(indMin, size);
181181

182-
ImageRegionConstIteratorWithIndex<ImageType> it(m_Image, region);
183-
IndexType ind;
184-
PointType pnt;
185-
VectorType mv;
182+
ImageRegionConstIteratorWithIndex it(m_Image, region);
183+
IndexType ind;
184+
PointType pnt;
185+
VectorType mv;
186186
while (!it.IsAtEnd())
187187
{
188188
ind = it.GetIndex();

Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ BinaryDilateImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
169169
// because in that way we will take care carefully at boundary
170170
// pixels of output requested region. Take care means that we will
171171
// check if a boundary pixel is or not a border pixel.
172-
ImageRegionIteratorWithIndex<TempImageType> tmpRegIndexIt(tmpImage, tmpRequestedRegion);
172+
ImageRegionIteratorWithIndex tmpRegIndexIt(tmpImage, tmpRequestedRegion);
173173

174174
ConstNeighborhoodIterator<TempImageType> oNeighbIt(radius, tmpImage, tmpRequestedRegion);
175175

@@ -383,7 +383,7 @@ BinaryDilateImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
383383
auto vecEndIt = this->KernelCCVectorEnd();
384384

385385
// iterator on output image
386-
ImageRegionIteratorWithIndex<OutputImageType> ouRegIndexIt(output, outputRegion);
386+
ImageRegionIteratorWithIndex ouRegIndexIt(output, outputRegion);
387387

388388
// InputRegionForThread is the output region for thread padded by
389389
// kernel radius We must traverse this padded region because some

Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ BinaryErodeImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
159159
// because in that way we will take care carefully at boundary
160160
// pixels of output requested region. Take care means that we will
161161
// check if a boundary pixel is or not a border pixel.
162-
ImageRegionIteratorWithIndex<TempImageType> tmpRegIndexIt(tmpImage, tmpRequestedRegion);
162+
ImageRegionIteratorWithIndex tmpRegIndexIt(tmpImage, tmpRequestedRegion);
163163

164164
ConstNeighborhoodIterator<TempImageType> oNeighbIt(radius, tmpImage, tmpRequestedRegion);
165165

@@ -377,7 +377,7 @@ BinaryErodeImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
377377
auto vecEndIt = this->KernelCCVectorEnd();
378378

379379
// iterator on output image
380-
ImageRegionIteratorWithIndex<OutputImageType> ouRegIndexIt(output, outputRegion);
380+
ImageRegionIteratorWithIndex ouRegIndexIt(output, outputRegion);
381381

382382
// InputRegionForThread is the output region for thread padded by
383383
// kernel radius We must traverse this padded region because some

Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ BinaryMorphologyImageFilter<TInputImage, TOutputImage, TKernel>::AnalyzeKernel()
133133

134134
// Now look for connected component and record one SE element
135135
// position for each CC.
136-
ImageRegionIteratorWithIndex<BoolImageType> kernelImageItIndex(tmpSEImage, tmpSEImage->GetRequestedRegion());
136+
ImageRegionIteratorWithIndex kernelImageItIndex(tmpSEImage, tmpSEImage->GetRequestedRegion());
137137

138138
// Neighborhood iterator on SE element temp image
139139
auto padBy = InputSizeType::Filled(1);

Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ PatchBasedDenoisingImageFilter<TInputImage, TOutputImage>::InitializePatchWeight
477477
auto centerIndex = WeightsImageType::IndexType::Filled(patchRadius);
478478

479479
unsigned int pos = 0;
480-
for (ImageRegionIteratorWithIndex<WeightsImageType> pwIt(physicalWeightsImage, physicalRegion); !pwIt.IsAtEnd();
481-
++pwIt)
480+
for (ImageRegionIteratorWithIndex pwIt(physicalWeightsImage, physicalRegion); !pwIt.IsAtEnd(); ++pwIt)
482481
{
483482
typename WeightsImageType::IndexType curIndex = pwIt.GetIndex();
484483
// Compute distances of each pixel from center pixel

Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ DiffusionTensor3DReconstructionImageFilter<TReferenceImagePixelType,
197197
{
198198
const typename ReferenceImageType::Pointer refImage =
199199
static_cast<ReferenceImageType *>(this->ProcessObject::GetInput(0));
200-
ImageRegionConstIteratorWithIndex<ReferenceImageType> it(refImage, outputRegionForThread);
200+
ImageRegionConstIteratorWithIndex it(refImage, outputRegionForThread);
201201

202202
using GradientIteratorType = ImageRegionConstIterator<GradientImageType>;
203203
std::vector<GradientIteratorType *> gradientItContainer;
@@ -308,7 +308,7 @@ DiffusionTensor3DReconstructionImageFilter<TReferenceImagePixelType,
308308
// The enum will ensure that an inappropriate cast is not done
309309
gradientImagePointer = itkDynamicCastInDebugMode<GradientImagesType *>(this->ProcessObject::GetInput(0));
310310

311-
ImageRegionConstIteratorWithIndex<GradientImagesType> git(gradientImagePointer, outputRegionForThread);
311+
ImageRegionConstIteratorWithIndex git(gradientImagePointer, outputRegionForThread);
312312
git.GoToBegin();
313313

314314
// Compute the indices of the baseline images and gradient images

0 commit comments

Comments
 (0)