diff --git a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx index 95f9443ca10..5426f1e9821 100644 --- a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx +++ b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx @@ -204,8 +204,7 @@ itkAdaptorComparisonTest(int, char *[]) vector_image->SetRegions(region); vector_image->Allocate(); - VectorImageType::PixelType initialVectorValue; - initialVectorValue.Fill(1.2345); // arbitrary value; + auto initialVectorValue = itk::MakeFilled(1.2345); // arbitrary value; vector_image->FillBuffer(initialVectorValue); // Time trials diff --git a/Modules/Core/Common/test/itkAggregateTypesGTest.cxx b/Modules/Core/Common/test/itkAggregateTypesGTest.cxx index d92204aa1d8..5f1f9a339d5 100644 --- a/Modules/Core/Common/test/itkAggregateTypesGTest.cxx +++ b/Modules/Core/Common/test/itkAggregateTypesGTest.cxx @@ -287,11 +287,10 @@ class CommonIndexOffsetMathOps //============ Test Copy with Round/Cast Type ==================================== { - AggregateType known3s{ { 3, 3, 3, 3 } }; - AggregateType threes{}; - AggregateType known4s{ { 4, 4, 4, 4 } }; - itk::Point p1; - p1.Fill(3.5); + AggregateType known3s{ { 3, 3, 3, 3 } }; + AggregateType threes{}; + AggregateType known4s{ { 4, 4, 4, 4 } }; + auto p1 = itk::MakeFilled>(3.5); threes.CopyWithRound(p1); ITK_EXPECT_VECTOR_NEAR(threes, known4s, 0); diff --git a/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx index 2d667fbc2d3..f7533b28865 100644 --- a/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx @@ -50,14 +50,12 @@ itkConicShellInteriorExteriorSpatialFunctionTest(int, char *[]) InteriorExteriorSpatialFunction); // Set the conic shell properties - ConicShellInteriorExteriorSpatialFunctionType::InputType origin; - origin.Fill(1.0); + auto origin = itk::MakeFilled(1.0); conicShellInteriorExteriorSpatialFunction->SetOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, conicShellInteriorExteriorSpatialFunction->GetOrigin()); - ConicShellInteriorExteriorSpatialFunctionType::GradientType originGradient; - originGradient.Fill(1.6); + auto originGradient = itk::MakeFilled(1.6); originGradient.GetVnlVector().normalize(); conicShellInteriorExteriorSpatialFunction->SetOriginGradient(originGradient); diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx index 23f92a30beb..b2f4f9d096d 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx @@ -192,8 +192,7 @@ itkConstNeighborhoodIteratorTest(int, char *[]) printnb>(ra_it, false); println("Adding [1, 1, 1, 1]"); - OffsetType a_off; - a_off.Fill(1); + auto a_off = itk::MakeFilled(1); ra_it += a_off; printnb>(ra_it, false); diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx index 4f0ee2b019f..95e03391a38 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx @@ -241,8 +241,7 @@ itkConstNeighborhoodIteratorWithOnlyIndexTestRun() ra_it.SetLocation(loc); std::cout << "Adding [1, 1, 1, 1]" << std::endl; - OffsetType a_off; - a_off.Fill(1); + auto a_off = itk::MakeFilled(1); ra_it += a_off; for (unsigned int i = 0; i < 4; ++i) { diff --git a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx index 97b2f9b0377..067af08df4f 100644 --- a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx @@ -43,8 +43,7 @@ itkFrustumSpatialFunctionTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(frustrumSpatialFunction, FrustumSpatialFunction, InteriorExteriorSpatialFunction); // Set the frustum properties - FrustumSpatialFunctionType::InputType apex; - apex.Fill(1.1); + auto apex = itk::MakeFilled(1.1); frustrumSpatialFunction->SetApex(apex); ITK_TEST_SET_GET_VALUE(apex, frustrumSpatialFunction->GetApex()); diff --git a/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx b/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx index e2165555e26..338b83813c2 100644 --- a/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx @@ -62,8 +62,7 @@ ComputeOffset(TImage * image, unsigned int count, unsigned int repeat) typename TImage::OffsetValueType offset = 0; typename TImage::OffsetValueType accum = 0; typename TImage::IndexType index; - typename TImage::OffsetType indexIncr; - indexIncr.Fill(1); + auto indexIncr = itk::MakeFilled(1); for (unsigned int j = 0; j < repeat; ++j) { @@ -86,8 +85,7 @@ ComputeFastOffset(TImage * image, unsigned int count, unsigned int repeat) typename TImage::OffsetValueType offset = 0; typename TImage::OffsetValueType accum = 0; typename TImage::IndexType index; - typename TImage::OffsetType indexIncr; - indexIncr.Fill(1); + auto indexIncr = itk::MakeFilled(1); const typename TImage::OffsetValueType * offsetTable = image->GetOffsetTable(); diff --git a/Modules/Core/Common/test/itkImageIteratorTest.cxx b/Modules/Core/Common/test/itkImageIteratorTest.cxx index ee883ed7b96..0d857e3df7f 100644 --- a/Modules/Core/Common/test/itkImageIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageIteratorTest.cxx @@ -68,8 +68,7 @@ itkImageIteratorTest(int, char *[]) o3->SetSpacing(spacing3D); o3->Allocate(); - itk::Vector fillValue; - fillValue.Fill(itk::NumericTraits::max()); + auto fillValue = itk::MakeFilled>(itk::NumericTraits::max()); o3->FillBuffer(fillValue); std::cout << "Setting/Getting a pixel" << std::endl; diff --git a/Modules/Core/Common/test/itkImageIteratorWithIndexTest.cxx b/Modules/Core/Common/test/itkImageIteratorWithIndexTest.cxx index 0a3ce8fafd5..7d875defc66 100644 --- a/Modules/Core/Common/test/itkImageIteratorWithIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageIteratorWithIndexTest.cxx @@ -264,8 +264,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VC = itk::Vector; - VC vc; - vc.Fill(127); + auto vc = itk::MakeFilled(127); itkImageIteratorWithIndexTestIteratorTester TesterVC(vc); if (TesterVC.TestIterator() == false) { @@ -282,8 +281,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VUC = itk::Vector; - VUC vuc; - vuc.Fill(10); + auto vuc = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVUC(vuc); if (TesterVUC.TestIterator() == false) { @@ -300,8 +298,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VS = itk::Vector; - VS vs; - vs.Fill(10); + auto vs = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVS(vs); if (TesterVS.TestIterator() == false) { @@ -318,8 +315,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VUS = itk::Vector; - VUS vus; - vus.Fill(10); + auto vus = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVUS(vus); if (TesterVUS.TestIterator() == false) { @@ -336,8 +332,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VI = itk::Vector; - VI vi; - vi.Fill(10); + auto vi = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVI(vi); if (TesterVI.TestIterator() == false) { @@ -354,8 +349,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VUI = itk::Vector; - VUI vui; - vui.Fill(10); + auto vui = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVUI(vui); if (TesterVUI.TestIterator() == false) { @@ -372,8 +366,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VF = itk::Vector; - VF vf; - vf.Fill(10); + auto vf = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVF(vf); if (TesterVF.TestIterator() == false) { @@ -390,8 +383,7 @@ itkImageIteratorWithIndexTest(int, char *[]) std::cout << "Testing with Image< itk::Vector, 3 > " << std::endl; using VD = itk::Vector; - VD vd; - vd.Fill(10); + auto vd = itk::MakeFilled(10); itkImageIteratorWithIndexTestIteratorTester TesterVD(vd); if (TesterVD.TestIterator() == false) { diff --git a/Modules/Core/Common/test/itkImageTest.cxx b/Modules/Core/Common/test/itkImageTest.cxx index f5b58e33276..b4a071d6a1a 100644 --- a/Modules/Core/Common/test/itkImageTest.cxx +++ b/Modules/Core/Common/test/itkImageTest.cxx @@ -62,10 +62,8 @@ itkImageTest(int, char *[]) image->GetSource(); image->DisconnectPipeline(); - Image::SpacingType spacing; - spacing.Fill(1.0); - Image::PointType origin; - origin.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); + auto origin = itk::MakeFilled(1.0); Image::DirectionType direction; direction[0][0] = .5; direction[0][1] = .7; @@ -127,9 +125,8 @@ itkImageTest(int, char *[]) region.SetSize(size); image->SetRegions(region); - auto imageRef = Image::New(); - Image::SpacingType spacingRef; - spacingRef.Fill(2); + auto imageRef = Image::New(); + auto spacingRef = itk::MakeFilled(2); Image::PointType originRef{}; Image::DirectionType directionRef; directionRef.SetIdentity(); @@ -161,9 +158,8 @@ itkImageTest(int, char *[]) } using Image3D = itk::Image; - auto volume = Image3D::New(); - Image3D::SpacingType spacingVol; - spacingVol.Fill(1); + auto volume = Image3D::New(); + auto spacingVol = itk::MakeFilled(1); Image3D::PointType originVol{}; Image3D::DirectionType directionVol; directionVol.SetIdentity(); diff --git a/Modules/Core/Common/test/itkMatrixTest.cxx b/Modules/Core/Common/test/itkMatrixTest.cxx index 528d9d62a92..3378eac3480 100644 --- a/Modules/Core/Common/test/itkMatrixTest.cxx +++ b/Modules/Core/Common/test/itkMatrixTest.cxx @@ -85,8 +85,7 @@ itkMatrixTest(int, char *[]) MatrixType matrix4; matrix4 = matrix.GetTranspose(); - MatrixType matrix5; - matrix5.Fill(1.7); + auto matrix5 = itk::MakeFilled(1.7); constexpr NumericType value = 2; matrix5[1][1] = value; @@ -332,8 +331,7 @@ itkMatrixTest(int, char *[]) } using LargeMatrixType = itk::Matrix; - LargeMatrixType matrixBad; - matrixBad.Fill(2.0); + auto matrixBad = itk::MakeFilled(2.0); ITK_TRY_EXPECT_EXCEPTION(matrixBad.GetInverse()); matrixBad.SetIdentity(); diff --git a/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx b/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx index 6f8ad5f363a..131d0e2ba94 100644 --- a/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx +++ b/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx @@ -68,8 +68,7 @@ itkPointSetToImageFilterTest1(int argc, char * argv[]) BinaryImageType::SpacingType::ValueType spacingValue = 1.0; - BinaryImageType::SpacingType spacing; - spacing.Fill(spacingValue); + auto spacing = itk::MakeFilled(spacingValue); filter->SetSpacing(spacing); ITK_TEST_SET_GET_VALUE(spacing, filter->GetSpacing()); diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx index 86561145cb5..cba52c5efc8 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx @@ -426,8 +426,7 @@ itkSymmetricSecondRankTensorTest(int, char *[]) tensor3D(2, 1) = 0.0; // overrides (1,2) tensor3D(2, 2) = 29.0; - Double3DMatrixType matrix3D; - matrix3D.Fill(1.0); + auto matrix3D = itk::MakeFilled(1.0); std::vector ans; ans.push_back(26); ans.push_back(23); diff --git a/Modules/Core/Common/test/itkThreadedIndexedContainerPartitionerTest.cxx b/Modules/Core/Common/test/itkThreadedIndexedContainerPartitionerTest.cxx index e994dfa97f7..1a5cb9afb51 100644 --- a/Modules/Core/Common/test/itkThreadedIndexedContainerPartitionerTest.cxx +++ b/Modules/Core/Common/test/itkThreadedIndexedContainerPartitionerTest.cxx @@ -52,8 +52,7 @@ class DomainThreaderAssociate BeforeThreadedExecution() override { this->m_DomainInThreadedExecution.resize(this->GetNumberOfWorkUnitsUsed()); - DomainType unsetDomain; - unsetDomain.Fill(-1); + auto unsetDomain = itk::MakeFilled(-1); for (auto & i : m_DomainInThreadedExecution) { i = unsetDomain; diff --git a/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx index d2e7cc8001f..e35ed14a5a3 100644 --- a/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx @@ -44,8 +44,7 @@ itkTorusInteriorExteriorSpatialFunctionTest(int, char *[]) torusInteriorExteriorSpatialFunction, TorusInteriorExteriorSpatialFunction, InteriorExteriorSpatialFunction); // Set the torus properties - TorusInteriorExteriorSpatialFunctionType::InputType origin; - origin.Fill(1.0); + auto origin = itk::MakeFilled(1.0); torusInteriorExteriorSpatialFunction->SetOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, torusInteriorExteriorSpatialFunction->GetOrigin()); diff --git a/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx index 167a572024c..98c84eacccb 100644 --- a/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx @@ -155,8 +155,7 @@ itkImageAdaptorTest(int, char *[]) } - myImageType::PointType imageOrigin; - imageOrigin.Fill(10.0); + auto imageOrigin = itk::MakeFilled(10.0); myImage->SetOrigin(imageOrigin); if (myImage->GetOrigin() != myAdaptor->GetOrigin()) { @@ -184,8 +183,7 @@ itkImageAdaptorTest(int, char *[]) } - myImageType::SpacingType imageSpacing; - imageSpacing.Fill(10.0); + auto imageSpacing = itk::MakeFilled(10.0); myImage->SetSpacing(imageSpacing); if (myImage->GetSpacing() != myAdaptor->GetSpacing()) diff --git a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx index ed275a0760f..65c857f3a36 100644 --- a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx @@ -707,8 +707,7 @@ itkVectorImageTest(int, char * argv[]) std::cout << "Testing ConstNeighborhoodIterator...." << std::endl; using ConstNeighborhoodIteratorType = itk::ConstNeighborhoodIterator; - ConstNeighborhoodIteratorType::RadiusType radius; - radius.Fill(1); + auto radius = itk::MakeFilled(1); ConstNeighborhoodIteratorType::RegionType region = vectorImage->GetBufferedRegion(); auto size = ConstNeighborhoodIteratorType::SizeType::Filled(4); @@ -782,8 +781,7 @@ itkVectorImageTest(int, char * argv[]) // Test operator- --cNit; - ConstNeighborhoodIteratorType::OffsetType offset; - offset.Fill(1); + auto offset = itk::MakeFilled(1); cNit -= offset; itk::VariableLengthVector pixel = cNit.GetCenterPixel(); itk::VariableLengthVector correctAnswer(VectorLength); diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx index fd556dac607..a3428f96752 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx @@ -132,8 +132,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() } // test continuous index - typename FunctionType::ContinuousIndexType cindex; - cindex.Fill(8.0); + auto cindex = itk::MakeFilled(8.0); OutputType continuousIndexOutput = function->EvaluateAtContinuousIndex(cindex); std::cout << "ContinuousIndex: " << cindex << " Derivative: "; std::cout << continuousIndexOutput << std::endl; @@ -144,8 +143,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() result = EXIT_FAILURE; } - typename FunctionType::PointType point; - point.Fill(8.0); + auto point = itk::MakeFilled(8.0); OutputType pointOutput = function->Evaluate(point); std::cout << "Point: " << point << " Derivative: "; std::cout << pointOutput << std::endl; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx index bd9d9b9dca5..fc06816de0d 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx @@ -76,8 +76,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) std::cout << "Index: " << index << " is inside the BufferedRegion." << std::endl; } - FunctionType::ContinuousIndexType cindex; - cindex.Fill(8.0); + auto cindex = itk::MakeFilled(8.0); OutputType continuousIndexOutput = function->EvaluateAtContinuousIndex(cindex); std::cout << "ContinuousIndex: " << cindex << " Derivative: "; std::cout << continuousIndexOutput << std::endl; @@ -88,8 +87,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) result = EXIT_FAILURE; } - FunctionType::PointType point; - point.Fill(8.0); + auto point = itk::MakeFilled(8.0); OutputType pointOutput = function->Evaluate(point); std::cout << "Point: " << point << " Derivative: "; std::cout << pointOutput << std::endl; diff --git a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx index d39e3826ca9..a1da8c8d4c0 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx @@ -101,9 +101,7 @@ itkGaussianBlurImageFunctionTest(int, char *[]) // Testing Set/GetMaximumError() { std::cout << "Testing Set/GetMaximumError(): "; - GFunctionType::ErrorArrayType setError; - - setError.Fill(0.05); + auto setError = itk::MakeFilled(0.05); gaussianFunction->SetMaximumError(setError); const GFunctionType::ErrorArrayType & readError = gaussianFunction->GetMaximumError(); @@ -187,8 +185,7 @@ itkGaussianBlurImageFunctionTest(int, char *[]) blurredvalue_point = gaussianFunction->Evaluate(pt); - GFunctionType::ContinuousIndexType continuousIndex; - continuousIndex.Fill(25); + auto continuousIndex = itk::MakeFilled(25); GFunctionType::OutputType blurredvalue_continuousIndex; blurredvalue_continuousIndex = gaussianFunction->EvaluateAtContinuousIndex(continuousIndex); diff --git a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx index 047ee8c663d..e871fecfb3e 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx @@ -104,8 +104,7 @@ TestGaussianDerivativeImageFunction() typename DoGFunctionType::OutputType gradientPoint; gradientPoint = DoG->Evaluate(pt); - typename DoGFunctionType::ContinuousIndexType continuousIndex; - continuousIndex.Fill(25); + auto continuousIndex = itk::MakeFilled(25); typename DoGFunctionType::OutputType gradientContinuousIndex; gradientContinuousIndex = DoG->EvaluateAtContinuousIndex(continuousIndex); diff --git a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx index 1ff2e386268..dca4ddfb6b6 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx @@ -32,8 +32,7 @@ itkGaussianInterpolateImageFunctionTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(interpolator, GaussianInterpolateImageFunction, InterpolateImageFunction); - InterpolatorType::ArrayType sigma; - sigma.Fill(1.0); + auto sigma = itk::MakeFilled(1.0); interpolator->SetSigma(sigma); ITK_TEST_SET_GET_VALUE(sigma, interpolator->GetSigma()); diff --git a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx index 8d2b8836314..d7540df8f07 100644 --- a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx @@ -56,10 +56,8 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) small_image->Allocate(); { - ImageType::SpacingType spacing; - spacing.Fill(FOV / static_cast(small_ySize)); - ImageType::PointType origin; - origin.Fill(0.5 * FOV / static_cast(small_ySize)); + auto spacing = itk::MakeFilled(FOV / static_cast(small_ySize)); + auto origin = itk::MakeFilled(0.5 * FOV / static_cast(small_ySize)); small_image->SetOrigin(origin); small_image->SetSpacing(spacing); @@ -128,10 +126,8 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) large_image->Allocate(); { - ImageType::SpacingType spacing; - spacing.Fill(FOV / static_cast(large_ySize)); - ImageType::PointType origin; - origin.Fill(0.5 * FOV / static_cast(large_ySize)); + auto spacing = itk::MakeFilled(FOV / static_cast(large_ySize)); + auto origin = itk::MakeFilled(0.5 * FOV / static_cast(large_ySize)); large_image->SetOrigin(origin); large_image->SetSpacing(spacing); diff --git a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx index cf1e64c056a..b99c6726612 100644 --- a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx @@ -84,8 +84,7 @@ itkNeighborhoodOperatorImageFunctionTest(int, char *[]) std::cout << "EvaluateAtContinuousIndex: "; - FunctionType::ContinuousIndexType continuousIndex; - continuousIndex.Fill(25); + auto continuousIndex = itk::MakeFilled(25); function->EvaluateAtContinuousIndex(continuousIndex); diff --git a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx index 999fdae4bbc..f13834b0338 100644 --- a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx @@ -56,8 +56,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a PointType origin{}; - SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); /* Set origin and spacing of physical coordinates */ image->SetOrigin(origin); diff --git a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx index 251c4604248..67d17b19d60 100644 --- a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx @@ -37,14 +37,12 @@ itkRegularSphereMeshSourceTest(int, char *[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - PointType center; - center.Fill(7.4); + auto center = itk::MakeFilled(7.4); constexpr double radius = 1.5; const double tolerance = 1e-5; - VectorType scale; - scale.Fill(radius); + auto scale = itk::MakeFilled(radius); mySphereMeshSource->SetCenter(center); ITK_TEST_SET_GET_VALUE(center, mySphereMeshSource->GetCenter()); diff --git a/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx b/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx index aa23f7af456..45d30fd3a82 100644 --- a/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx @@ -45,9 +45,8 @@ itkSimplexMeshAdaptTopologyFilterTest(int argc, char * argv[]) // declare the triangle to simplex mesh filter using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(10); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx index 8d74eb31438..6f28bdf49bd 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx @@ -36,9 +36,8 @@ itkTriangleMeshToBinaryImageFilterTest1(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(50); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(50); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx index 867e496780c..6d7c3d3cd09 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx @@ -43,9 +43,8 @@ itkTriangleMeshToBinaryImageFilterTest2(int argc, char * argv[]) using TriangleFilterType = itk::SimplexMeshToTriangleMeshFilter; using TriangleMeshPointer = TriangleMeshType::Pointer; - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(-5); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(-5); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx index 111730db482..d3852a2d8f1 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx @@ -42,14 +42,12 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - PointType center; - center.Fill(7.4); + auto center = itk::MakeFilled(7.4); constexpr double radius = 1.5; const double tolerance = 1e-5; - VectorType scale; - scale.Fill(radius); + auto scale = itk::MakeFilled(radius); mySphereMeshSource->SetCenter(center); mySphereMeshSource->SetResolution(1); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx index 7251a35af9c..d7fefeb0bf2 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx @@ -45,8 +45,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[]) PointType center{}; - VectorType scale; - scale.Fill(1.0); + auto scale = itk::MakeFilled(1.0); mySphereMeshSource->SetCenter(center); mySphereMeshSource->SetResolution(1); diff --git a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx index 312f1e82568..8307a808cb6 100644 --- a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx @@ -140,11 +140,9 @@ itkContourSpatialObjectPointTest(int, char *[]) pOriginal.SetPositionInObjectSpace(42, 41, 43); // itk::ContourSpatialObjectPoint - ContourSpatialObjectPoint3DType::CovariantVectorType normal; - normal.Fill(276); + auto normal = itk::MakeFilled(276); pOriginal.SetNormalInObjectSpace(normal); - ContourSpatialObjectPoint3DType::PointType picked; - picked.Fill(277); + auto picked = itk::MakeFilled(277); pOriginal.SetPickedPointInObjectSpace(picked); // Copy diff --git a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx index 7d4440df209..b3c004355a7 100644 --- a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx @@ -63,8 +63,7 @@ itkDTITubeSpatialObjectTest(int, char *[]) TubePointListType list; - TubeType::TransformType::OffsetType offset; - offset.Fill(10); + auto offset = itk::MakeFilled(10); tube1->GetModifiableObjectToParentTransform()->SetOffset(offset); for (unsigned int i = 0; i < 10; ++i) @@ -533,14 +532,11 @@ itkDTITubeSpatialObjectTest(int, char *[]) pOriginal.SetPositionInObjectSpace(42, 41, 43); // itk::TubeSpatialObjectPoint - TubePointType::VectorType tangent; - tangent.Fill(1); + auto tangent = itk::MakeFilled(1); pOriginal.SetTangentInObjectSpace(tangent); - TubePointType::CovariantVectorType normal1; - normal1.Fill(2); + auto normal1 = itk::MakeFilled(2); pOriginal.SetNormal1InObjectSpace(normal1); - TubePointType::CovariantVectorType normal2; - normal2.Fill(3); + auto normal2 = itk::MakeFilled(3); pOriginal.SetNormal2InObjectSpace(normal2); pOriginal.SetRadiusInObjectSpace(1.0); pOriginal.SetMedialness(2.0); diff --git a/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx index 1dcc2cff43b..89ed45c2917 100644 --- a/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx @@ -85,13 +85,11 @@ itkEllipseSpatialObjectTest(int, char *[]) myEllipse2->SetRadiusInObjectSpace(1); myEllipse->AddChild(myEllipse2); - EllipseType::TransformType::OffsetType offset; - offset.Fill(10); + auto offset = itk::MakeFilled(10); myEllipse->GetModifiableObjectToWorldTransform()->SetOffset(offset); myEllipse->ComputeObjectToParentTransform(); - EllipseType::TransformType::OffsetType offset2; - offset2.Fill(15); + auto offset2 = itk::MakeFilled(15); myEllipse2->GetModifiableObjectToWorldTransform()->SetOffset(offset2); myEllipse2->ComputeObjectToParentTransform(); diff --git a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx index 9ddaa637b8f..d06d25a1fd0 100644 --- a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx @@ -98,8 +98,7 @@ itkGaussianSpatialObjectTest(int, char *[]) std::cout << "SetOffset" << std::endl; const GaussianType::TransformType::OffsetType::ValueType offset10 = 10.0; - GaussianType::TransformType::OffsetType offset; - offset.Fill(offset10); + auto offset = itk::MakeFilled(offset10); myGaussian->GetModifiableObjectToWorldTransform()->SetOffset(offset); myGaussian->ComputeObjectToParentTransform(); @@ -109,8 +108,7 @@ itkGaussianSpatialObjectTest(int, char *[]) std::cout << "SetOffset2" << std::endl; const GaussianType::TransformType::OffsetType::ValueType offset15 = 15.0; - GaussianType::TransformType::OffsetType offset2; - offset2.Fill(offset15); + auto offset2 = itk::MakeFilled(offset15); myGaussian2->GetModifiableObjectToWorldTransform()->SetOffset(offset2); myGaussian2->ComputeObjectToParentTransform(); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx index cef9d89045a..af4c720f14e 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx @@ -47,8 +47,7 @@ itkImageMaskSpatialObjectTest3(int, char *[]) ImageType::PointType origin{}; image->SetOrigin(origin); - ImageType::SpacingType spacing; - spacing.Fill(1); + auto spacing = itk::MakeFilled(1); image->SetSpacing(spacing); ImageType::IndexType index{}; diff --git a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx index ae371d2cc77..ba5a285fb82 100644 --- a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx @@ -48,8 +48,7 @@ itkImageSpatialObjectTest(int, char *[]) ImageType::SizeType size = { { 10, 10, 10 } }; ImageType::IndexType index = { { 0, 0, 0 } }; ImageType::RegionType region; - ImageType::PointType origin; - origin.Fill(5); + auto origin = itk::MakeFilled(5); region.SetSize(size); region.SetIndex(index); @@ -78,8 +77,7 @@ itkImageSpatialObjectTest(int, char *[]) imageSO->SetImage(image); imageSO->Update(); - ImageSpatialObject::TransformType::OffsetType offset; - offset.Fill(5); + auto offset = itk::MakeFilled(5); imageSO->GetModifiableObjectToParentTransform()->SetOffset(offset); imageSO->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkLineSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkLineSpatialObjectTest.cxx index d298591599b..daa6e5dbc22 100644 --- a/Modules/Core/SpatialObjects/test/itkLineSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkLineSpatialObjectTest.cxx @@ -176,8 +176,7 @@ itkLineSpatialObjectTest(int, char *[]) pOriginal.SetPositionInObjectSpace(42, 41, 43); // itk::LineSpatialObjectPoint - VectorType normal; - normal.Fill(276); + auto normal = itk::MakeFilled(276); pOriginal.SetNormalInObjectSpace(normal, 0); // Copy diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx index d4116fc8bfe..7dee28db8f5 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx @@ -43,8 +43,7 @@ itkSpatialObjectToImageFilterTest(int, char *[]) ellipse->Update(); // Center the circle in the image - EllipseType::TransformType::OffsetType offset; - offset.Fill(25); + auto offset = itk::MakeFilled(25); ellipse->GetModifiableObjectToParentTransform()->SetOffset(offset); ellipse->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx index c8881e60e29..6396c76e384 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx @@ -31,17 +31,15 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) using EllipseType = itk::EllipseSpatialObject<2>; // Image Definition - auto size = ImageType::SizeType::Filled(50); - ImageType::SpacingType spacing; - spacing.Fill(1); + auto size = ImageType::SizeType::Filled(50); + auto spacing = itk::MakeFilled(1); // Circle definition auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(10); ellipse->Update(); - EllipseType::VectorType offset; - offset.Fill(25); + auto offset = itk::MakeFilled(25); ellipse->GetModifiableObjectToParentTransform()->SetOffset(offset); ellipse->Update(); @@ -182,8 +180,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) radii[2] = 0; ellipse3D->SetRadiusInObjectSpace(radii); - Ellipse3DType::VectorType offset3D; - offset3D.Fill(25); + auto offset3D = itk::MakeFilled(25); offset3D[2] = 0; // first slice ellipse3D->GetModifiableObjectToParentTransform()->SetOffset(offset3D); ellipse3D->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkSurfaceSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkSurfaceSpatialObjectTest.cxx index 24b41ed9a81..aab5416f5d3 100644 --- a/Modules/Core/SpatialObjects/test/itkSurfaceSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSurfaceSpatialObjectTest.cxx @@ -171,8 +171,7 @@ itkSurfaceSpatialObjectTest(int, char *[]) // itk::SurfaceSpatialObjectPoint - VectorType normal; - normal.Fill(276); + auto normal = itk::MakeFilled(276); pOriginal.SetNormalInObjectSpace(normal); Surface->AddPoint(pOriginal); diff --git a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx index ebf16c33b95..d2e13950b53 100644 --- a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx @@ -66,8 +66,7 @@ itkTubeSpatialObjectTest(int, char *[]) TubePointListType list; - TubeType::TransformType::OffsetType offset; - offset.Fill(10); + auto offset = itk::MakeFilled(10); tube1->GetModifiableObjectToParentTransform()->SetOffset(offset); for (unsigned int i = 0; i < 10; ++i) @@ -546,15 +545,11 @@ itkTubeSpatialObjectTest(int, char *[]) pOriginal.SetPositionInObjectSpace(42, 41, 43); // itk::TubeSpatialObjectPoint - TubePointType::VectorType tangent; - - tangent.Fill(1); + auto tangent = itk::MakeFilled(1); pOriginal.SetTangentInObjectSpace(tangent); - TubePointType::CovariantVectorType normal1; - normal1.Fill(2); + auto normal1 = itk::MakeFilled(2); pOriginal.SetNormal1InObjectSpace(normal1); - TubePointType::CovariantVectorType normal2; - normal2.Fill(3); + auto normal2 = itk::MakeFilled(3); pOriginal.SetNormal2InObjectSpace(normal2); pOriginal.SetRadiusInObjectSpace(1.0); pOriginal.SetMedialness(2.0); diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx index ed3309a58bb..d6cc86d0318 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx @@ -70,8 +70,7 @@ itkBSplineDeformableTransformTest1() std::cout << region << std::endl; using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(2.0); + auto spacing = itk::MakeFilled(2.0); /** * Instantiate a transform @@ -297,8 +296,7 @@ itkBSplineDeformableTransformTest1() */ { using VectorType = TransformType::InputVectorType; - VectorType vector; - vector.Fill(1.0); + auto vector = itk::MakeFilled(1.0); bool pass = false; try @@ -321,8 +319,7 @@ itkBSplineDeformableTransformTest1() { using VectorType = TransformType::InputCovariantVectorType; - VectorType vector; - vector.Fill(1.0); + auto vector = itk::MakeFilled(1.0); bool pass = false; try @@ -604,8 +601,7 @@ itkBSplineDeformableTransformTest3() std::cout << region << std::endl; using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(2.0); + auto spacing = itk::MakeFilled(2.0); /** * Instantiate a transform */ diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx index a3955219bb6..2cf57d4ab4d 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx @@ -62,8 +62,7 @@ itkBSplineTransformTest1() OriginType origin{}; using PhysicalDimensionsType = TransformType::PhysicalDimensionsType; - PhysicalDimensionsType dimensions; - dimensions.Fill(100); + auto dimensions = itk::MakeFilled(100); using MeshSizeType = TransformType::MeshSizeType; auto meshSize = MeshSizeType::Filled(10); @@ -319,8 +318,7 @@ itkBSplineTransformTest1() */ { using VectorType = TransformType::InputVectorType; - VectorType vector; - vector.Fill(1.0); + auto vector = itk::MakeFilled(1.0); bool pass = false; try @@ -343,8 +341,7 @@ itkBSplineTransformTest1() { using VectorType = TransformType::InputCovariantVectorType; - VectorType vector; - vector.Fill(1.0); + auto vector = itk::MakeFilled(1.0); bool pass = false; try @@ -615,8 +612,7 @@ itkBSplineTransformTest3() OriginType origin{}; using PhysicalDimensionsType = TransformType::PhysicalDimensionsType; - PhysicalDimensionsType dimensions; - dimensions.Fill(100); + auto dimensions = itk::MakeFilled(100); using MeshSizeType = TransformType::MeshSizeType; auto meshSize = MeshSizeType::Filled(10); diff --git a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx index b6f67cbd6b9..825bc589ad7 100644 --- a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx @@ -412,8 +412,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) translation[2] = 23; transform->SetTranslation(translation); - TransformType::ScaleVectorType scale; - scale.Fill(2.5); + auto scale = itk::MakeFilled(2.5); transform->SetScale(scale); TransformType::SkewVectorType skew{}; diff --git a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx index 4b6d18182da..ad2fecfa1a2 100644 --- a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx @@ -46,8 +46,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) vnlVector.fill(1.0); ITK_TRY_EXPECT_EXCEPTION(transform->TransformVector(vnlVector)); - typename TransformType::InputCovariantVectorType covVector; - covVector.Fill(1.0); + auto covVector = itk::MakeFilled(1.0); ITK_TRY_EXPECT_EXCEPTION(transform->TransformCovariantVector(covVector)); auto point = itk::MakeFilled(1.0); @@ -130,8 +129,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) { // Projecting an itk::Point - TransformType::InputPointType p; - p.Fill(10); + auto p = itk::MakeFilled(10); TransformType::InputPointType q; q = p + ioffset; TransformType::OutputPointType s; @@ -189,8 +187,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) { // Project an itk::Point - TransformType::InputPointType p; - p.Fill(10.0); + auto p = itk::MakeFilled(10.0); TransformType::InputPointType q; q = p + ioffset; TransformType::OutputPointType s; diff --git a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx index ffc154dc050..96651bdd690 100644 --- a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx @@ -484,8 +484,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) transform->SetTranslation(translation); - TransformType::ScaleVectorType scale; - scale.Fill(2.5); + auto scale = itk::MakeFilled(2.5); transform->SetScale(scale); diff --git a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx index 0a5ea887a16..4404dbc0315 100644 --- a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx @@ -490,8 +490,7 @@ itkScaleVersor3DTransformTest(int, char *[]) transform->SetTranslation(translation); - TransformType::ScaleVectorType scale; - scale.Fill(2.5); + auto scale = itk::MakeFilled(2.5); transform->SetScale(scale); diff --git a/Modules/Core/Transform/test/itkTransformTest.cxx b/Modules/Core/Transform/test/itkTransformTest.cxx index 40b5cbf796d..444015b3ffb 100644 --- a/Modules/Core/Transform/test/itkTransformTest.cxx +++ b/Modules/Core/Transform/test/itkTransformTest.cxx @@ -62,8 +62,7 @@ class TransformTestHelper : public Transform(22.0); return outPoint; } @@ -71,8 +70,7 @@ class TransformTestHelper : public Transform(12.2); return outVector; } @@ -93,8 +91,7 @@ class TransformTestHelper : public Transform(8.9); return outVector; } @@ -108,8 +105,7 @@ class TransformTestHelper : public Transform(2.1); return outTensor; } @@ -123,8 +119,7 @@ class TransformTestHelper : public Transform(10.0); return outTensor; } @@ -190,8 +185,7 @@ class TransformTester std::cout << "Testing itkTransform<" << VInputDimension << ',' << VOutputDimension << '>' << std::endl; auto transform = TransformType::New(); - InputPointType pnt; - pnt.Fill(2.9); + auto pnt = itk::MakeFilled(2.9); transform->TransformPoint(pnt); std::cout << "TransformPoint() OK" << std::endl; diff --git a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx index 41c7f4a2ef5..677c44e07b1 100644 --- a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx +++ b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx @@ -214,8 +214,7 @@ N4(int argc, char * argv[]) correcter->SetMaximumNumberOfIterations(maximumNumberOfIterations); ITK_TEST_SET_GET_VALUE(maximumNumberOfIterations, correcter->GetMaximumNumberOfIterations()); - typename CorrecterType::ArrayType numberOfFittingLevels; - numberOfFittingLevels.Fill( + auto numberOfFittingLevels = itk::MakeFilled( static_cast(numIters.size())); correcter->SetNumberOfFittingLevels(numberOfFittingLevels); ITK_TEST_SET_GET_VALUE(numberOfFittingLevels, correcter->GetNumberOfFittingLevels()); diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx index 72d32a1e77d..d21ae0c20fd 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx @@ -73,11 +73,9 @@ itkBSplineExponentialDiffeomorphicTransformTest(int, char *[]) paramsFill(outlier) = 99.0; paramsFill(outlier + 1) = 99.0; - DisplacementTransformType::ArrayType meshSizeForUpdateField; - meshSizeForUpdateField.Fill(15); + auto meshSizeForUpdateField = itk::MakeFilled(15); displacementTransform->SetMeshSizeForTheUpdateField(meshSizeForUpdateField); - DisplacementTransformType::ArrayType meshSizeForVelocityField; - meshSizeForVelocityField.Fill(30); + auto meshSizeForVelocityField = itk::MakeFilled(30); displacementTransform->SetMeshSizeForTheConstantVelocityField(meshSizeForVelocityField); displacementTransform->SetSplineOrder(3); displacementTransform->SetParameters(paramsFill); diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx index a3ad3a56426..af0b906aa34 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx @@ -43,13 +43,13 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) typename DisplacementTransformType::ArrayType::ValueType controlPointsUpdateFieldVal = 4; - typename DisplacementTransformType::ArrayType controlPointsUpdateField; - controlPointsUpdateField.Fill(controlPointsUpdateFieldVal); + auto controlPointsUpdateField = + itk::MakeFilled(controlPointsUpdateFieldVal); ITK_TEST_SET_GET_VALUE(controlPointsUpdateField, displacementTransform->GetNumberOfControlPointsForTheUpdateField()); typename DisplacementTransformType::ArrayType::ValueType controlPointsTotalFieldVal = 0; - typename DisplacementTransformType::ArrayType controlPointsTotalField; - controlPointsTotalField.Fill(controlPointsTotalFieldVal); + auto controlPointsTotalField = + itk::MakeFilled(controlPointsTotalFieldVal); ITK_TEST_SET_GET_VALUE(controlPointsTotalField, displacementTransform->GetNumberOfControlPointsForTheTotalField()); using FieldType = DisplacementTransformType::DisplacementFieldType; @@ -82,12 +82,10 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) paramsFill(outlier) = 99.0; paramsFill(outlier + 1) = 99.0; - DisplacementTransformType::ArrayType meshSizeForUpdateField; - meshSizeForUpdateField.Fill(15); + auto meshSizeForUpdateField = itk::MakeFilled(15); displacementTransform->SetMeshSizeForTheUpdateField(meshSizeForUpdateField); - DisplacementTransformType::ArrayType meshSizeForTotalField; - meshSizeForTotalField.Fill(30); + auto meshSizeForTotalField = itk::MakeFilled(30); displacementTransform->SetMeshSizeForTheTotalField(meshSizeForTotalField); typename DisplacementTransformType::SplineOrderType splineOrder = 3; diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx index e764b592a9d..63a59418393 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx @@ -82,8 +82,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) pointSet->SetPoint(2, point3); pointSet->SetPointData(2, ones_points); - BSplineFilterType::ArrayType numberOfControlPoints; - numberOfControlPoints.Fill(4); + auto numberOfControlPoints = itk::MakeFilled(4); auto bspliner = BSplineFilterType::New(); @@ -109,8 +108,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) ITK_TEST_SET_GET_VALUE(splineOrder, bspliner->GetSplineOrder()); typename BSplineFilterType::ArrayType::ValueType numberOfFittingLevelsVal = 8; - typename BSplineFilterType::ArrayType numberOfFittingLevels; - numberOfFittingLevels.Fill(numberOfFittingLevelsVal); + auto numberOfFittingLevels = itk::MakeFilled(numberOfFittingLevelsVal); bspliner->SetNumberOfFittingLevels(numberOfFittingLevelsVal); ITK_TEST_SET_GET_VALUE(numberOfFittingLevels, bspliner->GetNumberOfFittingLevels()); @@ -122,13 +120,11 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) ITK_TEST_SET_GET_BOOLEAN(bspliner, EstimateInverse, false); typename BSplineFilterType::OriginType::ValueType bSplineDomainOriginVal = 0.0; - typename BSplineFilterType::OriginType bSplineDomainOrigin; - bSplineDomainOrigin.Fill(bSplineDomainOriginVal); + auto bSplineDomainOrigin = itk::MakeFilled(bSplineDomainOriginVal); ITK_TEST_EXPECT_EQUAL(bSplineDomainOrigin, bspliner->GetBSplineDomainOrigin()); typename BSplineFilterType::SpacingType::ValueType bSplineDomainSpacingVal = 1.0; - typename BSplineFilterType::SpacingType bSplineDomainSpacing; - bSplineDomainSpacing.Fill(bSplineDomainSpacingVal); + auto bSplineDomainSpacing = itk::MakeFilled(bSplineDomainSpacingVal); ITK_TEST_EXPECT_EQUAL(bSplineDomainSpacing, bspliner->GetBSplineDomainSpacing()); typename BSplineFilterType::SizeType::value_type bSplineDomainSizeVal = 0; diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx index 282f46d9dea..9132d266a74 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx @@ -66,8 +66,7 @@ itkDisplacementFieldTransformCloneTest(int, char *[]) field->SetRegions(region); field->Allocate(); - DisplacementTransformType::OutputVectorType zeroVector; - zeroVector.Fill(1); + auto zeroVector = itk::MakeFilled(1); field->FillBuffer(zeroVector); displacementTransform->SetDisplacementField(field); diff --git a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx index 6038c9081d9..87b4e4da182 100644 --- a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx @@ -71,8 +71,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) IteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - PixelType vectorValue; - vectorValue.Fill(5.0); // FIXME: replace with something more interesting... + auto vectorValue = itk::MakeFilled(5.0); // FIXME: replace with something more interesting... it.GoToBegin(); while (!it.IsAtEnd()) diff --git a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx index 91851a685bb..28910c7a3dd 100644 --- a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx @@ -58,8 +58,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) // Creating an input displacement field auto field = DisplacementFieldType::New(); - DisplacementFieldType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); DisplacementFieldType::PointType origin{}; diff --git a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx index f6f5d6f76ee..44d951d0d3b 100644 --- a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx @@ -62,8 +62,7 @@ itkIterativeInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) // Creating an input displacement field auto field = DisplacementFieldType::New(); - DisplacementFieldType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); DisplacementFieldType::PointType origin{}; diff --git a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx index de515efd92f..4e905ab6fd3 100644 --- a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx @@ -53,8 +53,7 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter); - DisplacementFieldType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); DisplacementFieldType::PointType origin{}; diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx index eb986507359..593ae412ce1 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx @@ -29,16 +29,13 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) constexpr unsigned int splineOrder = 3; - TimeVaryingVelocityFieldControlPointLatticeType::PointType origin; - origin.Fill(-2.0); + auto origin = itk::MakeFilled(-2.0); - TimeVaryingVelocityFieldControlPointLatticeType::SpacingType spacing; - spacing.Fill(2.0); + auto spacing = itk::MakeFilled(2.0); auto size = TimeVaryingVelocityFieldControlPointLatticeType::SizeType::Filled(25); - VectorType displacement1; - displacement1.Fill(0.1); + auto displacement1 = itk::MakeFilled(0.1); TimeVaryingVelocityFieldControlPointLatticeType::Pointer timeVaryingVelocityFieldControlPointLattice = TimeVaryingVelocityFieldControlPointLatticeType::New(); @@ -144,16 +141,14 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) transform->IntegrateVelocityField(); - TransformType::InputPointType point; - point.Fill(1.3); + auto point = itk::MakeFilled(1.3); using OutputPointType = TransformType::OutputPointType; OutputPointType transformedPoint = transform->TransformPoint(point); std::cout << point << ", " << transformedPoint << transform->TransformPoint(point) << std::endl; - VectorType displacement; - displacement.Fill(0.1); + auto displacement = itk::MakeFilled(0.1); point += displacement; if (point.EuclideanDistanceTo(transformedPoint) > 0.1) diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx index 720fa4c20ba..b6eea0f055b 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx @@ -47,13 +47,11 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int argc, char * argv[]) TimeVaryingVelocityFieldType::PointType origin{}; - TimeVaryingVelocityFieldType::SpacingType spacing; - spacing.Fill(2.0); + auto spacing = itk::MakeFilled(2.0); auto size = TimeVaryingVelocityFieldType::SizeType::Filled(25); - VectorType constantVelocity; - constantVelocity.Fill(0.1); + auto constantVelocity = itk::MakeFilled(0.1); auto constantVelocityField = TimeVaryingVelocityFieldType::New(); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx index e171edd9957..71f0d65a3af 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx @@ -34,13 +34,11 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) TimeVaryingVelocityFieldType::PointType origin{}; - TimeVaryingVelocityFieldType::SpacingType spacing; - spacing.Fill(2.0); + auto spacing = itk::MakeFilled(2.0); auto size = TimeVaryingVelocityFieldType::SizeType::Filled(25); - VectorType displacement1; - displacement1.Fill(0.1); + auto displacement1 = itk::MakeFilled(0.1); auto timeVaryingVelocityField = TimeVaryingVelocityFieldType::New(); @@ -120,15 +118,13 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) // Now Clone the Transform and test transform again TransformType::Pointer clone = transform->Clone(); - TransformType::InputPointType point; - point.Fill(1.3); + auto point = itk::MakeFilled(1.3); using OutputPointType = TransformType::OutputPointType; OutputPointType transformedPoint = transform->TransformPoint(point); OutputPointType cloneTransformedPoint = clone->TransformPoint(point); - VectorType displacement; - displacement.Fill(0.1); + auto displacement = itk::MakeFilled(0.1); point += displacement; diff --git a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx index a5560851e06..764c0b7c679 100644 --- a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx @@ -71,12 +71,10 @@ itkTransformToDisplacementFieldFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; // Create output information. - auto size = SizeType::Filled(20); - IndexType index{}; - SpacingType spacing; - spacing.Fill(0.7); - OriginType origin; - origin.Fill(-10.0); + auto size = SizeType::Filled(20); + IndexType index{}; + auto spacing = itk::MakeFilled(0.7); + auto origin = itk::MakeFilled(-10.0); // Create transforms. auto affineTransform = AffineTransformType::New(); diff --git a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx index 514200f9750..c16ced70412 100644 --- a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx @@ -32,8 +32,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(32); + auto center = itk::MakeFilled(32); double radius = 16; double accum = 0.0; diff --git a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx index e26d3f51ecc..bd8a22c9b35 100644 --- a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx @@ -26,8 +26,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(16); + auto center = itk::MakeFilled(16); double radius = 10; double accum = 0.0; diff --git a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx index c2ccb272a5c..63021f841fe 100644 --- a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx @@ -47,8 +47,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(50); + auto center = itk::MakeFilled(50); double radius = 19.5; double accum = 0.0; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx index 899f44b1e8b..f42126d9564 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx @@ -51,8 +51,7 @@ FastMarchingImageFilterBaseTestFunction() fastMarchingFilter->SetOutputRegion(outputRegion); ITK_TEST_SET_GET_VALUE(outputRegion, fastMarchingFilter->GetOutputRegion()); - typename FastMarchingImageFilterType::OutputSpacingType outputSpacing; - outputSpacing.Fill(1.0); + auto outputSpacing = itk::MakeFilled(1.0); fastMarchingFilter->SetOutputSpacing(outputSpacing); ITK_TEST_SET_GET_VALUE(outputSpacing, fastMarchingFilter->GetOutputSpacing()); diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx index 5db222844a7..fc0c2f605b6 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx @@ -50,8 +50,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac image->SetRegions(ImageType::RegionType(size)); image->Allocate(); - ImageType::SpacingType spacing; - spacing.Fill(pixelSpacing); + auto spacing = itk::MakeFilled(pixelSpacing); image->SetSpacing(spacing); diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx index 423827437aa..c85d0312f66 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx @@ -96,14 +96,12 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) maxKernelWidth = std::stoi(argv[7]); } - DerivativeFilterType::ArrayType variance; - variance.Fill(sigma * sigma); + auto variance = itk::MakeFilled(sigma * sigma); derivativeFilter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, derivativeFilter->GetVariance()); - DerivativeFilterType::ArrayType maxError; - maxError.Fill(maxErrorVal); + auto maxError = itk::MakeFilled(maxErrorVal); derivativeFilter->SetMaximumError(maxErrorVal); ITK_TEST_SET_GET_VALUE(maxError, derivativeFilter->GetMaximumError()); diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx index 14e12edce9d..7010c85df23 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx @@ -47,12 +47,10 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) region.SetIndex(start); region.SetSize(size); - PointType origin; - origin.Fill(-1.25); + auto origin = itk::MakeFilled(-1.25); origin[0] = -20.0; - SpacingType spacing; - spacing.Fill(0.1); + auto spacing = itk::MakeFilled(0.1); inputImage->SetOrigin(origin); inputImage->SetSpacing(spacing); diff --git a/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx index 4578f4808ce..b4b96bb8590 100644 --- a/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx @@ -58,8 +58,7 @@ itkZeroCrossingBasedEdgeDetectionImageFilterTest(int argc, char * argv[]) } } - FilterType::ArrayType variance; - variance.Fill(varianceValue); + auto variance = itk::MakeFilled(varianceValue); filter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, filter->GetVariance()); @@ -76,8 +75,7 @@ itkZeroCrossingBasedEdgeDetectionImageFilterTest(int argc, char * argv[]) } } - FilterType::ArrayType maximumError; - maximumError.Fill(maximumErrorValue); + auto maximumError = itk::MakeFilled(maximumErrorValue); filter->SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, filter->GetMaximumError()); diff --git a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx index a69792e1499..ee2f0b6f164 100644 --- a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx +++ b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx @@ -76,14 +76,12 @@ itkVectorGradientMagnitudeImageFilterTest1(int argc, char * argv[]) ITK_TEST_SET_GET_BOOLEAN(filter, UseImageSpacing, useImageSpacing); auto derivativeWeightsValue = static_cast(std::stod(argv[4])); - FilterType::DerivativeWeightsType derivativeWeights; - derivativeWeights.Fill(derivativeWeightsValue); + auto derivativeWeights = itk::MakeFilled(derivativeWeightsValue); filter->SetDerivativeWeights(derivativeWeights); ITK_TEST_SET_GET_VALUE(derivativeWeights, filter->GetDerivativeWeights()); auto componentWeightsValue = static_cast(std::stod(argv[5])); - FilterType::ComponentWeightsType componentWeights; - componentWeights.Fill(componentWeightsValue); + auto componentWeights = itk::MakeFilled(componentWeightsValue); filter->SetComponentWeights(componentWeights); ITK_TEST_SET_GET_VALUE(componentWeights, filter->GetComponentWeights()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx index 4ede1d890ee..c07e211d444 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx @@ -47,10 +47,9 @@ BSpline(int argc, char * argv[]) // Reconstruction of the scalar field from the control points - typename ScalarFieldType::PointType origin{}; - auto size = ScalarFieldType::SizeType::Filled(100); - typename ScalarFieldType::SpacingType spacing; - spacing.Fill(1.0); + typename ScalarFieldType::PointType origin{}; + auto size = ScalarFieldType::SizeType::Filled(100); + auto spacing = itk::MakeFilled(1.0); using BSplinerType = itk::BSplineControlPointImageFilter; auto bspliner = BSplinerType::New(); @@ -58,8 +57,7 @@ BSpline(int argc, char * argv[]) bspliner->SetInput(reader->GetOutput()); typename BSplinerType::ArrayType::ValueType closeDimensionVal = 0; - typename BSplinerType::ArrayType closeDimension; - closeDimension.Fill(closeDimensionVal); + auto closeDimension = itk::MakeFilled(closeDimensionVal); bspliner->SetCloseDimension(closeDimension); ITK_TEST_SET_GET_VALUE(closeDimension, bspliner->GetCloseDimension()); @@ -102,8 +100,7 @@ BSpline(int argc, char * argv[]) // and seeing if the output is the same. In this example we double the // resolution twice as the refinement is doubled at every level. // - typename BSplinerType::ArrayType numberOfRefinementLevels; - numberOfRefinementLevels.Fill(3); + auto numberOfRefinementLevels = itk::MakeFilled(3); typename BSplinerType::ControlPointLatticeType::Pointer refinedControlPointLattice = bspliner->RefineControlPointLattice(numberOfRefinementLevels); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx index b3632be2fcb..d26094f1c84 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx @@ -92,14 +92,12 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) } } - BSplinerType::ArrayType bSplineOrder; - bSplineOrder.Fill(bSplineOrderValue); + auto bSplineOrder = itk::MakeFilled(bSplineOrderValue); bspliner->SetSplineOrder(bSplineOrder); ITK_TEST_SET_GET_VALUE(bSplineOrder, bspliner->GetSplineOrder()); BSplinerType::ArrayType::ValueType closeDimensionValue = 0; - BSplinerType::ArrayType closeDimension; - closeDimension.Fill(closeDimensionValue); + auto closeDimension = itk::MakeFilled(closeDimensionValue); bspliner->SetCloseDimension(closeDimension); ITK_TEST_SET_GET_VALUE(closeDimension, bspliner->GetCloseDimension()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx index a37821f6cb8..58ac224fa7a 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx @@ -92,8 +92,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) unsigned int splineOrder = 0u; ITK_TRY_EXPECT_EXCEPTION(filter->SetSplineOrder(splineOrder)); - FilterType::ArrayType splineOrderArray; - splineOrderArray.Fill(4u); + auto splineOrderArray = itk::MakeFilled(4u); filter->SetSplineOrder(splineOrderArray); ITK_TEST_SET_GET_VALUE(splineOrderArray, filter->GetSplineOrder()); @@ -106,8 +105,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) unsigned int numberOfLevels = 0u; ITK_TRY_EXPECT_EXCEPTION(filter->SetNumberOfLevels(numberOfLevels)); - FilterType::ArrayType numberOfLevelsArray; - numberOfLevelsArray.Fill(4u); + auto numberOfLevelsArray = itk::MakeFilled(4u); filter->SetNumberOfLevels(numberOfLevelsArray); ITK_TEST_SET_GET_VALUE(numberOfLevelsArray, filter->GetNumberOfLevels()); @@ -117,8 +115,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(numberOfLevelsArray, filter->GetNumberOfLevels()); - FilterType::ArrayType ncps; - ncps.Fill(4u); + auto ncps = itk::MakeFilled(4u); filter->SetNumberOfControlPoints(ncps); ITK_TEST_SET_GET_VALUE(ncps, filter->GetNumberOfControlPoints()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx index e50b46d882e..36a5645ca19 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx @@ -77,8 +77,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); // Define the parametric domain - ImageType::SpacingType spacing; - spacing.Fill(0.01); + auto spacing = itk::MakeFilled(0.01); auto size = ImageType::SizeType::Filled(101); ImageType::PointType origin{}; @@ -92,8 +91,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(bSplineEpsilon, filter->GetBSplineEpsilon()); filter->SetSplineOrder(3); - FilterType::ArrayType ncps; - ncps.Fill(4); + auto ncps = itk::MakeFilled(4); filter->SetNumberOfControlPoints(ncps); filter->SetNumberOfLevels(5); filter->SetGenerateOutputImage(false); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx index 1863162ff03..9ab0504c88d 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx @@ -94,8 +94,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); // Define the parametric domain - ImageType::SpacingType spacing; - spacing.Fill(0.001); + auto spacing = itk::MakeFilled(0.001); ImageType::SizeType size; // Adding 0.5 to avoid rounding errors size.Fill(static_cast(1.0 / spacing[0] + .5) + 1); @@ -107,8 +106,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) filter->SetInput(pointSet); filter->SetSplineOrder(3); - FilterType::ArrayType ncps; - ncps.Fill(4); + auto ncps = itk::MakeFilled(4); filter->SetNumberOfControlPoints(ncps); // We set an extreme number of levels to show how this diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx index 7525f2565de..ebc7b84e8c3 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx @@ -47,10 +47,9 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) using FilterType = itk::BSplineScatteredDataPointSetToImageFilter; - auto size = VectorImageType::SizeType::Filled(100); - VectorImageType::PointType origin{}; - VectorImageType::SpacingType spacing; - spacing.Fill(1); + auto size = VectorImageType::SizeType::Filled(100); + VectorImageType::PointType origin{}; + auto spacing = itk::MakeFilled(1); VectorImageType::DirectionType direction; direction.SetIdentity(); @@ -158,8 +157,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) // transform. Specifically, this includes the final // number of control points and the spline order. filter->SetSplineOrder(SplineOrder); - FilterType::ArrayType ncps; - ncps.Fill(4); + auto ncps = itk::MakeFilled(4); filter->SetNumberOfControlPoints(ncps); filter->SetNumberOfLevels(3); FilterType::ArrayType close{}; @@ -194,8 +192,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) using InputPointType = TransformType::InputPointType; using OutputPointType = TransformType::OutputPointType; - InputPointType inputPoint; - inputPoint.Fill(50.0); + auto inputPoint = itk::MakeFilled(50.0); OutputPointType outputPoint = transform->TransformPoint(inputPoint); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx index ba96c29d821..027bbe36646 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx @@ -160,8 +160,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) filter->SetNumberOfLevels(4); filter->SetGenerateOutputImage(false); - FilterType::ArrayType close; - close.Fill(1); + auto close = itk::MakeFilled(1); filter->SetCloseDimension(close); ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx index 0d84d16f43b..25c9c561c2b 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx @@ -95,8 +95,7 @@ itkResampleImageTest(int, char *[]) resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); resample->SetOutputSpacing(spacing); ITK_TEST_SET_GET_VALUE(spacing, resample->GetOutputSpacing()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx index 67393dd69ce..e28d9121bd1 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx @@ -100,8 +100,7 @@ itkResampleImageTest7(int, char *[]) resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); resample->SetOutputSpacing(spacing); ITK_TEST_SET_GET_VALUE(spacing, resample->GetOutputSpacing()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx index 16015656f6b..fd8f15c1092 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx @@ -98,8 +98,8 @@ class ProjectTransform : public itk::Transform OutputPointType TransformPoint(const InputPointType & inputPoint) const override { - OutputPointType outputPoint; - outputPoint.Fill(std::numeric_limits::max()); + auto outputPoint = + itk::MakeFilled(std::numeric_limits::max()); for (unsigned int d = 0; d < 2; ++d) { outputPoint[d] = inputPoint[d] * 0.5; @@ -197,8 +197,7 @@ itkResampleImageTest8(int, char *[]) resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); - OutputImageType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); resample->SetOutputSpacing(spacing); ITK_TEST_SET_GET_VALUE(spacing, resample->GetOutputSpacing()); diff --git a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx index 8d2a0fdb97a..06d1b9bcc83 100644 --- a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx @@ -270,8 +270,7 @@ TEST(SliceImageFilterTests, Coverage) filter->SetStop(13); EXPECT_EQ(idx, filter->GetStop()); - FilterType::ArrayType a; - a.Fill(14); + auto a = itk::MakeFilled(14); filter->SetStep(a); EXPECT_EQ(a, filter->GetStep()); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx index fa839f34ec9..4e2f0c2ac03 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx @@ -183,8 +183,7 @@ itkWarpImageFilterTest(int, char *[]) warper->SetEdgePaddingValue(padValue); ITK_TEST_SET_GET_VALUE(padValue, warper->GetEdgePaddingValue()); - itk::FixedArray array; - array.Fill(2.0); + auto array = itk::MakeFilled>(2.0); warper->SetOutputSpacing(array.GetDataPointer()); ITK_TEST_SET_GET_VALUE(array, warper->GetOutputSpacing()); @@ -192,8 +191,7 @@ itkWarpImageFilterTest(int, char *[]) warper->SetOutputSpacing(array.GetDataPointer()); ITK_TEST_SET_GET_VALUE(array, warper->GetOutputSpacing()); - WarperType::PointType ptarray; - ptarray.Fill(-10.0); + auto ptarray = itk::MakeFilled(-10.0); warper->SetOutputOrigin(ptarray.GetDataPointer()); ITK_TEST_SET_GET_VALUE(ptarray, warper->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx index d05419422f3..aaa1ba2d4c9 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx @@ -180,8 +180,7 @@ itkWarpVectorImageFilterTest(int, char *[]) command->SetCallbackFunction(&progressWatch, &ShowProgressObject::ShowProgress); warper->AddObserver(itk::ProgressEvent(), command); - itk::FixedArray array; - array.Fill(2.0); + auto array = itk::MakeFilled>(2.0); warper->SetOutputSpacing(array.GetDataPointer()); ITK_TEST_SET_GET_VALUE(array, warper->GetOutputSpacing()); @@ -189,8 +188,7 @@ itkWarpVectorImageFilterTest(int, char *[]) warper->SetOutputSpacing(array.GetDataPointer()); ITK_TEST_SET_GET_VALUE(array, warper->GetOutputSpacing()); - WarperType::PointType ptarray; - ptarray.Fill(-10.0); + auto ptarray = itk::MakeFilled(-10.0); warper->SetOutputOrigin(ptarray.GetDataPointer()); ITK_TEST_SET_GET_VALUE(ptarray, warper->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx index 796b861ac52..77d9012f7d6 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx @@ -117,8 +117,7 @@ itkAddImageFilterFrameTest(int, char *[]) myImageType3Pointer outputImage = filter->GetOutput(); // Make Image B have a different origin - myImageType2::PointType borigin; - borigin.Fill(0.01); + auto borigin = itk::MakeFilled(0.01); inputImageB->SetOrigin(borigin); @@ -138,8 +137,7 @@ itkAddImageFilterFrameTest(int, char *[]) // Make Image B have a different spacing inputImageB->CopyInformation(inputImageA); - myImageType2::SpacingType bspacing; - bspacing.Fill(1.001); + auto bspacing = itk::MakeFilled(1.001); inputImageB->SetSpacing(bspacing); // Execute the filter diff --git a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx index a5f55e40108..8bf6779ff82 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx @@ -58,9 +58,8 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) // Generate a synthetic ellipse image using EllipseType = itk::EllipseSpatialObject<2>; - auto ellipse = EllipseType::New(); - EllipseType::PointType center; - center.Fill(20); + auto ellipse = EllipseType::New(); + auto center = itk::MakeFilled(20); ellipse->SetCenterInObjectSpace(center); ellipse->SetRadiusInObjectSpace(10); ellipse->Update(); diff --git a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx index 4d8fecdb95a..c4a91831068 100644 --- a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx @@ -60,8 +60,7 @@ itkGridImageSourceTest(int argc, char * argv[]) ImageType::PointType origin{}; - ImageType::SpacingType imageSpacing; - imageSpacing.Fill(1.0); + auto imageSpacing = itk::MakeFilled(1.0); ImageType::DirectionType direction; direction.SetIdentity(); @@ -78,9 +77,8 @@ itkGridImageSourceTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(scale, gridImage->GetScale()); - auto sigmaValue = static_cast(std::stod(argv[3])); - GridSourceType::ArrayType sigma; - sigma.Fill(sigmaValue); + auto sigmaValue = static_cast(std::stod(argv[3])); + auto sigma = itk::MakeFilled(sigmaValue); auto variableSigma = static_cast(std::stoi(argv[4])); if (variableSigma) @@ -95,9 +93,8 @@ itkGridImageSourceTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(sigma, gridImage->GetSigma()); - auto spacing = static_cast(std::stod(argv[5])); - GridSourceType::ArrayType gridSpacing; - gridSpacing.Fill(spacing); + auto spacing = static_cast(std::stod(argv[5])); + auto gridSpacing = itk::MakeFilled(spacing); auto variableGridSpacing = static_cast(std::stoi(argv[6])); @@ -112,16 +109,14 @@ itkGridImageSourceTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(gridSpacing, gridImage->GetGridSpacing()); - auto offset = static_cast(std::stod(argv[7])); - GridSourceType::ArrayType gridOffset; - gridOffset.Fill(offset); + auto offset = static_cast(std::stod(argv[7])); + auto gridOffset = itk::MakeFilled(offset); gridImage->SetGridOffset(gridOffset); ITK_TEST_SET_GET_VALUE(gridOffset, gridImage->GetGridOffset()); - auto gridAllDimensions = static_cast(std::stoi(argv[8])); - GridSourceType::BoolArrayType whichDimension; - whichDimension.Fill(gridAllDimensions); + auto gridAllDimensions = static_cast(std::stoi(argv[8])); + auto whichDimension = itk::MakeFilled(gridAllDimensions); bool toggleLastGridDimension = std::stod(argv[9]); if (toggleLastGridDimension) diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx index 5d0a660fd1e..9690347f309 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx @@ -105,8 +105,7 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) labelMapConverter->SetBackgroundValue(PixelType{}); using StructuringElementType = itk::FlatStructuringElement; - StructuringElementType::RadiusType radius; - radius.Fill(radiusValue); + auto radius = itk::MakeFilled(radiusValue); StructuringElementType structuringElement = StructuringElementType::Box(radius); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx index db6e360a082..c191fb66f4d 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx @@ -32,8 +32,7 @@ itkFlatStructuringElementTest(int, char *[]) bool radiusIsParametric = true; using SE2Type = itk::FlatStructuringElement<2>; - SE2Type::RadiusType r2; - r2.Fill(scalarRadius); + auto r2 = itk::MakeFilled(scalarRadius); SE2Type::Self result2{}; result2.RadiusIsParametricOn(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx index 381fd159d5f..4a5793b77a5 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx @@ -85,8 +85,7 @@ itkFlatStructuringElementTest3(int argc, char * argv[]) { using SE2Type = itk::FlatStructuringElement<2>; - SE2Type::RadiusType r2; - r2.Fill(radius); + auto r2 = itk::MakeFilled(radius); SE2Type P = SE2Type::Polygon(r2, lines); SEToFile(P, outputImage); } @@ -94,8 +93,7 @@ itkFlatStructuringElementTest3(int argc, char * argv[]) { using SE3Type = itk::FlatStructuringElement<3>; - SE3Type::RadiusType r3; - r3.Fill(radius); + auto r3 = itk::MakeFilled(radius); SE3Type P = SE3Type::Polygon(r3, lines); SEToFile(P, outputImage); } diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx index 41c6765280e..9bd0c5378c7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx @@ -64,8 +64,7 @@ itkGrayscaleDilateImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx index fa352dae3df..0cd157c1c3a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx @@ -64,8 +64,7 @@ itkGrayscaleErodeImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx index b0736a838af..71205e459ff 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx @@ -57,8 +57,7 @@ itkGrayscaleMorphologicalClosingImageFilterTest2(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // Test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); ITK_TEST_SET_GET_VALUE(r1, filter->GetRadius()); ITK_TEST_SET_GET_VALUE(FilterType::AlgorithmEnum::HISTO, filter->GetAlgorithm()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx index e559f7623d2..dbc69050554 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx @@ -57,8 +57,7 @@ itkGrayscaleMorphologicalOpeningImageFilterTest2(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // Test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); ITK_TEST_SET_GET_VALUE(r1, filter->GetRadius()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx index 2aa4781bd52..280b212cbd7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx @@ -55,8 +55,7 @@ itkMapGrayscaleDilateImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx index fffa38a5fdf..9b4cd7d2325 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx @@ -55,8 +55,7 @@ itkMapGrayscaleErodeImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx index 2cf9a90940a..1a390bf7007 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx @@ -56,8 +56,7 @@ itkMapGrayscaleMorphologicalClosingImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx index 835cb278834..9e0003d4af7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx @@ -56,8 +56,7 @@ itkMapGrayscaleMorphologicalOpeningImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius: " << filter->GetRadius() << std::endl; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx index c17f09d3a3c..858671c1676 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx @@ -55,8 +55,7 @@ itkMapMaskedRankImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -84,8 +83,7 @@ itkMapMaskedRankImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx index a42f1d7b1bf..852b50d9223 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx @@ -52,8 +52,7 @@ itkMapRankImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -66,8 +65,7 @@ itkMapRankImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx index e146014b804..db7994afdae 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx @@ -54,8 +54,7 @@ itkMaskedRankImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -83,8 +82,7 @@ itkMaskedRankImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx index bd68bd498e6..6262f0055bc 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx @@ -76,8 +76,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) using SRType = itk::FlatStructuringElement; - SRType::RadiusType elementRadius; - elementRadius.Fill(4); + auto elementRadius = itk::MakeFilled(4); SRType structuringElement2 = SRType::Box(elementRadius); using Gradient1Type = itk::MorphologicalGradientImageFilter; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx index 73996bbdb3f..575f41cbcd7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx @@ -50,8 +50,7 @@ itkRankImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -64,8 +63,7 @@ itkRankImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx index bc21ad0eb5a..c4bba3bada8 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx @@ -42,8 +42,7 @@ itkShapedIteratorFromStructuringElementTest(int, char *[]) CreateImagex(image); using StructuringElementType = itk::BinaryBallStructuringElement; - StructuringElementType::RadiusType elementRadius; - elementRadius.Fill(2); + auto elementRadius = itk::MakeFilled(2); StructuringElementType structuringElement; structuringElement.SetRadius(elementRadius); diff --git a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx index cb7667f7569..e951abf2854 100644 --- a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx @@ -91,9 +91,8 @@ itkExtractOrthogonalSwath2DImageFilterTest(int argc, char * argv[]) // Set up the path std::cout << "Making a square Path with v0 at (24,24) -> (24,104) -> (104,104) -> (104,24)" << std::endl; - auto inputPath = PolyLineParametricPathType::New(); - VertexType v; - v.Fill(24); + auto inputPath = PolyLineParametricPathType::New(); + auto v = itk::MakeFilled(24); inputPath->AddVertex(v); v[0] = 24; v[1] = 104; diff --git a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx index 5964fd40de0..b62d508505b 100644 --- a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx @@ -73,8 +73,7 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) std::cout << "Making a square Path with v0 at (24,24) -> (24,104) -> (104,104) -> (104,24)" << std::endl; auto inputPath = PolyLineParametricPathType::New(); - VertexType v; - v.Fill(24); + auto v = itk::MakeFilled(24); inputPath->AddVertex(v); v[0] = 24; v[1] = 104; diff --git a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx index 118a480361a..dbc8d9e14ed 100644 --- a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx @@ -40,8 +40,7 @@ itkPathToImageFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(path, PolyLineParametricPath, ParametricPath); std::cout << "Making a square Path with v0 at (30,30) and v2 at (33,33)" << std::endl; - VertexType v; - v.Fill(30); + auto v = itk::MakeFilled(30); path->AddVertex(v); v[0] = 33; v[1] = 30; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx index e624224a4ca..8e19eef4983 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx @@ -43,8 +43,7 @@ itkRegularSphereQuadEdgeMeshSourceTest(int argc, char * argv[]) PointType center{}; - VectorType scale; - scale.Fill(1.0); + auto scale = itk::MakeFilled(1.0); mySphereMeshSource->SetCenter(center); mySphereMeshSource->SetResolution(1); diff --git a/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx index d81dbec999b..f623e456ed4 100644 --- a/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx @@ -50,8 +50,7 @@ itkBoxMeanImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -59,8 +58,7 @@ itkBoxMeanImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx index fcc9a953028..966a54f6fa3 100644 --- a/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx @@ -50,8 +50,7 @@ itkBoxSigmaImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); if (filter->GetRadius() != r1) { std::cerr << "Wrong default Radius." << std::endl; @@ -59,8 +58,7 @@ itkBoxSigmaImageFilterTest(int argc, char * argv[]) } // set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); if (filter->GetRadius() != r5) { diff --git a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx index 061f1d19bba..e47ea4393ba 100644 --- a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx @@ -64,8 +64,7 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) // Set the value of the standard deviation of the Gaussian used for smoothing FilterType::SigmaArrayType::ValueType sigmaValue = 1.0; - FilterType::SigmaArrayType sigma; - sigma.Fill(sigmaValue); + auto sigma = itk::MakeFilled(sigmaValue); filter->SetSigma(sigmaValue); ITK_TEST_SET_GET_VALUE(sigmaValue, filter->GetSigma()); @@ -86,14 +85,12 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) // Set other filter properties FilterType::ArrayType::ValueType varianceValue = 1.0; - FilterType::ArrayType variance; - variance.Fill(varianceValue); + auto variance = itk::MakeFilled(varianceValue); filter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, filter->GetVariance()); FilterType::ArrayType::ValueType maximumErrorValue = 0.01; - FilterType::ArrayType maximumError; - maximumError.Fill(maximumErrorValue); + auto maximumError = itk::MakeFilled(maximumErrorValue); filter->SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, filter->GetMaximumError()); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx index d91d7822a19..87512aeeb5d 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx @@ -50,8 +50,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac image->SetRegions(ImageType::RegionType(size)); image->Allocate(); - ImageType::SpacingType spacing; - spacing.Fill(pixelSpacing); + auto spacing = itk::MakeFilled(pixelSpacing); image->SetSpacing(spacing); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx index c8c4a70e3a3..4269f10eeef 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx @@ -140,8 +140,7 @@ itkSmoothingRecursiveGaussianImageFilterTest(int argc, char * argv[]) // Set the value of the standard deviation of the Gaussian used for smoothing SmoothingRecursiveGaussianImageFilterType::SigmaArrayType::ValueType sigmaValue = std::stod(argv[4]); - SmoothingRecursiveGaussianImageFilterType::SigmaArrayType sigma; - sigma.Fill(sigmaValue); + auto sigma = itk::MakeFilled(sigmaValue); filter->SetSigma(sigmaValue); ITK_TEST_SET_GET_VALUE(sigmaValue, filter->GetSigma()); diff --git a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx index c8445ef47ad..1f32fba8d1d 100644 --- a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx +++ b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx @@ -46,8 +46,7 @@ itkMeshFileWriteReadTensorTest(int argc, char * argv[]) // Test the 2D case std::cout << "Testing VTKPolyDataMeshIO for a mesh with 2D tensor pixels..." << std::endl; - Mesh2dType::PointType point2d; - point2d.Fill(1); + auto point2d = itk::MakeFilled(1); Mesh2dType::PixelType pixel2d{}; @@ -87,8 +86,7 @@ itkMeshFileWriteReadTensorTest(int argc, char * argv[]) // Test the 3D case std::cout << "Testing VTKPolyDataMeshIO for a mesh with 3D tensor pixels..." << std::endl; - Mesh3dType::PointType point3d; - point3d.Fill(1); + auto point3d = itk::MakeFilled(1); Mesh3dType::PixelType pixel3d{}; diff --git a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx index baa49658b8a..97cf8377f5a 100644 --- a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx +++ b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx @@ -55,16 +55,14 @@ ReadWriteTest(const std::string fileName, const bool isRealDisplacementField, co typename FieldType::RegionType region{ start, size }; knownField->SetRegions(region); - typename FieldType::SpacingType spacing; - spacing.Fill(requiredSpacing); + auto spacing = itk::MakeFilled(requiredSpacing); knownField->SetSpacing(spacing); - typename FieldType::PointType origin; - origin.Fill(requiredOrigin); + auto origin = itk::MakeFilled(requiredOrigin); knownField->SetOrigin(origin); knownField->Allocate(); - typename DisplacementTransformType::OutputVectorType zeroVector; - zeroVector.Fill(aNumberThatCanNotBeRepresentedInFloatingPoint); + auto zeroVector = itk::MakeFilled( + aNumberThatCanNotBeRepresentedInFloatingPoint); knownField->FillBuffer(zeroVector); displacementTransform->SetDisplacementField(knownField); diff --git a/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx index ce2237c8749..7101a2b02ed 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx @@ -88,8 +88,7 @@ itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) auto sigmaVal = static_cast(sigma * sigma); - typename GaussianDerivativeImageFunctionType::VarianceArrayType variance; - variance.Fill(sigmaVal); + auto variance = itk::MakeFilled(sigmaVal); function->SetVariance(sigmaVal); ITK_TEST_SET_GET_VALUE(variance, function->GetVariance()); diff --git a/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx index d3884ca0cd9..5e47a0aa72d 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx @@ -78,9 +78,9 @@ itkDiscreteGradientMagnitudeGaussianImageFunctionTestND(int argc, char * argv[]) useImageSpacing = static_cast(std::stoi(argv[7])); } - double varianceValue = sigma * sigma; - typename DiscreteGradientMagnitudeGaussianFunctionType::VarianceArrayType varianceArray; - varianceArray.Fill(varianceValue); + double varianceValue = sigma * sigma; + auto varianceArray = + itk::MakeFilled(varianceValue); function->SetVariance(varianceArray); ITK_TEST_SET_GET_VALUE(varianceArray, function->GetVariance()); diff --git a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx index 261da131db4..a844ea02738 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx @@ -66,9 +66,8 @@ itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) maxKernelWidth = std::stoi(argv[5]); } - double varianceValue = sigma * sigma; - typename HessianGaussianImageFunctionType::VarianceArrayType varianceArray; - varianceArray.Fill(varianceValue); + double varianceValue = sigma * sigma; + auto varianceArray = itk::MakeFilled(varianceValue); function->SetVariance(varianceArray); ITK_TEST_SET_GET_VALUE(varianceArray, function->GetVariance()); diff --git a/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx index 1cb3ea927f1..6a273e716a2 100644 --- a/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx @@ -55,16 +55,14 @@ itkFastApproximateRankImageFilterTest(int argc, char * argv[]) using RadiusType = FilterType::RadiusType; // Test default values - RadiusType r1; - r1.Fill(1); + auto r1 = itk::MakeFilled(1); ITK_TEST_SET_GET_VALUE(r1, filter->GetRadius()); auto rank = 0.5; ITK_TEST_SET_GET_VALUE(rank, filter->GetRank()); // Set radius with a radius type - RadiusType r5; - r5.Fill(5); + auto r5 = itk::MakeFilled(5); filter->SetRadius(r5); ITK_TEST_SET_GET_VALUE(r5, filter->GetRadius()); diff --git a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx index 7d66c1f89a5..d7ecd11d4f7 100644 --- a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx @@ -83,8 +83,7 @@ itkGridForwardWarpImageFilterTest(int argc, char * argv[]) DeformationIteratorType it(inputDisplacementField, inputDisplacementField->GetBufferedRegion()); // Initialize the content of the input image - DeformationPixelType vectorValue; - vectorValue.Fill(5.0); // FIXME: replace with something more interesting... + auto vectorValue = itk::MakeFilled(5.0); // FIXME: replace with something more interesting... it.GoToBegin(); while (!it.IsAtEnd()) diff --git a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx index 8291da2284e..1bb07fe5677 100644 --- a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx @@ -285,8 +285,7 @@ itkImageFunctionTest(int, char *[]) } /* IsInsideBuffer with Point type */ - PointType point; - point.Fill(1); + auto point = itk::MakeFilled(1); if (!function->IsInsideBuffer(point)) { std::cout << "Error with IsInsideBuffer 1P." << std::endl; diff --git a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx index 7d12bc45cc2..3cb4a68a4b5 100644 --- a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx @@ -50,9 +50,7 @@ class Helper itk::SimpleFilterWatcher watcher(fractalFilter, "FractalDimensionFilter"); - typename FractalFilterType::RadiusType radius; - - radius.Fill(5); + auto radius = itk::MakeFilled(5); fractalFilter->SetNeighborhoodRadius(radius); ITK_TEST_SET_GET_VALUE(radius, fractalFilter->GetNeighborhoodRadius()); diff --git a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx index ed5d05096fb..807ab74a326 100644 --- a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx @@ -75,8 +75,7 @@ itkWarpHarmonicEnergyCalculatorTest(int argc, char * argv[]) inputDisplacementField->Allocate(); // Initialize the content of the input image - DeformationPixelType vectorValue; - vectorValue.Fill(5.0); // FIXME: replace with something more interesting... + auto vectorValue = itk::MakeFilled(5.0); // FIXME: replace with something more interesting... inputDisplacementField->FillBuffer(vectorValue); // Declare the type for the itk::WarpHarmonicEnergyCalculator @@ -92,8 +91,7 @@ itkWarpHarmonicEnergyCalculatorTest(int argc, char * argv[]) auto useImageSpacing = static_cast(std::stoi(argv[1])); ITK_TEST_SET_GET_BOOLEAN(calculator, UseImageSpacing, useImageSpacing); - CalculatorType::WeightsType derivativeWeights; - derivativeWeights.Fill(std::stod(argv[2])); + auto derivativeWeights = itk::MakeFilled(std::stod(argv[2])); calculator->SetDerivativeWeights(derivativeWeights); ITK_TEST_SET_GET_VALUE(derivativeWeights, calculator->GetDerivativeWeights()); diff --git a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx index b8d245bb5bb..ccb590e35da 100644 --- a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx @@ -73,8 +73,7 @@ itkWarpJacobianDeterminantFilterTest(int, char *[]) DeformationIteratorType it(inputDisplacementField, inputDisplacementField->GetBufferedRegion()); // Initialize the content of Image A - DeformationPixelType vectorValue; - vectorValue.Fill(5.0); // FIXME: replace with something more interesting... + auto vectorValue = itk::MakeFilled(5.0); // FIXME: replace with something more interesting... it.GoToBegin(); while (!it.IsAtEnd()) diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index 90a0f1effb1..60167347931 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -95,8 +95,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(32); + auto center = itk::MakeFilled(32); double radius = 19.5; double accum = 0.0; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx index 238d1bed43e..e46fc891096 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx @@ -100,9 +100,8 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) upperRightPoint[1] = virtualDomainSize[1]; // Make a simple point set - PointType testPoint; - PointType::VectorType offset; - offset.Fill(0.1); + PointType testPoint; + auto offset = itk::MakeFilled(0.1); testPoint[0] = 0.0; testPoint[1] = 0.0; fixedPoints->SetPoint(0, testPoint); diff --git a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx index cf4bb44fb3e..1a9d0918328 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx @@ -40,9 +40,8 @@ itkHistogramToTextureFeaturesFilterNaNTest(int, char *[]) // Generate co-occurence matrix using MatrixGeneratorType = itk::Statistics::ScalarImageToCooccurrenceMatrixFilter; - auto generator = MatrixGeneratorType::New(); - MatrixGeneratorType::OffsetType offset; - offset.Fill(1); + auto generator = MatrixGeneratorType::New(); + auto offset = itk::MakeFilled(1); generator->SetOffset(offset); generator->SetInput(image); generator->Update(); diff --git a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx index 8296159a4b3..8288d07330c 100644 --- a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx @@ -49,8 +49,7 @@ itkVectorContainerToListSampleAdaptorTest(int, char *[]) container->Reserve(containerSize); for (unsigned int i = 0; i < container->Size(); ++i) { - VectorType vector; - vector.Fill(std::pow(i, 2)); + auto vector = itk::MakeFilled(std::pow(i, 2)); container->InsertElement(i, vector); } diff --git a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index 8ff2698a2b4..053ca094da6 100644 --- a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -30,15 +30,13 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) * Define the transformation domain */ using PointType = TransformType::PointType; - PointType origin; - origin.Fill(-5.0); + auto origin = itk::MakeFilled(-5.0); using SizeType = TransformType::SizeType; auto size = SizeType::Filled(65); using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(1.2); + auto spacing = itk::MakeFilled(1.2); using DirectionType = TransformType::DirectionType; DirectionType direction; @@ -56,8 +54,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) displacementField->FillBuffer(zeroVector); - TransformType::OutputVectorType nonzeroVector; - nonzeroVector.Fill(10.3); + auto nonzeroVector = itk::MakeFilled(10.3); auto index = DisplacementFieldType::IndexType::Filled(40); displacementField->SetPixel(index, nonzeroVector); @@ -71,8 +68,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) transform->SetConstantVelocityField(displacementField); transform->IntegrateVelocityField(); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); SpacingType spacingBefore = transform->GetConstantVelocityField()->GetSpacing(); @@ -86,8 +82,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) std::cout << "Instantiate adaptor." << std::endl; - SpacingType requiredSpacing; - requiredSpacing.Fill(0.6); + auto requiredSpacing = itk::MakeFilled(0.6); SizeType requiredSize; for (unsigned int d = 0; d < SpaceDimension; ++d) { diff --git a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index db6c71edec5..00a19e765ba 100644 --- a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -31,15 +31,13 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, * Define the transformation domain */ using PointType = TransformType::PointType; - PointType origin; - origin.Fill(-5.0); + auto origin = itk::MakeFilled(-5.0); using SizeType = TransformType::SizeType; auto size = SizeType::Filled(65); using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(1.2); + auto spacing = itk::MakeFilled(1.2); using DirectionType = TransformType::DirectionType; DirectionType direction; @@ -57,8 +55,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, displacementField->FillBuffer(zeroVector); - TransformType::OutputVectorType nonzeroVector; - nonzeroVector.Fill(10.3); + auto nonzeroVector = itk::MakeFilled(10.3); auto index = DisplacementFieldType::IndexType::Filled(40); displacementField->SetPixel(index, nonzeroVector); @@ -71,8 +68,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); SpacingType spacingBefore = transform->GetDisplacementField()->GetSpacing(); @@ -86,8 +82,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, std::cout << "Instantiate adaptor." << std::endl; - SpacingType requiredSpacing; - requiredSpacing.Fill(0.6); + auto requiredSpacing = itk::MakeFilled(0.6); SizeType requiredSize; for (unsigned int d = 0; d < SpaceDimension; ++d) { diff --git a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx index 7bde65c525a..be295903971 100644 --- a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx @@ -32,12 +32,10 @@ itkBSplineTransformParametersAdaptorTest(int, char *[]) */ using OriginType = TransformType::OriginType; - OriginType origin; - origin.Fill(5.0); + auto origin = itk::MakeFilled(5.0); using PhysicalDimensionsType = TransformType::PhysicalDimensionsType; - PhysicalDimensionsType dimensions; - dimensions.Fill(100); + auto dimensions = itk::MakeFilled(100); using MeshSizeType = TransformType::MeshSizeType; auto meshSize = MeshSizeType::Filled(10); @@ -72,8 +70,7 @@ itkBSplineTransformParametersAdaptorTest(int, char *[]) auto index = CoefficientImageType::IndexType::Filled(5); transform->GetCoefficientImages()[0]->SetPixel(index, 5.0); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); diff --git a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx index ff4bf7efa82..7461cac8f4d 100644 --- a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx @@ -57,11 +57,9 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) // Parameters used for FS and BM using RadiusType = InputImageType::SizeType; - RadiusType blockRadius; - blockRadius.Fill(2); + auto blockRadius = itk::MakeFilled(2); - RadiusType searchRadius; - searchRadius.Fill(7); + auto searchRadius = itk::MakeFilled(7); using ReaderType = itk::ImageFileReader; diff --git a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx index bf65542e18c..e99daac52bf 100644 --- a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx @@ -30,15 +30,13 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) * Define the transformation domain */ using PointType = TransformType::PointType; - PointType origin; - origin.Fill(-5.0); + auto origin = itk::MakeFilled(-5.0); using SizeType = TransformType::SizeType; auto size = SizeType::Filled(65); using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(1.2); + auto spacing = itk::MakeFilled(1.2); using DirectionType = TransformType::DirectionType; DirectionType direction; @@ -55,8 +53,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) TransformType::OutputVectorType zeroVector{}; displacementField->FillBuffer(zeroVector); - TransformType::OutputVectorType nonzeroVector; - nonzeroVector.Fill(10.3); + auto nonzeroVector = itk::MakeFilled(10.3); auto index = DisplacementFieldType::IndexType::Filled(40); displacementField->SetPixel(index, nonzeroVector); @@ -69,8 +66,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); SpacingType spacingBefore = transform->GetDisplacementField()->GetSpacing(); @@ -84,8 +80,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) std::cout << "Instantiate adaptor." << std::endl; - SpacingType requiredSpacing; - requiredSpacing.Fill(0.6); + auto requiredSpacing = itk::MakeFilled(0.6); SizeType requiredSize; for (unsigned int d = 0; d < SpaceDimension; ++d) { diff --git a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index e9b131c2dba..3ce61794ada 100644 --- a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -31,15 +31,13 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) * Define the transformation domain */ using PointType = TransformType::PointType; - PointType origin; - origin.Fill(-5.0); + auto origin = itk::MakeFilled(-5.0); using SizeType = TransformType::SizeType; auto size = SizeType::Filled(65); using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(1.2); + auto spacing = itk::MakeFilled(1.2); using DirectionType = TransformType::DirectionType; DirectionType direction; @@ -57,8 +55,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) displacementField->FillBuffer(zeroVector); - TransformType::OutputVectorType nonzeroVector; - nonzeroVector.Fill(10.3); + auto nonzeroVector = itk::MakeFilled(10.3); auto index = DisplacementFieldType::IndexType::Filled(40); displacementField->SetPixel(index, nonzeroVector); @@ -72,8 +69,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) transform->SetConstantVelocityField(displacementField); transform->IntegrateVelocityField(); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); SpacingType spacingBefore = transform->GetConstantVelocityField()->GetSpacing(); @@ -87,8 +83,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) std::cout << "Instantiate adaptor." << std::endl; - SpacingType requiredSpacing; - requiredSpacing.Fill(0.6); + auto requiredSpacing = itk::MakeFilled(0.6); SizeType requiredSize; for (unsigned int d = 0; d < SpaceDimension; ++d) { diff --git a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index d8f26ba4f33..c1f5a04b2a8 100644 --- a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -31,15 +31,13 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, * Define the transformation domain */ using PointType = TransformType::PointType; - PointType origin; - origin.Fill(-5.0); + auto origin = itk::MakeFilled(-5.0); using SizeType = TransformType::SizeType; auto size = SizeType::Filled(65); using SpacingType = TransformType::SpacingType; - SpacingType spacing; - spacing.Fill(1.2); + auto spacing = itk::MakeFilled(1.2); using DirectionType = TransformType::DirectionType; DirectionType direction; @@ -57,8 +55,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, displacementField->FillBuffer(zeroVector); - TransformType::OutputVectorType nonzeroVector; - nonzeroVector.Fill(10.3); + auto nonzeroVector = itk::MakeFilled(10.3); auto index = DisplacementFieldType::IndexType::Filled(40); displacementField->SetPixel(index, nonzeroVector); @@ -71,8 +68,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); - TransformType::InputPointType point; - point.Fill(50.0); + auto point = itk::MakeFilled(50.0); TransformType::OutputPointType outputPointBeforeAdapt = transform->TransformPoint(point); SpacingType spacingBefore = transform->GetDisplacementField()->GetSpacing(); @@ -86,8 +82,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, std::cout << "Instantiate adaptor." << std::endl; - SpacingType requiredSpacing; - requiredSpacing.Fill(0.6); + auto requiredSpacing = itk::MakeFilled(0.6); SizeType requiredSize; for (unsigned int d = 0; d < SpaceDimension; ++d) { diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx index d96d95336e4..0c131070137 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx @@ -252,8 +252,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); standardDeviation = 1.0; - RegistrationType::StandardDeviationsType standardDeviations; - standardDeviations.Fill(standardDeviation); + auto standardDeviations = itk::MakeFilled(standardDeviation); registrator->SetStandardDeviations(standardDeviations); // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx index cc248d814d1..b411aed2d0c 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx @@ -254,8 +254,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); standardDeviation = 1.0; - RegistrationType::StandardDeviationsType standardDeviations; - standardDeviations.Fill(standardDeviation); + auto standardDeviations = itk::MakeFilled(standardDeviation); registrator->SetStandardDeviations(standardDeviations); // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx index 8d3ef82447f..d5c046dd2ea 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx @@ -279,8 +279,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); standardDeviation = 1.0; - RegistrationType::StandardDeviationsType standardDeviations; - standardDeviations.Fill(standardDeviation); + auto standardDeviations = itk::MakeFilled(standardDeviation); registrator->SetStandardDeviations(standardDeviations); // ITK_TEST_SET_GET_VALUE( standardDeviations, registrator->GetStandardDeviations() ); diff --git a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx index 723b57bccc1..2f85a34af4e 100644 --- a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx @@ -151,11 +151,10 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) constexpr itk::SizeValueType imageSize = 6; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx index 22d6186d138..be1a136460a 100644 --- a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx @@ -128,11 +128,10 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) constexpr unsigned int imageDimensionality = 3; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx index 33d0b41c3c5..94a08506392 100644 --- a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx @@ -36,11 +36,10 @@ itkDemonsImageToImageMetricv4Test(int, char ** const) constexpr unsigned int imageDimensionality = 3; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx index da3809a81dc..cd7667fa7b2 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx @@ -255,8 +255,7 @@ itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) using RegionType = FieldType::RegionType; using RealType = DisplacementFieldTransformType::ScalarType; - FieldType::SpacingType spacing; - spacing.Fill(static_cast(1.0)); + auto spacing = itk::MakeFilled(static_cast(1.0)); FieldType::DirectionType direction{}; for (unsigned int d = 0; d < Dimension; ++d) diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx index 81680dc1e9b..df038b36ee8 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx @@ -99,8 +99,7 @@ itkEuclideanDistancePointSetMetricTest2Run() using FieldType = typename DisplacementFieldTransformType::DisplacementFieldType; using RegionType = typename FieldType::RegionType; - typename FieldType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); typename FieldType::DirectionType direction{}; for (unsigned int d = 0; d < Dimension; ++d) @@ -231,8 +230,7 @@ itkEuclideanDistancePointSetMetricTest2Run() metric->SetVirtualDomain(spacing, origin, direction, badRegion); ITK_TRY_EXPECT_EXCEPTION(metric->Initialize()); - typename FieldType::SpacingType badSpacing; - badSpacing.Fill(0.5); + auto badSpacing = itk::MakeFilled(0.5); metric->SetVirtualDomain(badSpacing, origin, direction, region); ITK_TRY_EXPECT_EXCEPTION(metric->Initialize()); diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx index 583b69cb087..09fd8e6b4d1 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx @@ -63,8 +63,8 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, auto size = TImage::SizeType::Filled(ImageSize); - typename TImage::SpacingType spacing; - spacing.Fill(itk::NumericTraits::OneValue()); + auto spacing = + itk::MakeFilled(itk::NumericTraits::OneValue()); typename TImage::PointType origin{}; diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx index 91be96d2c05..6bb1634813b 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx @@ -386,11 +386,10 @@ itkImageToImageMetricv4Test(int, char ** const) using DimensionSizeType = unsigned int; constexpr DimensionSizeType imageSize = 4; - ImageToImageMetricv4TestImageType::SizeType size = { { imageSize, imageSize } }; - ImageToImageMetricv4TestImageType::IndexType index = { { 0, 0 } }; - ImageToImageMetricv4TestImageType::RegionType region{ index, size }; - ImageToImageMetricv4TestImageType::SpacingType spacing; - spacing.Fill(1.0); + ImageToImageMetricv4TestImageType::SizeType size = { { imageSize, imageSize } }; + ImageToImageMetricv4TestImageType::IndexType index = { { 0, 0 } }; + ImageToImageMetricv4TestImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageToImageMetricv4TestImageType::PointType origin{}; ImageToImageMetricv4TestImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx index 0832e4eadf2..658a236c479 100644 --- a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx @@ -36,11 +36,10 @@ itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) constexpr unsigned int imageDimensionality = 3; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx index 4c42638eba4..152354a5d95 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx @@ -38,11 +38,10 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest(int, char ** const) using VectorType = itk::Vector; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx index 4d82c5a0e3c..7f261c791fe 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx @@ -34,11 +34,10 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest2Run(typename TMetric::MeasureType using ImageType = typename TMetric::FixedImageType; - auto size = ImageType::SizeType::Filled(imageSize); - typename ImageType::IndexType index{}; - typename ImageType::RegionType region{ index, size }; - typename ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + typename ImageType::IndexType index{}; + typename ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); typename ImageType::PointType origin{}; typename ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx index eb2f635ae6b..f2acab04084 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx @@ -39,11 +39,10 @@ itkMeanSquaresImageToImageMetricv4SpeedTest(int argc, char * argv[]) constexpr unsigned int imageDimensionality = 3; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx index 1c8b22ecd50..ad9089492fe 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx @@ -34,11 +34,10 @@ itkMeanSquaresImageToImageMetricv4Test(int, char ** const) constexpr unsigned int imageDimensionality = 3; using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - ImageType::IndexType index{}; - ImageType::RegionType region{ index, size }; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + ImageType::IndexType index{}; + ImageType::RegionType region{ index, size }; + auto spacing = itk::MakeFilled(1.0); ImageType::PointType origin{}; ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx index 7a2b068b0aa..714ca35bf9d 100644 --- a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx @@ -209,11 +209,10 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, using ImageType = itk::Image; - auto size = ImageType::SizeType::Filled(imageSize); - typename ImageType::IndexType virtualIndex{}; - typename ImageType::RegionType region{ virtualIndex, size }; - typename ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto size = ImageType::SizeType::Filled(imageSize); + typename ImageType::IndexType virtualIndex{}; + typename ImageType::RegionType region{ virtualIndex, size }; + auto spacing = itk::MakeFilled(1.0); typename ImageType::PointType origin{}; typename ImageType::DirectionType direction; direction.SetIdentity(); @@ -409,8 +408,7 @@ itkMetricImageGradientTest(int argc, char * argv[]) transform->SetIdentity(); transform->Rotate2D(itk::Math::pi * rotationDegrees / 180); - ImageType::PointType center; - center.Fill((imageSize - 1) / 2.0); + auto center = itk::MakeFilled((imageSize - 1) / 2.0); transform->SetCenter(center); using ImageType = itk::Image; diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx index b54e7f7bf95..b378555d34a 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx @@ -91,8 +91,8 @@ ObjectToObjectMultiMetricv4RegistrationTestCreateImages(typename TImage::Pointer auto size = TImage::SizeType::Filled(ImageSize); - typename TImage::SpacingType spacing; - spacing.Fill(itk::NumericTraits::OneValue()); + auto spacing = + itk::MakeFilled(itk::NumericTraits::OneValue()); typename TImage::PointType origin{}; diff --git a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx index 4abaf4324c6..ee4e5e59237 100644 --- a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx @@ -176,8 +176,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) ImageType::PointType origin{}; origin[0] = 0.8; - ImageType::SpacingType spacing; - spacing.Fill(1.0); + auto spacing = itk::MakeFilled(1.0); spacing[1] = 1.2; auto moving = ImageType::New(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx index ab65308a631..aa7871a946a 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx @@ -235,11 +235,9 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) auto fieldTransform = DisplacementFieldTransformType::New(); - typename DisplacementFieldTransformType::ArrayType updateControlPoints; - updateControlPoints.Fill(10); + auto updateControlPoints = itk::MakeFilled(10); - typename DisplacementFieldTransformType::ArrayType velocityControlPoints; - velocityControlPoints.Fill(10); + auto velocityControlPoints = itk::MakeFilled(10); fieldTransform->SetNumberOfControlPointsForTheUpdateField(updateControlPoints); fieldTransform->SetNumberOfControlPointsForTheConstantVelocityField(velocityControlPoints); @@ -250,9 +248,8 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) displacementFieldSimple->InPlaceOn(); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx index 1f163e1eaf0..6a2d6881fda 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx @@ -197,9 +197,8 @@ PerformBSplineImageRegistration(int argc, char * argv[]) // using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx index fe260f80fa3..df70890377f 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx @@ -278,9 +278,8 @@ PerformBSplineSyNImageRegistration(int argc, char * argv[]) } using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx index 72f49b30108..463ac81c686 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx @@ -281,9 +281,8 @@ PerformExpImageRegistration(int argc, char * argv[]) std::cout << "ConstantVelocityFieldSetTime: " << fieldTransform->GetConstantVelocityFieldSetTime() << std::endl; using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx index 1a31c74ccd9..dc15a25841e 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx @@ -277,9 +277,8 @@ PerformSimpleImageRegistration(int argc, char * argv[]) displacementFieldSimple->SetObjectName("displacementFieldSimple"); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx index 01c8aab01ab..4be35c30cce 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx @@ -276,9 +276,8 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) displacementFieldSimple->SetObjectName("displacementFieldSimple"); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx index 5654883d414..c644d133eae 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx @@ -312,9 +312,8 @@ PerformDisplacementFieldImageRegistration(int argc, char * argv[]) } using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx index d2ab0e21426..35f3f043061 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx @@ -191,9 +191,8 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) affineWriter->Update(); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx index 39d6d4015cc..219999ea653 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx @@ -235,9 +235,8 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) velocityField->FillBuffer(zeroVector); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - auto correlationMetric = CorrelationMetricType::New(); - typename CorrelationMetricType::RadiusType radius; - radius.Fill(4); + auto correlationMetric = CorrelationMetricType::New(); + auto radius = itk::MakeFilled(4); correlationMetric->SetRadius(radius); correlationMetric->SetUseMovingImageGradientFilter(false); correlationMetric->SetUseFixedImageGradientFilter(false); diff --git a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx index 0c6a0863fe7..ed5daaedf0f 100644 --- a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx @@ -98,8 +98,7 @@ itkSupervisedImageClassifierTest(int, char *[]) // Slice 1 // Vector no. 1 - VecImagePixelType vec; - vec.Fill(21); + auto vec = itk::MakeFilled(21); outIt.Set(vec); ++outIt; // Vector no. 2 diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx index c10040794e5..4424ab242b1 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx @@ -52,9 +52,8 @@ itkDeformableSimplexMesh3DBalloonForceFilterTest(int argc, char * argv[]) // declare the triangle to simplex mesh filter using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(10); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx index d85939de91d..d0562013394 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx @@ -70,9 +70,8 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) using SimplexVolumeType = itk::SimplexMeshVolumeCalculator; // create the actual mesh, sphere - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(10); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx index 8aec8e41cd8..05fc67ea3bd 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx @@ -49,9 +49,8 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) // note : image is volume of 20x20x20 starting at 0,0,0 so make sure // the mesh sits on image in space - auto mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; - center.Fill(10); + auto mySphereMeshSource = SphereMeshSourceType::New(); + auto center = itk::MakeFilled(10); PointType::ValueType scaleInit[PointDimension] = { 5, 5, 5 }; VectorType scale = scaleInit; diff --git a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx index 4d364e0d22a..35a431c4b1b 100644 --- a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx @@ -47,8 +47,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(50); + auto center = itk::MakeFilled(50); double radius = 19.5; double accum = 0.0; @@ -65,8 +64,7 @@ template double SimpleVelocity(const TPoint & p) { - TPoint center; - center.Fill(50); + auto center = itk::MakeFilled(50); double value; double x = p[0] - center[0]; diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx index 6b996cbd3a6..3d8013d9a18 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx @@ -226,8 +226,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) costFunction->SetShapeParameterMeans(mean); costFunction->SetShapeParameterStandardDeviations(stddev); - CostFunctionType::WeightsType weights; - weights.Fill(1.0); + auto weights = itk::MakeFilled(1.0); weights[1] = 10.0; costFunction->SetWeights(weights); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx index bbeb43dd565..16a48d5c3e0 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx @@ -295,8 +295,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) costFunction->SetShapeParameterMeans(mean); costFunction->SetShapeParameterStandardDeviations(stddev); - CostFunctionType::WeightsType weights; - weights.Fill(1.0); + auto weights = itk::MakeFilled(1.0); weights[1] = 10.0; costFunction->SetWeights(weights); diff --git a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx index 46fa89f43fe..eb75d8efeed 100644 --- a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx @@ -48,8 +48,7 @@ template double SimpleSignedDistance(const TPoint & p) { - TPoint center; - center.Fill(50); + auto center = itk::MakeFilled(50); double radius = 19.5; double accum = 0.0; diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx index 54ecedc003a..bcde9f00841 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx @@ -149,8 +149,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) costFunction->SetShapeParameterMeans(shapeMean); costFunction->SetShapeParameterStandardDeviations(shapeStdDev); - CostFunctionType::WeightsType weights; - weights.Fill(1.5); + auto weights = itk::MakeFilled(1.5); costFunction->SetWeights(weights); diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx index 644c625c2a5..a36ad06b62d 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx @@ -81,8 +81,7 @@ class SimpleTestFilter : public DenseFiniteDifferenceImageFilter function->SetCurvatureWeight(0.0); function->SetShapePriorWeight(1.0); - typename ShapePriorFunctionType::RadiusType radius; - radius.Fill(1); + auto radius = itk::MakeFilled(1); function->Initialize(radius); this->SetDifferenceFunction(function); diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx index 5dc13327cfd..b524e4075a6 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx @@ -422,8 +422,7 @@ itkMRFImageFilterTest(int, char *[]) using OutImageFacesCalculator = itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator; using OutImageFaceListType = OutImageFacesCalculator::FaceListType; - OutImageNeighborhoodRadiusType outImageNeighborhoodRadius; - outImageNeighborhoodRadius.Fill(1); + auto outImageNeighborhoodRadius = itk::MakeFilled(1); // Define the face list for the input/labelled image OutImageFacesCalculator outImageFacesCalculator;