Skip to content

Commit 24c2613

Browse files
authored
Merge pull request InsightSoftwareConsortium#5839 from N-Dekker/Remove-local-type-aliases-IteratorWithIndex
Remove local type aliases of IteratorWithIndex in `*.hxx` files
2 parents 9e7081b + cfd3cad commit 24c2613

File tree

52 files changed

+99
-163
lines changed

Some content is hidden

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

52 files changed

+99
-163
lines changed

Modules/Core/SpatialObjects/include/itkSpatialObjectToImageFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ SpatialObjectToImageFilter<TInputSpatialObject, TOutputImage>::GenerateData()
277277
OutputImage->SetDirection(m_Direction);
278278
OutputImage->Allocate(); // allocate the image
279279

280-
using myIteratorType = ImageRegionIteratorWithIndex<OutputImageType>;
281280

282-
myIteratorType it(OutputImage, region);
281+
ImageRegionIteratorWithIndex<OutputImageType> it(OutputImage, region);
283282

284283
itk::Point<double, ObjectDimension> objectPoint;
285284
itk::Point<double, OutputImageDimension> imagePoint;

Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx

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

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

117-
using MaskIteratorType = ImageRegionConstIteratorWithIndex<MaskImageType>;
118-
MaskIteratorType it(maskImage, maskImage->GetLargestPossibleRegion());
119-
IndexType ind;
120-
PointType pnt;
121-
PointType tPnt;
122-
VectorType mv;
117+
ImageRegionConstIteratorWithIndex<MaskImageType> it(maskImage, maskImage->GetLargestPossibleRegion());
118+
IndexType ind;
119+
PointType pnt;
120+
PointType tPnt;
121+
VectorType mv;
123122
while (!it.IsAtEnd())
124123
{
125124
if (it.Get() > 0) // if inside the mask
@@ -180,11 +179,10 @@ SpatialObjectToImageStatisticsCalculator<TInputImage, TInputSpatialObject, TSamp
180179

181180
const RegionType region(indMin, size);
182181

183-
using IteratorType = ImageRegionConstIteratorWithIndex<ImageType>;
184-
IteratorType it(m_Image, region);
185-
IndexType ind;
186-
PointType pnt;
187-
VectorType mv;
182+
ImageRegionConstIteratorWithIndex<ImageType> it(m_Image, region);
183+
IndexType ind;
184+
PointType pnt;
185+
VectorType mv;
188186
while (!it.IsAtEnd())
189187
{
190188
ind = it.GetIndex();

Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,14 @@ DiffusionTensor3DReconstructionImageFilter<TReferenceImagePixelType,
301301
else if (m_GradientImageTypeEnumeration ==
302302
DiffusionTensor3DReconstructionImageFilterEnums::GradientImageFormat::GradientIsInASingleImage)
303303
{
304-
using GradientIteratorType = ImageRegionConstIteratorWithIndex<GradientImagesType>;
305304
using GradientVectorType = typename GradientImagesType::PixelType;
306305
typename GradientImagesType::Pointer gradientImagePointer = nullptr;
307306

308307
// Would have liked a dynamic_cast here, but seems SGI doesn't like it
309308
// The enum will ensure that an inappropriate cast is not done
310309
gradientImagePointer = itkDynamicCastInDebugMode<GradientImagesType *>(this->ProcessObject::GetInput(0));
311310

312-
GradientIteratorType git(gradientImagePointer, outputRegionForThread);
311+
ImageRegionConstIteratorWithIndex<GradientImagesType> git(gradientImagePointer, outputRegionForThread);
313312
git.GoToBegin();
314313

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

Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ InverseDisplacementFieldImageFilter<TInputImage, TOutputImage>::PrepareKernelBas
150150

151151
const InputImageType * sampledInput = resampler->GetOutput();
152152

153-
using IteratorType = ImageRegionConstIteratorWithIndex<InputImageType>;
154153

155154
unsigned int landmarkId = 0;
156155

157-
IteratorType ot(sampledInput, subsampledRegion);
156+
ImageRegionConstIteratorWithIndex<InputImageType> ot(sampledInput, subsampledRegion);
158157

159158
OutputPixelType value;
160159
Point<double, ImageDimension> sourcePoint;
@@ -213,7 +212,6 @@ InverseDisplacementFieldImageFilter<TInputImage, TOutputImage>::GenerateData()
213212
outputPtr->Allocate();
214213

215214
// Create an iterator that will walk the output region for this thread.
216-
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;
217215

218216
const OutputImageRegionType region = outputPtr->GetRequestedRegion();
219217

@@ -230,7 +228,7 @@ InverseDisplacementFieldImageFilter<TInputImage, TOutputImage>::GenerateData()
230228
ProgressReporter progress(this, 0, region.GetNumberOfPixels(), 10);
231229

232230
// Walk the output region
233-
for (OutputIterator outIt(outputPtr, region); !outIt.IsAtEnd(); ++outIt)
231+
for (ImageRegionIteratorWithIndex<TOutputImage> outIt(outputPtr, region); !outIt.IsAtEnd(); ++outIt)
234232
{
235233
// Determine the index of the current output pixel
236234
outputIndex = outIt.GetIndex();

Modules/Filtering/DisplacementField/include/itkLandmarkDisplacementFieldSource.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ LandmarkDisplacementFieldSource<TOutputImage>::GenerateData()
115115
outputPtr->Allocate();
116116

117117
// Create an iterator that will walk the output region for this thread.
118-
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;
119118

120119
const OutputImageRegionType region = outputPtr->GetRequestedRegion();
121120

@@ -132,7 +131,7 @@ LandmarkDisplacementFieldSource<TOutputImage>::GenerateData()
132131
ProgressReporter progress(this, 0, region.GetNumberOfPixels(), 10);
133132

134133
// Walk the output region
135-
for (OutputIterator outIt(outputPtr, region); !outIt.IsAtEnd(); ++outIt)
134+
for (ImageRegionIteratorWithIndex<TOutputImage> outIt(outputPtr, region); !outIt.IsAtEnd(); ++outIt)
136135
{
137136
// Determine the index of the current output pixel
138137
outputIndex = outIt.GetIndex();

Modules/Filtering/FFT/include/itkFFTWComplexToComplex1DFFTImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,9 @@ FFTWComplexToComplex1DFFTImageFilter<TInputImage, TOutputImage>::ThreadedGenerat
142142
const typename OutputImageType::SizeType & outputSize = outputPtr->GetRequestedRegion().GetSize();
143143
const unsigned int lineSize = outputSize[this->m_Direction];
144144

145-
using InputIteratorType = ImageLinearConstIteratorWithIndex<InputImageType>;
146-
using OutputIteratorType = ImageLinearIteratorWithIndex<OutputImageType>;
147-
InputIteratorType inputIt(inputPtr, outputRegion);
145+
ImageLinearConstIteratorWithIndex<InputImageType> inputIt(inputPtr, outputRegion);
148146
// the output region should be the same as the input region in the non-fft directions
149-
OutputIteratorType outputIt(outputPtr, outputRegion);
147+
ImageLinearIteratorWithIndex<OutputImageType> outputIt(outputPtr, outputRegion);
150148

151149
inputIt.SetDirection(this->m_Direction);
152150
outputIt.SetDirection(this->m_Direction);

Modules/Filtering/FFT/include/itkFFTWForward1DFFTImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ FFTWForward1DFFTImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(con
130130
const InputImageType * inputPtr = this->GetInput();
131131
OutputImageType * outputPtr = this->GetOutput();
132132

133-
using InputIteratorType = ImageLinearConstIteratorWithIndex<InputImageType>;
134-
using OutputIteratorType = ImageLinearIteratorWithIndex<OutputImageType>;
135-
InputIteratorType inputIt(inputPtr, outputRegion);
136-
OutputIteratorType outputIt(outputPtr, outputRegion);
133+
ImageLinearConstIteratorWithIndex<InputImageType> inputIt(inputPtr, outputRegion);
134+
ImageLinearIteratorWithIndex<OutputImageType> outputIt(outputPtr, outputRegion);
137135

138136
inputIt.SetDirection(this->GetDirection());
139137
outputIt.SetDirection(this->GetDirection());

Modules/Filtering/FFT/include/itkFFTWInverse1DFFTImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,8 @@ FFTWInverse1DFFTImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(con
134134
const typename OutputImageType::SizeType & outputSize = outputPtr->GetRequestedRegion().GetSize();
135135
const unsigned int lineSize = outputSize[this->m_Direction];
136136

137-
using InputIteratorType = ImageLinearConstIteratorWithIndex<InputImageType>;
138-
using OutputIteratorType = ImageLinearIteratorWithIndex<OutputImageType>;
139-
InputIteratorType inputIt(inputPtr, outputRegion);
140-
OutputIteratorType outputIt(outputPtr, outputRegion);
137+
ImageLinearConstIteratorWithIndex<InputImageType> inputIt(inputPtr, outputRegion);
138+
ImageLinearIteratorWithIndex<OutputImageType> outputIt(outputPtr, outputRegion);
141139

142140
inputIt.SetDirection(this->m_Direction);
143141
outputIt.SetDirection(this->m_Direction);

Modules/Filtering/FFT/include/itkVnlComplexToComplex1DFFTImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ VnlComplexToComplex1DFFTImageFilter<TInputImage, TOutputImage>::GenerateData()
5252
direction,
5353
output->GetRequestedRegion(),
5454
[this, input, output, direction, vectorSize](const typename OutputImageType::RegionType & lambdaRegion) {
55-
using InputIteratorType = ImageLinearConstIteratorWithIndex<InputImageType>;
56-
using OutputIteratorType = ImageLinearIteratorWithIndex<OutputImageType>;
57-
InputIteratorType inputIt(input, lambdaRegion);
58-
OutputIteratorType outputIt(output, lambdaRegion);
55+
ImageLinearConstIteratorWithIndex<InputImageType> inputIt(input, lambdaRegion);
56+
ImageLinearIteratorWithIndex<OutputImageType> outputIt(output, lambdaRegion);
5957

6058
inputIt.SetDirection(direction);
6159
outputIt.SetDirection(direction);

Modules/Filtering/FFT/include/itkVnlForward1DFFTImageFilter.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ VnlForward1DFFTImageFilter<TInputImage, TOutputImage>::GenerateData()
5858
direction,
5959
output->GetRequestedRegion(),
6060
[input, output, direction, vectorSize](const typename OutputImageType::RegionType & lambdaRegion) {
61-
using InputIteratorType = ImageLinearConstIteratorWithIndex<InputImageType>;
62-
using OutputIteratorType = ImageLinearIteratorWithIndex<OutputImageType>;
63-
InputIteratorType inputIt(input, lambdaRegion);
64-
OutputIteratorType outputIt(output, lambdaRegion);
61+
ImageLinearConstIteratorWithIndex<InputImageType> inputIt(input, lambdaRegion);
62+
ImageLinearIteratorWithIndex<OutputImageType> outputIt(output, lambdaRegion);
6563

6664
inputIt.SetDirection(direction);
6765
outputIt.SetDirection(direction);

0 commit comments

Comments
 (0)