Skip to content

Commit 0d44f22

Browse files
committed
STYLE: Replace Size var; var.Fill with auto var = Size::Filled
- Following ITK pull request InsightSoftwareConsortium/ITK#4906 commit InsightSoftwareConsortium/ITK@7fd1e73
1 parent d55f5e6 commit 0d44f22

7 files changed

+7
-14
lines changed

Common/itkComputePreconditionerUsingDisplacementDistribution.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,7 @@ ComputePreconditionerUsingDisplacementDistribution<TFixedImage, TTransform>::Pre
596596
// average over the neighborhood using only the non -1 entries
597597
// we should repeat this a couple of times, until no -1's are left
598598
double tmp = 0.0;
599-
GridSizeType radius;
600-
radius.Fill(1);
599+
auto radius = GridSizeType::Filled(1);
601600
NeighborhoodIterator<CoefficientImageType> nit(radius, coefImage, region2);
602601
while (!nit.IsAtEnd())
603602
{

Components/Metrics/RigidityPenalty/itkTransformRigidityPenaltyTerm.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,8 +2161,7 @@ TransformRigidityPenaltyTerm<TFixedImage, TScalarType>::CreateNDOperator(
21612161
const CoefficientImageSpacingType & spacing) const
21622162
{
21632163
/** Create an operator size and set it in the operator. */
2164-
NeighborhoodSizeType r;
2165-
r.Fill(1);
2164+
auto r = NeighborhoodSizeType::Filled(1);
21662165
F.SetRadius(r);
21672166

21682167
/** Get the image spacing factors that we are going to use. */

Testing/elxTransformParametersCompare.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ main(int argc, char ** argv)
206206
config->ReadParameter(dimension, "FixedImageDimension", 0, true, dummyErrorMessage);
207207

208208
/** Get coefficient image information. */
209-
SizeType gridSize;
210-
gridSize.Fill(1);
209+
auto gridSize = SizeType::Filled(1);
211210
IndexType gridIndex{};
212211
SpacingType gridSpacing;
213212
gridSpacing.Fill(1.0);

Testing/itkBSplineInterpolationDerivativeWeightFunctionTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ main()
159159
return 1;
160160
}
161161

162-
DerivativeWeightFunctionType::SizeType trueSize;
163-
trueSize.Fill(SplineOrder + 1);
162+
auto trueSize = DerivativeWeightFunctionType::SizeType::Filled(SplineOrder + 1);
164163
if (DerivativeWeightFunctionType::SupportSize != trueSize)
165164
{
166165
std::cerr << "ERROR: wrong support size was computed." << std::endl;

Testing/itkBSplineInterpolationSODerivativeWeightFunctionTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ main()
248248
return 1;
249249
}
250250

251-
SODerivativeWeightFunctionType::SizeType trueSize;
252-
trueSize.Fill(SplineOrder + 1);
251+
auto trueSize = SODerivativeWeightFunctionType::SizeType::Filled(SplineOrder + 1);
253252
if (SODerivativeWeightFunctionType::SupportSize != trueSize)
254253
{
255254
std::cerr << "ERROR: wrong support size was computed." << std::endl;

Testing/itkBSplineInterpolationWeightFunctionTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ main()
245245
return EXIT_FAILURE;
246246
}
247247

248-
WeightFunction2Type2D::SizeType trueSize;
249-
trueSize.Fill(SplineOrder + 1);
248+
auto trueSize = WeightFunction2Type2D::SizeType::Filled(SplineOrder + 1);
250249
if (WeightFunction2Type2D::SupportSize != trueSize)
251250
{
252251
std::cerr << "ERROR: wrong support size was computed." << std::endl;

Testing/itkGPUResampleImageFilterTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ SetTransform(const std::size_t transf
441441
const typename InputImageType::SizeType inputSize = inputRegion.GetSize();
442442

443443
using MeshSizeType = typename BSplineTransformType::MeshSizeType;
444-
MeshSizeType gridSize;
445-
gridSize.Fill(4);
444+
auto gridSize = MeshSizeType::Filled(4);
446445

447446
using PhysicalDimensionsType = typename BSplineTransformType::PhysicalDimensionsType;
448447
PhysicalDimensionsType gridSpacing;

0 commit comments

Comments
 (0)