Skip to content

Commit 5b8e619

Browse files
committed
STYLE: Replace Size var; var.Fill with auto var = Size::Filled
Using Notepad++, Replace in Files, doing: Find what: ^([ ]+ )(typename )?(.*Size.*[^ ])[ ]+(\w+);[\r\n]+ [ ]+\4\.Fill\( Replace with: $1auto $4 = $3::Filled\( Filters: itk*.h;itk*.hxx;itk*.cxx [v] Match case (*) Regular expression Follow-up to pull request InsightSoftwareConsortium#4887 commit be250b8 "STYLE: Replace `size.Fill` with `auto size = Size::Filled` in tests"
1 parent 4b7886a commit 5b8e619

File tree

41 files changed

+62
-117
lines changed

Some content is hidden

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

41 files changed

+62
-117
lines changed

Modules/Core/Common/include/itkDerivativeOperator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ namespace itk
3939
using DerivativeOperatorType = itk::DerivativeOperator<float, 2>;
4040
DerivativeOperatorType derivativeOperator;
4141
derivativeOperator.SetDirection(0); // X dimension
42-
itk::Size<2> radius;
43-
radius.Fill(1); // A radius of 1 in both dimensions is a 3x3 operator
42+
auto radius = itk::Size<2>::Filled(1); // A radius of 1 in both dimensions is a 3x3 operator
4443
derivativeOperator.CreateToRadius(radius);
4544
\endcode
4645
* and creates a kernel that looks like:

Modules/Core/Common/include/itkLaplacianOperator.hxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ LaplacianOperator<TPixel, VDimension, TAllocator>::GenerateCoefficients() -> Coe
7070

7171
// Here we set the radius to 1's, here the
7272
// operator is 3x3 for 2D, 3x3x3 for 3D.
73-
SizeType r;
74-
75-
r.Fill(1);
73+
auto r = SizeType::Filled(1);
7674
this->SetRadius(r);
7775

7876
// Create a vector of the correct size to hold the coefficients.

Modules/Core/Common/include/itkSobelOperator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ namespace itk
3535
* 1) Set the direction by calling \code SetDirection \endcode
3636
* 2) call
3737
\code
38-
itk::Size<2> radius;
39-
radius.Fill(1);
38+
auto radius = itk::Size<2>::Filled(1);
4039
sobelOperator.CreateToRadius(radius);
4140
\endcode
4241
* 3) You may optionally scale the coefficients of this operator using the

Modules/Core/ImageFunction/include/itkCovarianceImageFunction.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ CovarianceImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType
6161
mean.fill(PixelComponentRealType{});
6262

6363
// Create an N-d neighborhood kernel, using a zeroflux boundary condition
64-
typename InputImageType::SizeType kernelSize;
65-
kernelSize.Fill(m_NeighborhoodRadius);
64+
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);
6665

6766
ConstNeighborhoodIterator<InputImageType> it(
6867
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());

Modules/Core/ImageFunction/include/itkScatterMatrixImageFunction.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ ScatterMatrixImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexT
6666
}
6767

6868
// Create an N-d neighborhood kernel, using a zeroflux boundary condition
69-
typename InputImageType::SizeType kernelSize;
70-
kernelSize.Fill(m_NeighborhoodRadius);
69+
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);
7170

7271
ConstNeighborhoodIterator<InputImageType> it(
7372
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());

Modules/Core/ImageFunction/include/itkVarianceImageFunction.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ VarianceImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType &
6060
}
6161

6262
// Create an N-d neighborhood kernel, using a zeroflux boundary condition
63-
typename InputImageType::SizeType kernelSize;
64-
kernelSize.Fill(m_NeighborhoodRadius);
63+
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);
6564

6665
ConstNeighborhoodIterator<InputImageType> it(
6766
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());

Modules/Core/ImageFunction/include/itkVectorMeanImageFunction.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ VectorMeanImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType
5454
}
5555

5656
// Create an N-d neighborhood kernel, using a zeroflux boundary condition
57-
typename InputImageType::SizeType kernelSize;
58-
kernelSize.Fill(m_NeighborhoodRadius);
57+
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);
5958

6059
ConstNeighborhoodIterator<InputImageType> it(
6160
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());

Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ class ITK_TEMPLATE_EXPORT WindowedSincInterpolateImageFunction : public Interpol
321321
SizeType
322322
GetRadius() const override
323323
{
324-
SizeType radius;
325-
radius.Fill(VRadius);
324+
auto radius = SizeType::Filled(VRadius);
326325
return radius;
327326
}
328327

Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ WindowedSincInterpolateImageFunction<TInputImage, VRadius, TWindowFunction, TBou
6464
}
6565

6666
// Set the radius for the neighborhood
67-
Size<ImageDimension> radius;
68-
radius.Fill(VRadius);
67+
auto radius = Size<ImageDimension>::Filled(VRadius);
6968

7069
// Initialize the neighborhood
7170
IteratorType it(radius, image, image->GetBufferedRegion());
@@ -145,8 +144,7 @@ WindowedSincInterpolateImageFunction<TInputImage, VRadius, TWindowFunction, TBou
145144
}
146145

147146
// Position the neighborhood at the index of interest
148-
Size<ImageDimension> radius;
149-
radius.Fill(VRadius);
147+
auto radius = Size<ImageDimension>::Filled(VRadius);
150148
IteratorType nit(radius, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
151149
nit.SetLocation(baseIndex);
152150

Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,7 @@ BSplineDeformableTransform<TParametersValueType, VDimension, VSplineOrder>::Comp
556556
// Zero all components of jacobian
557557
jacobian.SetSize(SpaceDimension, this->GetNumberOfParameters());
558558
jacobian.Fill(0.0);
559-
SizeType supportSize;
560-
supportSize.Fill(SplineOrder + 1);
559+
auto supportSize = SizeType::Filled(SplineOrder + 1);
561560

562561
ContinuousIndexType index =
563562
this->m_CoefficientImages[0]

0 commit comments

Comments
 (0)