Skip to content

Commit fe7bd2a

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Replace Size var; var.Fill with auto var = Size::Filled
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#4906 commit InsightSoftwareConsortium/ITK@7fd1e73
1 parent e8f8369 commit fe7bd2a

File tree

107 files changed

+136
-263
lines changed

Some content is hidden

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

107 files changed

+136
-263
lines changed

src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ main()
2828

2929
using ImageType = itk::Image<PixelType, Dimension>;
3030

31-
ImageType::SizeType smallSize;
32-
smallSize.Fill(10);
31+
auto smallSize = ImageType::SizeType::Filled(10);
3332

3433
ImageType::IndexType index{};
3534

3635
ImageType::RegionType region(index, smallSize);
3736

38-
ImageType::SizeType bigSize;
39-
bigSize.Fill(10000);
37+
auto bigSize = ImageType::SizeType::Filled(10000);
4038

4139
using RandomSourceType = itk::RandomImageSource<ImageType>;
4240
auto randomImageSource = RandomSourceType::New();

src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ main()
3030
// Create the operator for the X axis derivative
3131
backwardDifferenceOperator.SetDirection(0);
3232

33-
itk::Size<Dimension> radius;
34-
radius.Fill(1);
33+
auto radius = itk::Size<Dimension>::Filled(1);
3534

3635
backwardDifferenceOperator.CreateToRadius(radius);
3736

src/Core/Common/CreateAnImageRegion/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ main()
2424
constexpr unsigned int Dimension = 2;
2525

2626
using RegionType = itk::ImageRegion<Dimension>;
27-
RegionType::SizeType size;
28-
size.Fill(3);
27+
auto size = RegionType::SizeType::Filled(3);
2928

3029
RegionType::IndexType index;
3130
index.Fill(1);

src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ CreateImage(typename TImage::Pointer image)
2626
using ImageType = TImage;
2727
typename ImageType::IndexType start{};
2828

29-
typename ImageType::SizeType size;
30-
size.Fill(2);
29+
auto size = ImageType::SizeType::Filled(2);
3130

3231
typename ImageType::RegionType region(start, size);
3332

src/Core/Common/CreateDerivativeKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ main()
2323
using DerivativeOperatorType = itk::DerivativeOperator<float, 2>;
2424
DerivativeOperatorType derivativeOperator;
2525
derivativeOperator.SetDirection(0); // Create the operator for the X axis derivative
26-
itk::Size<2> radius;
27-
radius.Fill(1);
26+
auto radius = itk::Size<2>::Filled(1);
2827
derivativeOperator.CreateToRadius(radius);
2928

3029
std::cout << "Size: " << derivativeOperator.GetSize() << std::endl;

src/Core/Common/CreateForwardDifferenceKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ main()
2323
using ForwardDifferenceOperatorType = itk::ForwardDifferenceOperator<float, 2>;
2424
ForwardDifferenceOperatorType forwardDifferenceOperator;
2525
forwardDifferenceOperator.SetDirection(0); // Create the operator for the X axis derivative
26-
itk::Size<2> radius;
27-
radius.Fill(1);
26+
auto radius = itk::Size<2>::Filled(1);
2827
forwardDifferenceOperator.CreateToRadius(radius);
2928

3029
std::cout << "Size: " << forwardDifferenceOperator.GetSize() << std::endl;

src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ main()
2323
using GaussianDerivativeOperatorType = itk::GaussianDerivativeOperator<float, 2>;
2424
GaussianDerivativeOperatorType gaussianDerivativeOperator;
2525
gaussianDerivativeOperator.SetDirection(0); // Create the operator for the X axis derivative
26-
itk::Size<2> radius;
27-
radius.Fill(1);
26+
auto radius = itk::Size<2>::Filled(1);
2827
gaussianDerivativeOperator.CreateToRadius(radius);
2928

3029
std::cout << "Size: " << gaussianDerivativeOperator.GetSize() << std::endl;

src/Core/Common/CreateGaussianKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ main()
2323
using GaussianOperatorType = itk::GaussianOperator<float, 2>;
2424
GaussianOperatorType gaussianOperator;
2525
gaussianOperator.SetDirection(0); // Create the operator for the X axis derivative
26-
itk::Size<2> radius;
27-
radius.Fill(1);
26+
auto radius = itk::Size<2>::Filled(1);
2827
gaussianOperator.CreateToRadius(radius);
2928

3029
std::cout << "Size: " << gaussianOperator.GetSize() << std::endl;

src/Core/Common/CreateLaplacianKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ main()
2222
{
2323
using LaplacianOperatorType = itk::LaplacianOperator<float, 2>;
2424
LaplacianOperatorType laplacianOperator;
25-
itk::Size<2> radius;
26-
radius.Fill(1);
25+
auto radius = itk::Size<2>::Filled(1);
2726
laplacianOperator.CreateToRadius(radius);
2827

2928
std::cout << "Size: " << laplacianOperator.GetSize() << std::endl;

src/Core/Common/CreateSobelKernel/Code.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ main()
2323
using SobelOperatorType = itk::SobelOperator<float, 2>;
2424
SobelOperatorType sobelOperator;
2525
sobelOperator.SetDirection(0); // Create the operator for the X axis derivative
26-
itk::Size<2> radius;
27-
radius.Fill(1);
26+
auto radius = itk::Size<2>::Filled(1);
2827
sobelOperator.CreateToRadius(radius);
2928

3029
std::cout << sobelOperator << std::endl;

0 commit comments

Comments
 (0)