From 9bbe8fd148ac93f431e852bd28ab57ab0d6de607 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 31 Oct 2024 23:53:20 +0100 Subject: [PATCH 1/2] STYLE: Remove `shrinkFactors` variable from ImageRegistrationMethodv4 Simply filled the elements of m_ShrinkFactorsPerLevel directly. --- .../include/itkImageRegistrationMethodv4.hxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx index 6291565f0f0..5c6ef3e079b 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx @@ -102,13 +102,9 @@ ImageRegistrationMethodv4SetNumberOfLevels(3); this->m_ShrinkFactorsPerLevel.resize(this->m_NumberOfLevels); - ShrinkFactorsPerDimensionContainerType shrinkFactors; - shrinkFactors.Fill(2); - this->m_ShrinkFactorsPerLevel[0] = shrinkFactors; - shrinkFactors.Fill(1); - this->m_ShrinkFactorsPerLevel[1] = shrinkFactors; - shrinkFactors.Fill(1); - this->m_ShrinkFactorsPerLevel[2] = shrinkFactors; + this->m_ShrinkFactorsPerLevel[0].Fill(2); + this->m_ShrinkFactorsPerLevel[1].Fill(1); + this->m_ShrinkFactorsPerLevel[2].Fill(1); this->m_SmoothingSigmasPerLevel.SetSize(this->m_NumberOfLevels); this->m_SmoothingSigmasPerLevel[0] = 2; From 612e6b00e955496a07ebfb724aa586b9f0f11279 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 31 Oct 2024 17:43:14 +0100 Subject: [PATCH 2/2] STYLE: Replace `T var; var.Fill(x)` with `auto var = MakeFilled(x)` Using Notepad++, Replace in Files, doing: Find what: ^( [ ]+)([^ ].*)[ ]+(\w+);[\r\n]+\1\3\.Fill\( Replace with: $1auto $3 = MakeFilled<$2>\( Filters: itk*.h;itk*.hxx;itk*.cxx Directory: D:\src\ITK\Modules [v] Match case (*) Regular expression Excluded "itkVectorMeanImageFunction.hxx", because it may try to fill a `VariableLengthVector` (which is not supported by `MakeFilled`). Follow-up to pull request https://github.com/InsightSoftwareConsortium/ITK/pull/4891 commit d6c9eed8e1d718b4a4e7f3fdd76e825395a17f4a "STYLE: Replace Fill calls with `auto var = itk::MakeFilled` in tests" --- ...FilledFunctionConditionalConstIterator.hxx | 3 +-- .../include/itkContourSpatialObject.hxx | 3 +-- .../include/itkTubeSpatialObjectPoint.hxx | 6 ++--- .../Transform/include/itkBSplineTransform.hxx | 5 ++-- .../Transform/include/itkScaleTransform.hxx | 3 +-- .../itkN4BiasFieldCorrectionImageFilter.h | 4 +--- .../itkN4BiasFieldCorrectionImageFilter.hxx | 6 ++--- .../include/itkBinaryPruningImageFilter.hxx | 3 +-- .../include/itkBinaryThinningImageFilter.hxx | 3 +-- .../itkObjectMorphologyImageFilter.hxx | 3 +-- .../include/itkConvolutionImageFilter.hxx | 5 ++-- ...kedFFTNormalizedCorrelationImageFilter.hxx | 3 +-- .../itkPatchBasedDenoisingBaseImageFilter.hxx | 3 +-- .../itkPatchBasedDenoisingImageFilter.hxx | 3 +-- ...itkDisplacementFieldToBSplineImageFilter.h | 4 +--- ...kDisplacementFieldToBSplineImageFilter.hxx | 3 +-- .../include/itkFastMarchingImageFilter.hxx | 3 +-- .../itkFastMarchingImageFilterBase.hxx | 15 ++++-------- .../itkCannyEdgeDetectionImageFilter.hxx | 3 +-- ...itkDiscreteGaussianDerivativeImageFilter.h | 12 +++------- .../include/itkUnsharpMaskImageFilter.h | 3 +-- .../include/itkBoxImageFilter.hxx | 4 +--- .../include/itkMovingHistogramImageFilter.hxx | 3 +-- .../itkVectorGradientMagnitudeImageFilter.hxx | 6 ++--- .../itkBSplineControlPointImageFilter.hxx | 3 +-- ...lineScatteredDataPointSetToImageFilter.hxx | 6 ++--- .../include/itkPermuteAxesImageFilter.hxx | 3 +-- .../itkBinaryCrossStructuringElement.h | 3 +-- .../itkGrayscaleGeodesicDilateImageFilter.hxx | 6 ++--- .../itkGrayscaleGeodesicErodeImageFilter.hxx | 6 ++--- .../itkMaskedMovingHistogramImageFilter.hxx | 3 +-- .../itkFFTDiscreteGaussianImageFilter.hxx | 3 +-- ...itkMultiphaseFiniteDifferenceImageFilter.h | 3 +-- .../include/itkObjectToObjectMetric.hxx | 7 +++--- ...itkWindowConvergenceMonitoringFunction.hxx | 3 +-- ...larImageToCooccurrenceListSampleFilter.hxx | 3 +-- ...kScalarImageToCooccurrenceMatrixFilter.hxx | 3 +-- .../itkScalarImageToRunLengthMatrixFilter.hxx | 3 +-- .../include/itkSpatialNeighborSubsampler.hxx | 3 +-- .../itkLandmarkBasedTransformInitializer.hxx | 4 ++-- .../include/itkImageRegistrationMethodv4.h | 3 +-- .../include/itkImageRegistrationMethodv4.hxx | 3 +-- .../itkSegmentationLevelSetImageFilter.h | 3 +-- .../itkBinaryImageToLevelSetImageAdaptor.hxx | 18 +++++--------- .../itkUpdateMalcolmSparseLevelSet.hxx | 9 +++---- .../include/itkUpdateShiSparseLevelSet.hxx | 12 ++++------ .../itkUpdateWhitakerSparseLevelSet.hxx | 24 +++++++------------ 47 files changed, 83 insertions(+), 160 deletions(-) diff --git a/Modules/Core/Common/include/itkShapedFloodFilledFunctionConditionalConstIterator.hxx b/Modules/Core/Common/include/itkShapedFloodFilledFunctionConditionalConstIterator.hxx index 14fa816c52d..5cb1d2d47e6 100644 --- a/Modules/Core/Common/include/itkShapedFloodFilledFunctionConditionalConstIterator.hxx +++ b/Modules/Core/Common/include/itkShapedFloodFilledFunctionConditionalConstIterator.hxx @@ -80,8 +80,7 @@ ShapedFloodFilledFunctionConditionalConstIterator::Initialize m_ImageRegion = this->m_Image->GetBufferedRegion(); // Build and setup the neighborhood iterator - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType tmp_iter(radius, this->m_Image, m_ImageRegion); m_NeighborhoodIterator = tmp_iter; diff --git a/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx index 61d7d0a28ad..3fe293d68df 100644 --- a/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx @@ -211,8 +211,7 @@ ContourSpatialObject::Update() // "`ContourSpatialObject::Update()` LINEAR_INTERPOLATION case may need some adjustment" // https://github.com/InsightSoftwareConsortium/ITK/issues/3222 - PointType newPoint; - newPoint.Fill(NumericTraits::max()); + auto newPoint = MakeFilled(NumericTraits::max()); for (unsigned int i = 0; i < m_InterpolationFactor; ++i) { for (unsigned int d = 0; d < TDimension; ++d) diff --git a/Modules/Core/SpatialObjects/include/itkTubeSpatialObjectPoint.hxx b/Modules/Core/SpatialObjects/include/itkTubeSpatialObjectPoint.hxx index e9e535bcc2d..aa718224ad0 100644 --- a/Modules/Core/SpatialObjects/include/itkTubeSpatialObjectPoint.hxx +++ b/Modules/Core/SpatialObjects/include/itkTubeSpatialObjectPoint.hxx @@ -51,8 +51,7 @@ TubeSpatialObjectPoint::GetRadiusInWorldSpace() const itkExceptionMacro("The SpatialObject must be set prior to calling."); } - CovariantVectorType cVect; - cVect.Fill(m_RadiusInObjectSpace); + auto cVect = MakeFilled(m_RadiusInObjectSpace); cVect = Superclass::m_SpatialObject->GetObjectToWorldTransform()->TransformCovariantVector(cVect); double worldR = 0; for (unsigned int d = 0; d < TPointDimension; ++d) @@ -72,8 +71,7 @@ TubeSpatialObjectPoint::SetRadiusInWorldSpace(double newR) itkExceptionMacro("The SpatialObject must be set prior to calling."); } - CovariantVectorType cVect; - cVect.Fill(newR); + auto cVect = MakeFilled(newR); cVect = Superclass::m_SpatialObject->GetObjectToWorldTransform()->GetInverseTransform()->TransformCovariantVector(cVect); m_RadiusInObjectSpace = 0; diff --git a/Modules/Core/Transform/include/itkBSplineTransform.hxx b/Modules/Core/Transform/include/itkBSplineTransform.hxx index 71be98d9482..3c39fde51dc 100644 --- a/Modules/Core/Transform/include/itkBSplineTransform.hxx +++ b/Modules/Core/Transform/include/itkBSplineTransform.hxx @@ -47,9 +47,8 @@ BSplineTransform::BSplineTransfo // dir[0][2],dir[1][2],dir[2][2]] - OriginType meshOrigin{}; - PhysicalDimensionsType meshPhysical; - meshPhysical.Fill(1.0); + OriginType meshOrigin{}; + auto meshPhysical = MakeFilled(1.0); DirectionType meshDirection; meshDirection.SetIdentity(); diff --git a/Modules/Core/Transform/include/itkScaleTransform.hxx b/Modules/Core/Transform/include/itkScaleTransform.hxx index 310d46003f8..e9e1bd52ea8 100644 --- a/Modules/Core/Transform/include/itkScaleTransform.hxx +++ b/Modules/Core/Transform/include/itkScaleTransform.hxx @@ -193,8 +193,7 @@ void ScaleTransform::SetIdentity() { Superclass::SetIdentity(); - ScaleType i; - i.Fill(1.0); + auto i = MakeFilled(1.0); this->SetScale(i); } diff --git a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.h b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.h index a2cc46cb297..76930f0a916 100644 --- a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.h +++ b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.h @@ -301,9 +301,7 @@ class ITK_TEMPLATE_EXPORT N4BiasFieldCorrectionImageFilter : public ImageToImage void SetNumberOfFittingLevels(unsigned int n) { - ArrayType nlevels; - - nlevels.Fill(n); + auto nlevels = MakeFilled(n); this->SetNumberOfFittingLevels(nlevels); } diff --git a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx index 87590fc928d..6cdc23cb601 100644 --- a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx @@ -227,8 +227,7 @@ N4BiasFieldCorrectionImageFilter::Generat reconstructer->SetSplineOrder(this->m_SplineOrder); reconstructer->Update(); - typename BSplineReconstructerType::ArrayType numberOfLevels; - numberOfLevels.Fill(1); + auto numberOfLevels = MakeFilled(1); for (unsigned int d = 0; d < ImageDimension; ++d) { if (this->m_NumberOfFittingLevels[d] + 1 >= this->m_CurrentLevel && @@ -546,8 +545,7 @@ N4BiasFieldCorrectionImageFilter::UpdateB auto bspliner = BSplineFilterType::New(); typename BSplineFilterType::ArrayType numberOfControlPoints; - typename BSplineFilterType::ArrayType numberOfFittingLevels; - numberOfFittingLevels.Fill(1); + auto numberOfFittingLevels = MakeFilled(1); for (unsigned int d = 0; d < ImageDimension; ++d) { if (!this->m_LogBiasFieldControlPointLattice) diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx index 43e62ec1229..380692e5ed0 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx @@ -91,8 +91,7 @@ BinaryPruningImageFilter::ComputePruneImage() typename OutputImageType::RegionType region = pruneImage->GetRequestedRegion(); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType ot(radius, pruneImage, region); typename NeighborhoodIteratorType::OffsetType offset1 = { { -1, -1 } }; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx index 36c943ce6cd..d9fe7392f0e 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx @@ -101,8 +101,7 @@ BinaryThinningImageFilter::ComputeThinImage() typename OutputImageType::RegionType region = thinImage->GetRequestedRegion(); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType ot(radius, thinImage, region); // Create a set of offsets from the center. diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx index 767d433403c..c3560f2d922 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx @@ -132,8 +132,7 @@ ObjectMorphologyImageFilter::DynamicThreaded // Setup the kernel that spans the immediate neighbors of the current // input pixel - used to determine if that pixel abuts a non-object // pixel, i.e., is a boundary pixel - RadiusType bKernelSize; - bKernelSize.Fill(1); + auto bKernelSize = MakeFilled(1); TotalProgressReporter progress(this, this->GetOutput()->GetRequestedRegion().GetNumberOfPixels()); diff --git a/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx index 9f608da5842..6ddf9093acb 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx @@ -95,9 +95,8 @@ ConvolutionImageFilter::ComputeConvolut // Flip the kernel using FlipperType = FlipImageFilter; - auto flipper = FlipperType::New(); - typename FlipperType::FlipAxesArrayType axesArray; - axesArray.Fill(true); + auto flipper = FlipperType::New(); + auto axesArray = MakeFilled(true); flipper->SetFlipAxes(axesArray); flipper->SetInput(kernelImage); diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx index 231a8cf0d0f..87e614c44ae 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx @@ -299,8 +299,7 @@ MaskedFFTNormalizedCorrelationImageFilter // Flip the moving images along all dimensions so that the correlation can be more easily handled. using FlipperType = itk::FlipImageFilter; - typename FlipperType::FlipAxesArrayType flipAxes; - flipAxes.Fill(true); + auto flipAxes = MakeFilled(true); auto rotater = FlipperType::New(); rotater->SetFlipAxes(flipAxes); rotater->SetInput(inputImage); diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx index 18af65f7060..02e12d35d1b 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx @@ -220,8 +220,7 @@ PatchBasedDenoisingBaseImageFilter::GetPatchRadiusInV maxSpacing = spacing[dim]; } } - PatchRadiusType radius; - radius.Fill(m_PatchRadius); + auto radius = MakeFilled(m_PatchRadius); for (unsigned int dim = 0; dim < ImageDimension; ++dim) { radius[dim] = itk::Math::ceil(maxSpacing * radius[dim] / spacing[dim]); diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index f9b0ea23b97..215f45fde91 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -220,8 +220,7 @@ PatchBasedDenoisingImageFilter::Initialize() typename InputImageType::IndexType requiredIndex{}; const typename InputImageType::RegionType largestRegion = this->GetInput()->GetLargestPossibleRegion(); const PatchRadiusType radius = this->GetPatchRadiusInVoxels(); - PatchRadiusType two; - two.Fill(2); + auto two = MakeFilled(2); requiredIndex += two * radius; if (!(largestRegion.IsInside(requiredIndex))) diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.h b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.h index 369b0f9a851..4391babe19d 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.h +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.h @@ -248,9 +248,7 @@ class ITK_TEMPLATE_EXPORT DisplacementFieldToBSplineImageFilter : public ImageTo void SetNumberOfFittingLevels(unsigned int n) { - ArrayType nlevels; - - nlevels.Fill(n); + auto nlevels = MakeFilled(n); this->SetNumberOfFittingLevels(nlevels); } diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx index 794796a9f2f..57a9bb8317e 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx @@ -361,8 +361,7 @@ DisplacementFieldToBSplineImageFilter itkDebugMacro("Calculating the B-spline displacement field. "); - ArrayType close; - close.Fill(false); + auto close = MakeFilled(false); auto bspliner = BSplineFilterType::New(); bspliner->SetOrigin(this->m_BSplineDomainOrigin); diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx index d3a1a30e79a..3513bebb591 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx @@ -127,8 +127,7 @@ FastMarchingImageFilter::Initialize(LevelSetImageType * m_BufferedRegion = output->GetBufferedRegion(); m_StartIndex = m_BufferedRegion.GetIndex(); m_LastIndex = m_StartIndex + m_BufferedRegion.GetSize(); - typename LevelSetImageType::OffsetType offset; - offset.Fill(1); + auto offset = MakeFilled(1); m_LastIndex -= offset; // allocate memory for the PointTypeImage diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx index 01e62ea20f1..1d896ddbe63 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx @@ -358,8 +358,7 @@ FastMarchingImageFilterBase::CheckTopology(OutputImageType * oI if (strictTopologyViolation) { // Check for handles - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType ItL(radius, this->m_LabelImage, this->m_LabelImage->GetBufferedRegion()); ItL.SetLocation(iNode); @@ -437,8 +436,7 @@ FastMarchingImageFilterBase::InitializeOutput(OutputImageType * m_OutputOrigin = oImage->GetOrigin(); m_OutputDirection = oImage->GetDirection(); - typename OutputImageType::OffsetType offset; - offset.Fill(1); + auto offset = MakeFilled(1); m_LastIndex -= offset; // Checking for handles only requires an image to keep track of @@ -610,8 +608,7 @@ template bool FastMarchingImageFilterBase::DoesVoxelChangeViolateStrictTopology(const NodeType & idx) const { - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType It(radius, this->m_LabelImage, this->m_LabelImage->GetBufferedRegion()); It.SetLocation(idx); @@ -647,8 +644,7 @@ template bool FastMarchingImageFilterBase::IsChangeWellComposed2D(const NodeType & idx) const { - NeighborhoodRadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType It(radius, this->m_LabelImage, this->m_LabelImage->GetBufferedRegion()); It.SetLocation(idx); @@ -808,8 +804,7 @@ FastMarchingImageFilterBase::IsChangeWellComposed3D(const NodeT { std::bitset<8> neighborhoodPixels; - NeighborhoodRadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType It(radius, this->m_LabelImage, this->m_LabelImage->GetRequestedRegion()); diff --git a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx index 40f9a58882e..e6bd1d9655e 100644 --- a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx @@ -42,8 +42,7 @@ CannyEdgeDetectionImageFilter::CannyEdgeDetectionImag m_UpdateBuffer1 = OutputImageType::New(); // Set up neighborhood slices for all the dimensions. - typename Neighborhood::RadiusType r; - r.Fill(1); + auto r = MakeFilled::RadiusType>(1); // Dummy neighborhood used to set up the slices Neighborhood it; diff --git a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.h b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.h index 60ee2420c5a..609f52abef2 100644 --- a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.h @@ -139,27 +139,21 @@ class ITK_TEMPLATE_EXPORT DiscreteGaussianDerivativeImageFilter : public ImageTo void SetOrder(const typename OrderArrayType::ValueType v) { - OrderArrayType a; - - a.Fill(v); + auto a = MakeFilled(v); this->SetOrder(a); } void SetVariance(const typename ArrayType::ValueType v) { - ArrayType a; - - a.Fill(v); + auto a = MakeFilled(v); this->SetVariance(a); } void SetMaximumError(const typename ArrayType::ValueType v) { - ArrayType a; - - a.Fill(v); + auto a = MakeFilled(v); this->SetMaximumError(a); } diff --git a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h index 1114af87ed2..1712161fa92 100644 --- a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.h @@ -120,8 +120,7 @@ class ITK_TEMPLATE_EXPORT UnsharpMaskImageFilter : public ImageToImageFilter(sigma); this->SetSigmas(sigmas); // checks whether it is actually modified } diff --git a/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx index 27deeb49311..a57c3738b94 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx @@ -43,9 +43,7 @@ template void BoxImageFilter::SetRadius(const RadiusValueType & radius) { - RadiusType rad; - - rad.Fill(radius); + auto rad = MakeFilled(radius); this->SetRadius(rad); } diff --git a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilter.hxx index 091a89b5ee7..9ad769f6d49 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilter.hxx @@ -66,8 +66,7 @@ MovingHistogramImageFilter::Dyna } // now move the histogram - FixedArray direction; - direction.Fill(1); + auto direction = MakeFilled>(1); int axis = ImageDimension - 1; OffsetType offset{}; RegionType stRegion; diff --git a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx index bfd4521f459..665b3309734 100644 --- a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx @@ -102,8 +102,7 @@ VectorGradientMagnitudeImageFilter::Genera typename TInputImage::RegionType inputRequestedRegion; inputRequestedRegion = inputPtr->GetRequestedRegion(); - RadiusType r1; - r1.Fill(1); + auto r1 = MakeFilled(1); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(r1); @@ -197,8 +196,7 @@ VectorGradientMagnitudeImageFilter::Dynami // Find the data-set boundary "faces" NeighborhoodAlgorithm::ImageBoundaryFacesCalculator bC; - RadiusType r1; - r1.Fill(1); + auto r1 = MakeFilled(1); typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType faceList = bC(m_RealValuedInputImage.GetPointer(), outputRegionForThread, r1); diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx index 249a247b9e9..2c794ee18b3 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx @@ -215,8 +215,7 @@ BSplineControlPointImageFilter::DynamicThreadedGenera } } FixedArray U; - FixedArray currentU; - currentU.Fill(-1); + auto currentU = MakeFilled>(-1); typename OutputImageType::IndexType startIndex = outputPtr->GetRequestedRegion().GetIndex(); typename PointDataImageType::IndexType startPhiIndex = inputPtr->GetLargestPossibleRegion().GetIndex(); diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx index 36707477100..df3c3e79921 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx @@ -600,8 +600,7 @@ BSplineScatteredDataPointSetToImageFilter::Threade } FixedArray U; - FixedArray currentU; - currentU.Fill(-1); + auto currentU = MakeFilled>(-1); typename ImageType::IndexType startIndex = this->GetOutput()->GetRequestedRegion().GetIndex(); typename PointDataImageType::IndexType startPhiIndex = this->m_PhiLattice->GetLargestPossibleRegion().GetIndex(); @@ -921,8 +920,7 @@ BSplineScatteredDataPointSetToImageFilter::Threade } FixedArray U; - FixedArray currentU; - currentU.Fill(-1); + auto currentU = MakeFilled>(-1); typename PointDataImageType::IndexType startPhiIndex = this->m_PhiLattice->GetLargestPossibleRegion().GetIndex(); diff --git a/Modules/Filtering/ImageGrid/include/itkPermuteAxesImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkPermuteAxesImageFilter.hxx index 5091c45551f..7c8418e1b49 100644 --- a/Modules/Filtering/ImageGrid/include/itkPermuteAxesImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkPermuteAxesImageFilter.hxx @@ -74,8 +74,7 @@ PermuteAxesImageFilter::SetOrder(const PermuteOrderArrayType & order) // check that input is a rearrangement of the // numbers from 0 to ImageDimension - 1 - FixedArray used; - used.Fill(false); + auto used = MakeFilled>(false); for (j = 0; j < ImageDimension; ++j) { diff --git a/Modules/Filtering/MathematicalMorphology/include/itkBinaryCrossStructuringElement.h b/Modules/Filtering/MathematicalMorphology/include/itkBinaryCrossStructuringElement.h index 0e4ae95d5c1..0ac38cf3d8d 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkBinaryCrossStructuringElement.h +++ b/Modules/Filtering/MathematicalMorphology/include/itkBinaryCrossStructuringElement.h @@ -89,8 +89,7 @@ class ITK_TEMPLATE_EXPORT BinaryCrossStructuringElement : public Neighborhood(1); Self::SetRadius(radius); Self::CreateStructuringElement(); } diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx index eeef3962930..2460b7cced9 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx @@ -287,9 +287,9 @@ GrayscaleGeodesicDilateImageFilter::DynamicThreadedGe // Find the boundary "faces". Structuring element is elementary // (face connected neighbors within a radius of 1). - NeighborhoodAlgorithm::ImageBoundaryFacesCalculator fC; - typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::RadiusType kernelRadius; - kernelRadius.Fill(1); + NeighborhoodAlgorithm::ImageBoundaryFacesCalculator fC; + auto kernelRadius = + MakeFilled::RadiusType>(1); typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType faceList = fC(this->GetMarkerImage(), outputRegionForThread, kernelRadius); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx index 2eb21721207..2cbcd528f0c 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx @@ -283,9 +283,9 @@ GrayscaleGeodesicErodeImageFilter::DynamicThreadedGen // Find the boundary "faces". Structuring element is elementary // (face connected neighbors within a radius of 1). - NeighborhoodAlgorithm::ImageBoundaryFacesCalculator fC; - typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::RadiusType kernelRadius; - kernelRadius.Fill(1); + NeighborhoodAlgorithm::ImageBoundaryFacesCalculator fC; + auto kernelRadius = + MakeFilled::RadiusType>(1); typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType faceList = fC(this->GetMarkerImage(), outputRegionForThread, kernelRadius); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkMaskedMovingHistogramImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkMaskedMovingHistogramImageFilter.hxx index 212ca439ab1..a2d316268c9 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkMaskedMovingHistogramImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkMaskedMovingHistogramImageFilter.hxx @@ -158,8 +158,7 @@ MaskedMovingHistogramImageFilter direction; - direction.Fill(1); + auto direction = MakeFilled>(1); int axis = ImageDimension - 1; OffsetType offset{}; RegionType stRegion; diff --git a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx index 94a82ce7f49..0539abee358 100644 --- a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx @@ -81,8 +81,7 @@ FFTDiscreteGaussianImageFilter::GenerateKernelImage() // Get directional 1D Gaussian kernels to compose image itk::VariableLengthVector directionalOperators; directionalOperators.SetSize(this->GetFilterDimensionality()); - RadiusType kernelSize; - kernelSize.Fill(1); + auto kernelSize = MakeFilled(1); for (size_t dim = 0; dim < this->GetFilterDimensionality(); ++dim) { this->GenerateKernel(dim, directionalOperators[dim]); diff --git a/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.h b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.h index cda55535f1c..676b068b993 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.h +++ b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.h @@ -349,8 +349,7 @@ class ITK_TEMPLATE_EXPORT MultiphaseFiniteDifferenceImageFilter : public InPlace m_DifferenceFunctions.resize(m_FunctionCount, nullptr); - RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); for (unsigned int i = 0; i < this->m_FunctionCount; ++i) { diff --git a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx index 102f68f0d77..80d0de33ee3 100644 --- a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx @@ -372,8 +372,7 @@ typename ObjectToObjectMetric::OneValue()); + auto spacing = MakeFilled(NumericTraits::OneValue()); return spacing; } } @@ -393,8 +392,8 @@ typename ObjectToObjectMetric::OneValue()); + auto direction = + MakeFilled(NumericTraits::OneValue()); return direction; } } diff --git a/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx b/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx index bf78da241f8..9154fa8731c 100644 --- a/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx @@ -89,8 +89,7 @@ WindowConvergenceMonitoringFunction::GetConvergenceValue() const -> Rea bspliner->SetSize(size); bspliner->SetNumberOfLevels(1); bspliner->SetSplineOrder(1); - typename BSplinerType::ArrayType ncps; - ncps.Fill(bspliner->GetSplineOrder()[0] + 1); + auto ncps = MakeFilled(bspliner->GetSplineOrder()[0] + 1); bspliner->SetNumberOfControlPoints(ncps); bspliner->SetNumberOfWorkUnits(1); diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx index 85afde38bc2..aef6bf2b14c 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx @@ -74,8 +74,7 @@ template void ScalarImageToCooccurrenceListSampleFilter::GenerateData() { - typename ShapedNeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); using FaceCalculatorType = itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator; diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx index 517dfd58edc..9f2d283eef6 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx @@ -154,8 +154,7 @@ ScalarImageToCooccurrenceMatrixFilter(minRadius); const MaskImageType * maskImage = nullptr; diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx index 066a1bb7206..b5a10463952 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx @@ -146,8 +146,7 @@ ScalarImageToRunLengthMatrixFilter::Ge // distance/intensity pair to the histogram using NeighborhoodIteratorType = ConstNeighborhoodIterator; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighborIt(radius, inputImage, inputImage->GetRequestedRegion()); diff --git a/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx b/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx index 2ada5cf7c2d..d1050c2ca10 100644 --- a/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx +++ b/Modules/Numerics/Statistics/include/itkSpatialNeighborSubsampler.hxx @@ -71,8 +71,7 @@ template void SpatialNeighborSubsampler::SetRadius(unsigned int radius) { - RadiusType radiusND; - radiusND.Fill(radius); + auto radiusND = MakeFilled(radius); this->SetRadius(radiusND); } diff --git a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx index 73d04040bac..ff299d80452 100644 --- a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx +++ b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx @@ -152,8 +152,8 @@ LandmarkBasedTransformInitializer::Intern filter->SetGenerateOutputImage(false); filter->SetSplineOrder(SplineOrder); - typename FilterType::ArrayType ncps; - ncps.Fill(this->m_BSplineNumberOfControlPoints); // Should be greater than SplineOrder + auto ncps = MakeFilled( + this->m_BSplineNumberOfControlPoints); // Should be greater than SplineOrder filter->SetNumberOfControlPoints(ncps); filter->SetNumberOfLevels(3); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h index 3b96d945b99..471b3bbc42f 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h @@ -384,8 +384,7 @@ class ITK_TEMPLATE_EXPORT ImageRegistrationMethodv4 : public ProcessObject { for (unsigned int level = 0; level < factors.Size(); ++level) { - ShrinkFactorsPerDimensionContainerType shrinkFactors; - shrinkFactors.Fill(factors[level]); + auto shrinkFactors = MakeFilled(factors[level]); this->SetShrinkFactorsPerDimension(level, shrinkFactors); } } diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx index 5c6ef3e079b..e5356c1287f 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx @@ -871,8 +871,7 @@ ImageRegistrationMethodv4m_NumberOfLevels; ++level) { - ShrinkFactorsPerDimensionContainerType shrinkFactors; - shrinkFactors.Fill(1); + auto shrinkFactors = MakeFilled(1); this->SetShrinkFactorsPerDimension(level, shrinkFactors); } diff --git a/Modules/Segmentation/LevelSets/include/itkSegmentationLevelSetImageFilter.h b/Modules/Segmentation/LevelSets/include/itkSegmentationLevelSetImageFilter.h index 48c19c2dac9..ea884ebb8f7 100644 --- a/Modules/Segmentation/LevelSets/include/itkSegmentationLevelSetImageFilter.h +++ b/Modules/Segmentation/LevelSets/include/itkSegmentationLevelSetImageFilter.h @@ -439,8 +439,7 @@ class ITK_TEMPLATE_EXPORT SegmentationLevelSetImageFilter { m_SegmentationFunction = s; - typename SegmentationFunctionType::RadiusType r; - r.Fill(1); + auto r = MakeFilled(1); m_SegmentationFunction->Initialize(r); this->SetDifferenceFunction(m_SegmentationFunction); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx index 45ca00761e5..93d26da8eff 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx @@ -134,8 +134,7 @@ BinaryImageToLevelSetImageAdaptorm_LevelSet->GetLayer(outputLayer); const auto plus2 = static_cast(outputLayer); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); ZeroFluxNeumannBoundaryCondition im_nbc; @@ -198,8 +197,7 @@ BinaryImageToLevelSetImageAdaptorm_LevelSet->GetLayer(LevelSetType::ZeroLayer()); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); ZeroFluxNeumannBoundaryCondition im_nbc; @@ -262,8 +260,7 @@ BinaryImageToLevelSetImageAdaptorm_LevelSet->GetLayer(LevelSetType::MinusOneLayer()); LevelSetLayerType & layerPlus1 = this->m_LevelSet->GetLayer(LevelSetType::PlusOneLayer()); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); ZeroFluxNeumannBoundaryCondition im_nbc; @@ -402,8 +399,7 @@ BinaryImageToLevelSetImageAdaptorm_LevelSet->GetLayer(LevelSetType::MinusOneLayer()); LevelSetLayerType & layerPlus1 = this->m_LevelSet->GetLayer(LevelSetType::PlusOneLayer()); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); ZeroFluxNeumannBoundaryCondition im_nbc; @@ -545,8 +541,7 @@ BinaryImageToLevelSetImageAdaptorm_LevelSet->GetLayer(LevelSetType::ZeroLayer()); - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); ZeroFluxNeumannBoundaryCondition im_nbc; @@ -608,8 +603,7 @@ BinaryImageToLevelSetImageAdaptor sp_nbc; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx index c6222d0e660..afca35a5b2a 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx @@ -169,8 +169,7 @@ UpdateMalcolmSparseLevelSet::EvolveWithUnPhasedP // neighborhood iterator ZeroFluxNeumannBoundaryCondition sp_nbc; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -259,8 +258,7 @@ UpdateMalcolmSparseLevelSet::EvolveWithPhasedPro ZeroFluxNeumannBoundaryCondition sp_nbc; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -354,8 +352,7 @@ UpdateMalcolmSparseLevelSet::CompactLayersToSing ZeroFluxNeumannBoundaryCondition sp_nbc; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx index 3e774117912..0d9a7c6c3be 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx @@ -65,8 +65,7 @@ UpdateShiSparseLevelSet::Update() // neighborhood iterator ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -185,8 +184,7 @@ UpdateShiSparseLevelSet::UpdateLayerPlusOne() ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -285,8 +283,7 @@ UpdateShiSparseLevelSet::UpdateLayerMinusOne() ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -382,8 +379,7 @@ UpdateShiSparseLevelSet::Con(const LevelSetInput ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx index 35ca859d8d2..1e400d6466b 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx @@ -104,8 +104,7 @@ UpdateWhitakerSparseLevelSet /** todo: put neighborhood creation in protected method */ ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -195,8 +194,7 @@ UpdateWhitakerSparseLevelSet ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -357,8 +355,7 @@ UpdateWhitakerSparseLevelSet ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -463,8 +460,7 @@ UpdateWhitakerSparseLevelSet { ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -569,8 +565,7 @@ UpdateWhitakerSparseLevelSet { ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -674,8 +669,7 @@ UpdateWhitakerSparseLevelSet { ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -802,8 +796,7 @@ UpdateWhitakerSparseLevelSet { ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion()); @@ -860,8 +853,7 @@ UpdateWhitakerSparseLevelSet { ZeroFluxNeumannBoundaryCondition spNBC; - typename NeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = MakeFilled(1); NeighborhoodIteratorType neighIt(radius, this->m_InternalImage, this->m_InternalImage->GetLargestPossibleRegion());