Skip to content

Commit f67d1f8

Browse files
committed
STYLE: Replace Fill calls with auto var = MakeFilled<T>
- Following ITK pull request InsightSoftwareConsortium/ITK#4924 commit InsightSoftwareConsortium/ITK@6cb6bf9
1 parent 7400da3 commit f67d1f8

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

Common/ImageSamplers/itkImageGridSampler.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ ImageGridSampler<TInputImage>::SetNumberOfSamples(unsigned long nrofsamples)
441441
* Do not use the SetSampleGridSpacing function because it calls
442442
* SetNumberOfSamples(0) internally.
443443
*/
444-
SampleGridSpacingType gridSpacings;
445-
gridSpacings.Fill(gridSpacing);
444+
auto gridSpacings = MakeFilled<SampleGridSpacingType>(gridSpacing);
446445
if (m_SampleGridSpacing != gridSpacings)
447446
{
448447
m_SampleGridSpacing = gridSpacings;

Common/Transforms/itkGridScheduleComputer.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ GridScheduleComputer<TTransformScalarType, VImageDimension>::SetDefaultSchedule(
6363
this->SetUpsamplingFactor(upsamplingFactor);
6464

6565
/** Initialize the schedule. */
66-
GridSpacingFactorType factors;
67-
factors.Fill(1.0);
66+
auto factors = MakeFilled<GridSpacingFactorType>(1.0);
6867
this->m_GridSpacingFactors.clear();
6968
this->m_GridSpacingFactors.resize(levels, factors);
7069

Common/itkParabolicErodeDilateImageFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ template <typename TInputImage, bool doDilate, typename TOutputImage>
114114
void
115115
ParabolicErodeDilateImageFilter<TInputImage, doDilate, TOutputImage>::SetScale(ScalarRealType scale)
116116
{
117-
RadiusType s;
118-
s.Fill(scale);
117+
auto s = MakeFilled<RadiusType>(scale);
119118
this->SetScale(s);
120119
}
121120

Components/Metrics/DistancePreservingRigidityPenalty/itkDistancePreservingRigidityPenaltyTerm.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ DistancePreservingRigidityPenaltyTerm<TFixedImage, TScalarType>::GetValue(const
180180
typename PenaltyGridImageType::PointType penaltyGridPoint, neighborPenaltyGridPoint, xn, xf;
181181

182182
using NeighborhoodIteratorType = itk::ConstNeighborhoodIterator<PenaltyGridImageType>;
183-
typename NeighborhoodIteratorType::RadiusType radius;
184-
radius.Fill(1);
183+
auto radius = MakeFilled<typename NeighborhoodIteratorType::RadiusType>(1);
185184
NeighborhoodIteratorType ni(radius, this->m_PenaltyGridImage, penaltyGridImageRegion);
186185
unsigned int numberOfNeighborhood = ni.Size();
187186

@@ -330,8 +329,7 @@ DistancePreservingRigidityPenaltyTerm<TFixedImage, TScalarType>::GetValueAndDeri
330329

331330
// neighborhood iterator
332331
using NeighborhoodIteratorType = itk::ConstNeighborhoodIterator<PenaltyGridImageType>;
333-
typename NeighborhoodIteratorType::RadiusType radius;
334-
radius.Fill(1);
332+
auto radius = MakeFilled<typename NeighborhoodIteratorType::RadiusType>(1);
335333
NeighborhoodIteratorType ni(radius, this->m_PenaltyGridImage, penaltyGridImageRegion);
336334
unsigned int numberOfNeighborhood = ni.Size();
337335

Components/Metrics/RigidityPenalty/itkTransformRigidityPenaltyTerm.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,7 @@ TransformRigidityPenaltyTerm<TFixedImage, TScalarType>::GetValueAndDerivative(co
15551555
std::vector<std::vector<NeighborhoodIteratorType>> nitOCp(ImageDimension);
15561556
std::vector<std::vector<NeighborhoodIteratorType>> nitPCp(ImageDimension);
15571557
std::vector<std::vector<NeighborhoodIteratorType>> nitLCp(ImageDimension);
1558-
RadiusType radius;
1559-
radius.Fill(1);
1558+
auto radius = MakeFilled<RadiusType>(1);
15601559
for (unsigned int i = 0; i < ImageDimension; ++i)
15611560
{
15621561
nitOCp[i].resize(ImageDimension);

0 commit comments

Comments
 (0)