From d36dfc65c7c3734872dc1bfedf16ce388e4ef33c Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 17 Oct 2024 23:14:50 +0200 Subject: [PATCH] STYLE: Replace Fill(0.) with {} initializer for local variables in tests Replaced `Fill(0.)`, `Fill(0.0)`, `Fill(0.0f)`, and `Fill(0u)` calls with `{}` initializers. Follow-up to pull request https://github.com/InsightSoftwareConsortium/ITK/pull/4881 commit 569a8b6fe9e3945c46e13f7b21e5512ebd61afaf "STYLE: Replace Fill(0) with {} initializer for local variables in tests" --- .../VtkGlue/test/itkImageToVTKImageFilterTest.cxx | 3 +-- Modules/Core/Common/test/itkImageTest.cxx | 3 +-- Modules/Core/Common/test/itkMatrixTest.cxx | 3 +-- .../test/itkRayCastInterpolateImageFunctionTest.cxx | 3 +-- .../itkParametricSpaceToImageSpaceMeshFilterTest.cxx | 3 +-- Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx | 3 +-- .../Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx | 3 +-- ...kQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx | 6 ++---- .../test/itkGaussianSpatialObjectTest.cxx | 3 +-- .../test/itkImageMaskSpatialObjectTest3.cxx | 3 +-- .../test/itkBSplineDeformableTransformTest.cxx | 6 ++---- .../Core/Transform/test/itkBSplineTransformTest.cxx | 6 ++---- .../test/itkQuaternionRigidTransformTest.cxx | 3 +-- .../Core/Transform/test/itkRigid2DTransformTest.cxx | 3 +-- .../test/itkRigid3DPerspectiveTransformTest.cxx | 6 ++---- .../Core/Transform/test/itkRigid3DTransformTest.cxx | 3 +-- .../test/itkTransformGeometryImageFilterTest.cxx | 6 ++---- .../Core/Transform/test/itkVersorTransformTest.cxx | 3 +-- .../itkInverseDisplacementFieldImageFilterTest.cxx | 3 +-- ...rativeInverseDisplacementFieldImageFilterTest.cxx | 3 +-- .../test/itkLandmarkDisplacementFieldSourceTest.cxx | 3 +-- ...aryingVelocityFieldIntegrationImageFilterTest.cxx | 3 +-- .../itkTimeVaryingVelocityFieldTransformTest.cxx | 3 +-- .../test/itkFastMarchingImageFilterBaseTest.cxx | 3 +-- .../itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx | 3 +-- .../itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx | 3 +-- ...ingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx | 3 +-- ...kHessianRecursiveGaussianFilterScaleSpaceTest.cxx | 6 ++---- .../test/itkGradientRecursiveGaussianFilterTest.cxx | 3 +-- ...BSplineScatteredDataPointSetToImageFilterTest.cxx | 3 +-- ...SplineScatteredDataPointSetToImageFilterTest2.cxx | 3 +-- ...SplineScatteredDataPointSetToImageFilterTest3.cxx | 3 +-- ...SplineScatteredDataPointSetToImageFilterTest5.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest4.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest5.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest6.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest7.cxx | 3 +-- .../ImageGrid/test/itkResampleImageTest8.cxx | 3 +-- .../ImageSources/test/itkGridImageSourceTest.cxx | 3 +-- .../test/itkRegularSphereQuadEdgeMeshSourceTest.cxx | 6 ++---- Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx | 3 +-- Modules/IO/NIFTI/test/itkNiftiImageIOTest.cxx | 12 ++++-------- .../IO/TransformMINC/test/itkIOTransformMINCTest.cxx | 9 +++------ .../test/itkMINCTransformAdapterTest.cxx | 3 +-- .../IntegratedTest/test/itkTriangleHelperTest.cxx | 3 +-- ...RegistrationParameterScalesFromIndexShiftTest.cxx | 3 +-- ...tkRegistrationParameterScalesFromJacobianTest.cxx | 3 +-- ...nParameterScalesFromPhysicalShiftPointSetTest.cxx | 3 +-- ...istrationParameterScalesFromPhysicalShiftTest.cxx | 3 +-- .../test/itkWeightedCentroidKdTreeGeneratorTest8.cxx | 3 +-- .../test/itkHistogramImageToImageMetricTest.cxx | 6 ++---- .../itkMultiResolutionPyramidImageFilterTest.cxx | 3 +-- .../test/itkFEMFiniteDifferenceFunctionLoadTest.cxx | 3 +-- .../FEM/test/itkFEMRegistrationFilter2DTest.cxx | 3 +-- .../FEM/test/itkFEMRegistrationFilterTest.cxx | 3 +-- .../FEM/test/itkFEMRegistrationFilterTest2.cxx | 3 +-- .../test/itkGPUDemonsRegistrationFilterTest2.cxx | 3 +-- .../test/itkEuclideanDistancePointSetMetricTest2.cxx | 9 +++------ .../test/itkEuclideanDistancePointSetMetricTest3.cxx | 3 +-- .../Metricsv4/test/itkMetricImageGradientTest.cxx | 3 +-- .../test/itkObjectToObjectMultiMetricv4Test.cxx | 3 +-- .../test/itkCurvatureRegistrationFilterTest.cxx | 3 +-- .../test/itkDemonsRegistrationFilterTest.cxx | 3 +-- .../itkDiffeomorphicDemonsRegistrationFilterTest.cxx | 3 +-- ...stSymmetricForcesDemonsRegistrationFilterTest.cxx | 3 +-- .../test/itkLevelSetMotionRegistrationFilterTest.cxx | 3 +-- ...kMultiResolutionPDEDeformableRegistrationTest.cxx | 6 ++---- ...tkSymmetricForcesDemonsRegistrationFilterTest.cxx | 3 +-- 69 files changed, 85 insertions(+), 170 deletions(-) diff --git a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx index cc78c0051a5..89adef158ee 100644 --- a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx @@ -48,8 +48,7 @@ itkImageToVTKImageFilterTest(int, char *[]) origin[0] = -1.5; origin[1] = 0.222; origin[2] = 0; - DirectionType direction; - direction.Fill(0.0); + DirectionType direction{}; direction[0][1] = 1; direction[1][0] = -1; direction[2][2] = 0.7; diff --git a/Modules/Core/Common/test/itkImageTest.cxx b/Modules/Core/Common/test/itkImageTest.cxx index f7f9bb48e53..d31ffc93c64 100644 --- a/Modules/Core/Common/test/itkImageTest.cxx +++ b/Modules/Core/Common/test/itkImageTest.cxx @@ -31,8 +31,7 @@ class TestTransform OutputPointType TransformPoint(const InputPointType & inputPoint) const { - OutputPointType outputPoint; - outputPoint.Fill(0.0); + OutputPointType outputPoint{}; // if InputPoint Dimension < 2 then embed point in 2D space // else project the point to 2D space. for (unsigned int d = 0; d < std::min(inputPoint.GetPointDimension(), outputPoint.GetPointDimension()); ++d) diff --git a/Modules/Core/Common/test/itkMatrixTest.cxx b/Modules/Core/Common/test/itkMatrixTest.cxx index 5c9ae91226a..528d9d62a92 100644 --- a/Modules/Core/Common/test/itkMatrixTest.cxx +++ b/Modules/Core/Common/test/itkMatrixTest.cxx @@ -33,8 +33,7 @@ itkMatrixTest(int, char *[]) using vnlVectorType = vnl_vector_fixed; - MatrixType matrix; - matrix.Fill(0.0); + MatrixType matrix{}; matrix.SetIdentity(); VectorType v1; diff --git a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx index 8b6a56f6108..999fdae4bbc 100644 --- a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx @@ -54,8 +54,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a image->SetRegions(region); image->Allocate(); - PointType origin; - origin.Fill(0.0); + PointType origin{}; SpacingType spacing; spacing.Fill(1.0); diff --git a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx index 13d107c1968..cd98f733044 100644 --- a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx @@ -101,8 +101,7 @@ InternalTest(int argc, char * argv[]) imageIterator.GoToBegin(); using PointType = typename InputMeshType::PointType; - PointType point; - point.Fill(0.); + PointType point{}; using PointDataContainer = typename InputMeshType::PointDataContainer; using PointDataContainerPointer = typename InputMeshType::PointDataContainerPointer; diff --git a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx index fa2e35638fa..6240877f005 100644 --- a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx @@ -54,8 +54,7 @@ itkSphereMeshSourceTest(int, char *[]) // itk::Mesh::PointsContainer::Iterator m_output = myoutput->Begin(); IPT * pt_ptr; - IPT pt; - pt.Fill(0.0); + IPT pt{}; pt_ptr = &pt; for (int i = 0; i < 12; ++i) diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx index 433d4e2285e..111730db482 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx @@ -64,8 +64,7 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[]) MeshType::Pointer myMesh = mySphereMeshSource->GetOutput(); - PointType pt; - pt.Fill(0.); + PointType pt{}; bool testPassed = true; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx index 6d5a5cbeefe..7251a35af9c 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx @@ -43,8 +43,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - PointType center; - center.Fill(0.0); + PointType center{}; VectorType scale; scale.Fill(1.0); @@ -62,8 +61,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[]) MeshType::Pointer myMesh = mySphereMeshSource->GetOutput(); - PointType pt; - pt.Fill(0.); + PointType pt{}; myMesh->Print(std::cout); diff --git a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx index 80fbd147223..9ddaa637b8f 100644 --- a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx @@ -41,8 +41,7 @@ itkGaussianSpatialObjectTest(int, char *[]) myGaussian->SetSigmaInObjectSpace(sigma); ITK_TEST_SET_GET_VALUE(sigma, myGaussian->GetSigmaInObjectSpace()); - GaussianType::PointType center; - center.Fill(0.0); + GaussianType::PointType center{}; myGaussian->SetCenterInObjectSpace(center); ITK_TEST_SET_GET_VALUE(center, myGaussian->GetCenterInObjectSpace()); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx index c8254e00678..cef9d89045a 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx @@ -53,8 +53,7 @@ itkImageMaskSpatialObjectTest3(int, char *[]) ImageType::IndexType index{}; - ImageType::DirectionType direction; - direction.Fill(0.0); + ImageType::DirectionType direction{}; direction[0][1] = 1; direction[1][0] = 1; direction[2][2] = 1; diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx index fe883ab501a..dd586682be3 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx @@ -61,8 +61,7 @@ itkBSplineDeformableTransformTest1() */ using OriginType = TransformType::OriginType; - OriginType origin; - origin.Fill(0.0); + OriginType origin{}; using RegionType = TransformType::RegionType; RegionType region; @@ -598,8 +597,7 @@ itkBSplineDeformableTransformTest3() */ using OriginType = TransformType::OriginType; - OriginType origin; - origin.Fill(0.0); + OriginType origin{}; using RegionType = TransformType::RegionType; RegionType region; diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx index b865457329f..14b80d15ef4 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx @@ -59,8 +59,7 @@ itkBSplineTransformTest1() */ using OriginType = TransformType::OriginType; - OriginType origin; - origin.Fill(0.0); + OriginType origin{}; using PhysicalDimensionsType = TransformType::PhysicalDimensionsType; PhysicalDimensionsType dimensions; @@ -615,8 +614,7 @@ itkBSplineTransformTest3() */ using OriginType = TransformType::OriginType; - OriginType origin; - origin.Fill(0.0); + OriginType origin{}; using PhysicalDimensionsType = TransformType::PhysicalDimensionsType; PhysicalDimensionsType dimensions; diff --git a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx index 68edfe9d902..d3d7ac5aa61 100644 --- a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx +++ b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx @@ -214,8 +214,7 @@ itkQuaternionRigidTransformTest(int, char *[]) rotation->SetIdentity(); rotation->SetRotation(qrotation); - TransformType::OffsetType ioffset; - ioffset.Fill(0.0f); + TransformType::OffsetType ioffset{}; // rotation->ComputeOffset(); diff --git a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx index b8f4926d9fa..5c8cdb0469a 100644 --- a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx @@ -269,8 +269,7 @@ itkRigid2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::OffsetType ioffset; - ioffset.Fill(0.0f); + TransformType::OffsetType ioffset{}; rotation->SetOffset(ioffset); diff --git a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx index c1ad662a66c..6a2bfe713dd 100644 --- a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx @@ -107,8 +107,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) auto translation = TransformType::New(); translation->SetFocalDistance(focal); - TransformType::OffsetType ioffset; - ioffset.Fill(0.0); + TransformType::OffsetType ioffset{}; translation->SetOffset(ioffset); ITK_TEST_SET_GET_VALUE(ioffset, translation->GetOffset()); @@ -170,8 +169,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) auto rigid = TransformType::New(); rigid->SetFocalDistance(focal); - TransformType::OffsetType ioffset; - ioffset.Fill(0.0); + TransformType::OffsetType ioffset{}; rigid->SetOffset(ioffset); diff --git a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx index 3d1f93a6fe4..082fde57749 100644 --- a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx @@ -310,8 +310,7 @@ itkRigid3DTransformTest(int, char *[]) rotation->SetMatrix(mrotation); - TransformType::OffsetType ioffset; - ioffset.Fill(0.0f); + TransformType::OffsetType ioffset{}; rotation->SetOffset(ioffset); diff --git a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx index 9c363966195..3257e556821 100644 --- a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx +++ b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx @@ -102,14 +102,12 @@ itkTransformGeometryImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(inputImage = itk::ReadImage(argv[1])); // Set up transforms - ImageType::PointType center; - center.Fill(0.0); + ImageType::PointType center{}; center[0] = 2.0; // In mm along X (RL-axis) center[1] = 5.0; // In mm along Y (AP-axis) center[2] = 7.0; // In mm along Z (IS-axis) - itk::Vector translation; - translation.Fill(0.); + itk::Vector translation{}; translation[0] = 10.0; // In mm along X (RL-axis) translation[1] = 15.0; // In mm along Y (AP-axis) translation[2] = 20.0; // In mm along Z (IS-axis) diff --git a/Modules/Core/Transform/test/itkVersorTransformTest.cxx b/Modules/Core/Transform/test/itkVersorTransformTest.cxx index d1f6207d1bb..0aa40704167 100644 --- a/Modules/Core/Transform/test/itkVersorTransformTest.cxx +++ b/Modules/Core/Transform/test/itkVersorTransformTest.cxx @@ -440,8 +440,7 @@ itkVersorTransformTest(int, char *[]) // Check the computed parameters - VectorType axis; - axis.Fill(0.0); + VectorType axis{}; axis[2] = 1.0; VersorType v; v.Set(axis, a); diff --git a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx index a7a23b7d41f..91851a685bb 100644 --- a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx @@ -61,8 +61,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) DisplacementFieldType::SpacingType spacing; spacing.Fill(1.0); - DisplacementFieldType::PointType origin; - origin.Fill(0.0); + DisplacementFieldType::PointType origin{}; DisplacementFieldType::RegionType region; DisplacementFieldType::SizeType size; diff --git a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx index 41ddda1be71..f6f5d6f76ee 100644 --- a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx @@ -65,8 +65,7 @@ itkIterativeInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) DisplacementFieldType::SpacingType spacing; spacing.Fill(1.0); - DisplacementFieldType::PointType origin; - origin.Fill(0.0); + DisplacementFieldType::PointType origin{}; DisplacementFieldType::RegionType region; DisplacementFieldType::SizeType size; diff --git a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx index 1d84550e190..de515efd92f 100644 --- a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx @@ -56,8 +56,7 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) DisplacementFieldType::SpacingType spacing; spacing.Fill(1.0); - DisplacementFieldType::PointType origin; - origin.Fill(0.0); + DisplacementFieldType::PointType origin{}; DisplacementFieldType::RegionType region; DisplacementFieldType::SizeType size; diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx index ee639609093..0afe5b5cb64 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx @@ -45,8 +45,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int argc, char * argv[]) using DisplacementFieldType = itk::Image; using TimeVaryingVelocityFieldType = itk::Image; - TimeVaryingVelocityFieldType::PointType origin; - origin.Fill(0.0); + TimeVaryingVelocityFieldType::PointType origin{}; TimeVaryingVelocityFieldType::SpacingType spacing; spacing.Fill(2.0); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx index 1ab58f44422..4e990c8251c 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx @@ -32,8 +32,7 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) using DisplacementFieldType = itk::Image; using TimeVaryingVelocityFieldType = itk::Image; - TimeVaryingVelocityFieldType::PointType origin; - origin.Fill(0.0); + TimeVaryingVelocityFieldType::PointType origin{}; TimeVaryingVelocityFieldType::SpacingType spacing; spacing.Fill(2.0); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx index ec14c5838d1..93d1d67ed4d 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx @@ -62,8 +62,7 @@ FastMarchingImageFilterBaseTestFunction() fastMarchingFilter->SetOutputDirection(outputDirection); ITK_TEST_SET_GET_VALUE(outputDirection, fastMarchingFilter->GetOutputDirection()); - typename FastMarchingImageFilterType::OutputPointType outputOrigin; - outputOrigin.Fill(0.0); + typename FastMarchingImageFilterType::OutputPointType outputOrigin{}; fastMarchingFilter->SetOutputOrigin(outputOrigin); ITK_TEST_SET_GET_VALUE(outputOrigin, fastMarchingFilter->GetOutputOrigin()); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx index 80897c813a2..9818c8e4f84 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx @@ -45,8 +45,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest(int, char *[]) using FastMarchingType = itk::FastMarchingQuadEdgeMeshFilterBase; - MeshType::PointType center; - center.Fill(0.); + MeshType::PointType center{}; using SphereSourceType = itk::RegularSphereMeshSource; auto sphere_filter = SphereSourceType::New(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx index ed30dc6edca..2d0a99358fc 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx @@ -57,8 +57,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest3(int, char *[]) points->Reserve(100); pointdata->Reserve(100); - MeshType::PointType p; - p.Fill(0.); + MeshType::PointType p{}; int k = 0; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx index 635a440047c..027716b35b6 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx @@ -44,8 +44,7 @@ itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest(int, char *[]) using FastMarchingType = itk::FastMarchingQuadEdgeMeshFilterBase; - MeshType::PointType center; - center.Fill(0.); + MeshType::PointType center{}; using SphereSourceType = itk::RegularSphereMeshSource; auto sphere_filter = SphereSourceType::New(); diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx index 1bcd32378a9..549a645499b 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx @@ -102,8 +102,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) HessianImageType::Pointer outputImage = filter->GetOutput(); // Get the value at the center of the image, the location of the peak of the Gaussian - PointType center; - center.Fill(0.0); + PointType center{}; IndexType centerIndex = outputImage->TransformPhysicalPointToIndex(center); @@ -157,8 +156,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) HessianImageType::Pointer outputImage = filter->GetOutput(); // Get the value at the center of the image, the location of the peak of the Gaussian - PointType center; - center.Fill(0.0); + PointType center{}; IndexType centerIndex = outputImage->TransformPhysicalPointToIndex(center); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx index 302c250cff0..f0ca259ae76 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx @@ -153,8 +153,7 @@ itkGradientRecursiveGaussianFilterTest(int argc, char * argv[]) // // Test with a change in image direction // - myImageType::DirectionType direction; - direction.Fill(0.0); + myImageType::DirectionType direction{}; direction[0][0] = -1.0; direction[1][1] = -1.0; direction[2][2] = -1.0; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx index bc225393edc..a37821f6cb8 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx @@ -123,8 +123,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(ncps, filter->GetNumberOfControlPoints()); - FilterType::ArrayType close; - close.Fill(0u); + FilterType::ArrayType close{}; filter->SetCloseDimension(close); ITK_TEST_SET_GET_VALUE(close, filter->GetCloseDimension()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx index ac5ca451a07..cdbf3e27e70 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx @@ -81,8 +81,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) spacing.Fill(0.01); ImageType::SizeType size; size.Fill(101); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; filter->SetSize(size); filter->SetOrigin(origin); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx index feb8c54b765..1863162ff03 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx @@ -99,8 +99,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) ImageType::SizeType size; // Adding 0.5 to avoid rounding errors size.Fill(static_cast(1.0 / spacing[0] + .5) + 1); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; filter->SetSize(size); filter->SetOrigin(origin); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx index 6bfbb9c602d..ba96c29d821 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx @@ -144,8 +144,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) size[0] = 1000; size[1] = 100; - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; filter->SetSize(size); filter->SetOrigin(origin); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx index 942ccbaea38..0d84d16f43b 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx @@ -91,8 +91,7 @@ itkResampleImageTest(int, char *[]) resample->SetOutputStartIndex(index); ITK_TEST_SET_GET_VALUE(index, resample->GetOutputStartIndex()); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx index fa83d699044..b37c3f2caac 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx @@ -107,8 +107,7 @@ itkResampleImageTest4(int argc, char * argv[]) resample->SetOutputStartIndex(index); ITK_TEST_SET_GET_VALUE(index, resample->GetOutputStartIndex()); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx index 88acd05e029..2d3bd13b50c 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx @@ -110,8 +110,7 @@ itkResampleImageTest5(int argc, char * argv[]) resample->SetOutputStartIndex(index); ITK_TEST_SET_GET_VALUE(index, resample->GetOutputStartIndex()); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx index 0894768d649..0a8657e7fca 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx @@ -121,8 +121,7 @@ itkResampleImageTest6(int argc, char * argv[]) resample->SetOutputStartIndex(index); ITK_TEST_SET_GET_VALUE(index, resample->GetOutputStartIndex()); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx index a810a30fda9..67393dd69ce 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx @@ -96,8 +96,7 @@ itkResampleImageTest7(int, char *[]) resample->SetOutputStartIndex(index); ITK_TEST_SET_GET_VALUE(index, resample->GetOutputStartIndex()); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx index 185997251d5..16015656f6b 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx @@ -193,8 +193,7 @@ itkResampleImageTest8(int, char *[]) resample->SetOutputStartIndex(outputIndex); ITK_TEST_SET_GET_VALUE(outputIndex, resample->GetOutputStartIndex()); - OutputImageType::PointType origin; - origin.Fill(0.0); + OutputImageType::PointType origin{}; resample->SetOutputOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, resample->GetOutputOrigin()); diff --git a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx index cd829f7880e..83f3c7752c2 100644 --- a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx @@ -59,8 +59,7 @@ itkGridImageSourceTest(int argc, char * argv[]) ImageType::SizeType imageSize; imageSize.Fill(size); - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; ImageType::SpacingType imageSpacing; imageSpacing.Fill(1.0); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx index b71c130e3a5..e624224a4ca 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx @@ -41,8 +41,7 @@ itkRegularSphereQuadEdgeMeshSourceTest(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - PointType center; - center.Fill(0.0); + PointType center{}; VectorType scale; scale.Fill(1.0); @@ -60,8 +59,7 @@ itkRegularSphereQuadEdgeMeshSourceTest(int argc, char * argv[]) MeshType::Pointer myMesh = mySphereMeshSource->GetOutput(); - PointType pt; - pt.Fill(0.); + PointType pt{}; for (unsigned int i = 0; i < myMesh->GetNumberOfPoints(); ++i) { diff --git a/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx b/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx index 4e5cd3623b4..d017e75237b 100644 --- a/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx +++ b/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx @@ -281,8 +281,7 @@ HDF5ReadWriteTest(const char * fileName) success = EXIT_FAILURE; } - itk::Array metaDataDoubleArray2; - metaDataDoubleArray2.Fill(0.0); + itk::Array metaDataDoubleArray2{}; if (!itk::ExposeMetaData>(metaDict2, "TestDoubleArray", metaDataDoubleArray2) || metaDataDoubleArray2 != metaDataDoubleArray) { diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.cxx index 2e1eddd715e..6d8a313f269 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.cxx @@ -25,8 +25,7 @@ template <> itk::ImageBase<1>::DirectionType PreFillDirection<1>() { - itk::ImageBase<1>::DirectionType myDirection; - myDirection.Fill(0.0); + itk::ImageBase<1>::DirectionType myDirection{}; myDirection[0][0] = -1.0; return myDirection; } @@ -35,8 +34,7 @@ template <> itk::ImageBase<2>::DirectionType PreFillDirection<2>() { - itk::ImageBase<2>::DirectionType myDirection; - myDirection.Fill(0.0); + itk::ImageBase<2>::DirectionType myDirection{}; myDirection[0][1] = 1.0; myDirection[1][0] = -1.0; return myDirection; @@ -46,8 +44,7 @@ template <> itk::ImageBase<3>::DirectionType PreFillDirection<3>() { - itk::ImageBase<3>::DirectionType myDirection; - myDirection.Fill(0.0); + itk::ImageBase<3>::DirectionType myDirection{}; myDirection[0][2] = 1.0; myDirection[1][0] = -1.0; myDirection[2][1] = 1.0; @@ -58,8 +55,7 @@ template <> itk::ImageBase<4>::DirectionType PreFillDirection<4>() { - itk::ImageBase<4>::DirectionType myDirection; - myDirection.Fill(0.0); + itk::ImageBase<4>::DirectionType myDirection{}; myDirection[0][2] = 1.0; myDirection[1][0] = -1.0; myDirection[2][1] = 1.0; diff --git a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx index 02e8b47fa01..dbc92baf3bf 100644 --- a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx +++ b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx @@ -176,8 +176,7 @@ check_nonlinear_double(const char * nonlinear_transform) field->SetOrigin(origin); field->Allocate(); - DisplacementFieldType::PixelType zeroDisplacement; - zeroDisplacement.Fill(0.0); + DisplacementFieldType::PixelType zeroDisplacement{}; field->FillBuffer(zeroDisplacement); vnl_random randgen(12345678); @@ -303,8 +302,7 @@ check_nonlinear_float(const char * nonlinear_transform) field->SetOrigin(origin); field->Allocate(); - DisplacementFieldType::PixelType zeroDisplacement; - zeroDisplacement.Fill(0.0); + DisplacementFieldType::PixelType zeroDisplacement{}; field->FillBuffer(zeroDisplacement); vnl_random randgen(12345678); @@ -574,8 +572,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file) field->SetOrigin(origin); field->Allocate(); - DisplacementFieldType::PixelType displacement; - displacement.Fill(0.0); + DisplacementFieldType::PixelType displacement{}; displacement[0] = 1.0; field->FillBuffer(displacement); diff --git a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx index aa6a67b5c69..799fcc0d74a 100644 --- a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx +++ b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx @@ -156,8 +156,7 @@ compare_nonlinear_double(const char * nonlinear_transform) field->SetOrigin(origin); field->Allocate(); - DisplacementFieldType::PixelType zeroDisplacement; - zeroDisplacement.Fill(0.0); + DisplacementFieldType::PixelType zeroDisplacement{}; field->FillBuffer(zeroDisplacement); vnl_random randgen(12345678); diff --git a/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx index ed9cbcb0352..5ff2e901afb 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx @@ -28,8 +28,7 @@ itkTriangleHelperTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) using VectorType = PointType::VectorType; using TriangleHelperType = itk::TriangleHelper; - PointType Org; - Org.Fill(0.); + PointType Org{}; PointType a; a[0] = 1.; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx index 9ba5eda6e3c..050c906091f 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx @@ -261,8 +261,7 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; using VectorType = itk::Vector; - VectorType zero; - zero.Fill(0.0); + VectorType zero{}; auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx index 83e60c391c5..ab5f5e1bed1 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx @@ -266,8 +266,7 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; using VectorType = itk::Vector; - VectorType zero; - zero.Fill(0.0); + VectorType zero{}; auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx index b698cfba3fe..238d1bed43e 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx @@ -287,8 +287,7 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; using VectorType = itk::Vector; - VectorType zero; - zero.Fill(0.0); + VectorType zero{}; using RegionType = itk::ImageRegion; RegionType region; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx index 047490a7a5a..6d8f70fa9cc 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx @@ -308,8 +308,7 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; using VectorType = itk::Vector; - VectorType zero; - zero.Fill(0.0); + VectorType zero{}; auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx index 69f64500bdc..92071e854e4 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx @@ -82,8 +82,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) MeasurementVectorType result; MeasurementVectorType test_point; - MeasurementVectorType min_point; - min_point.Fill(0.0); + MeasurementVectorType min_point{}; unsigned int numberOfFailedPoints = 0; diff --git a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx index 165d4d5d897..ba97731bac2 100644 --- a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx @@ -191,10 +191,8 @@ itkHistogramImageToImageMetricTest(int, char *[]) std::cout << "Exercise the SetLowerBound() and SetUpperBound() methods " << std::endl; - MetricType::MeasurementVectorType lowerBound; - lowerBound.Fill(0.0); - MetricType::MeasurementVectorType upperBound; - upperBound.Fill(0.0); + MetricType::MeasurementVectorType lowerBound{}; + MetricType::MeasurementVectorType upperBound{}; metric->SetLowerBound(lowerBound); metric->SetUpperBound(upperBound); diff --git a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx index e281a950ce5..5f5a3ff135c 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx @@ -142,8 +142,7 @@ itkMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) spacing[1] = 2.7; spacing[2] = 7.5; - InputImageType::DirectionType direction; - direction.Fill(0.0); + InputImageType::DirectionType direction{}; direction[0][1] = -1; direction[1][2] = 1; direction[2][0] = 1; diff --git a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx index d676a36f95d..de7068a1005 100644 --- a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx @@ -435,8 +435,7 @@ itkFEMFiniteDifferenceFunctionLoadTest(int argc, char * argv[]) FillWithCircle(movingImage, center, radius, fgnd, bgnd); // Fill initial deformation with zero vectors - DeformationFieldVectorType zeroVec; - zeroVec.Fill(0.0); + DeformationFieldVectorType zeroVec{}; FillImage(initField, zeroVec); using ImageWriterType = itk::ImageFileWriter; diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx index a8fef01f82f..d96d95336e4 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx @@ -143,8 +143,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) FillWithCircle(movingImage, center, radius, fgnd, bgnd); // Fill initial deformation with zero vectors - DeformationFieldVectorType zeroVec; - zeroVec.Fill(0.0); + DeformationFieldVectorType zeroVec{}; FillImage(initField, zeroVec); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx index 0796705e735..cc248d814d1 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx @@ -145,8 +145,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) FillWithCircle(movingImage, center, radius, fgnd, bgnd); // Fill initial deformation with zero vectors - DeformationFieldVectorType zeroVec; - zeroVec.Fill(0.0); + DeformationFieldVectorType zeroVec{}; FillImage(initField, zeroVec); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx index 8eb6cbdd342..8d3ef82447f 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx @@ -162,8 +162,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) FillWithCircle(movingImage, center, radius, fgnd, bgnd); // Fill initial deformation with zero vectors - DeformationFieldVectorType zeroVec; - zeroVec.Fill(0.0); + DeformationFieldVectorType zeroVec{}; FillImage(initField, zeroVec); diff --git a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx index 90019147308..cc843d91fee 100644 --- a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx +++ b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx @@ -172,8 +172,7 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx index 42f49bf37b8..87fc08fa6f7 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx @@ -44,8 +44,7 @@ itkEuclideanDistancePointSetMetricTest2Run() // Create a few points and apply a small offset to make the moving points auto pointMax = static_cast(100.0); - PointType fixedPoint; - fixedPoint.Fill(0.0); + PointType fixedPoint{}; fixedPoint[0] = 0.0; fixedPoint[1] = 0.0; fixedPoints->SetPoint(0, fixedPoint); @@ -103,15 +102,13 @@ itkEuclideanDistancePointSetMetricTest2Run() typename FieldType::SpacingType spacing; spacing.Fill(1.0); - typename FieldType::DirectionType direction; - direction.Fill(0.0); + typename FieldType::DirectionType direction{}; for (unsigned int d = 0; d < Dimension; ++d) { direction[d][d] = 1.0; } - typename FieldType::PointType origin; - origin.Fill(0.0); + typename FieldType::PointType origin{}; typename RegionType::SizeType regionSize; regionSize.Fill(static_cast(pointMax + 1.0)); diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx index 98fe73d0322..3dcbe106d8a 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx @@ -45,8 +45,7 @@ itkEuclideanDistancePointSetMetricTest3Run(double distanceThreshold) // Create a few points and apply a small offset to make the moving points auto pointMax = static_cast(1.0); - PointType fixedPoint; - fixedPoint.Fill(0.0); + PointType fixedPoint{}; fixedPoint[0] = 0.0; fixedPoint[1] = 0.0; fixedPoints->SetPoint(0, fixedPoint); diff --git a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx index fd5cb3ffd0a..93b2b7c57d7 100644 --- a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx @@ -215,8 +215,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, typename ImageType::RegionType region{ virtualIndex, size }; typename ImageType::SpacingType spacing; spacing.Fill(1.0); - typename ImageType::PointType origin; - origin.Fill(0.0); + typename ImageType::PointType origin{}; typename ImageType::DirectionType direction; direction.SetIdentity(); diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx index 5f1058d3fb1..b9d0ad111c8 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx @@ -269,8 +269,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) using FieldType = DisplacementTransformType::DisplacementFieldType; using VectorType = itk::Vector; - VectorType zero; - zero.Fill(0.0); + VectorType zero{}; auto field = FieldType::New(); field->SetRegions(fixedImage->GetBufferedRegion()); diff --git a/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx index a600187e73a..fd48c238311 100644 --- a/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx @@ -163,8 +163,7 @@ itkCurvatureRegistrationFilterTest(int, char *[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); //------------------------------------------------------------- diff --git a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx index e193788c6f9..30165927092 100644 --- a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx @@ -162,8 +162,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; diff --git a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx index 93ff70a3f46..6378eb303ee 100644 --- a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx @@ -181,8 +181,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; diff --git a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx index 06d44120e35..b565fccbd66 100644 --- a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -161,8 +161,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; diff --git a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx index 526a90c306b..65229527b84 100644 --- a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx @@ -177,8 +177,7 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; diff --git a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx index abb96dd2c75..7ca79040304 100644 --- a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx @@ -174,8 +174,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) RegionType region{ index, size }; - ImageType::PointType origin; - origin.Fill(0.0); + ImageType::PointType origin{}; origin[0] = 0.8; ImageType::SpacingType spacing; @@ -222,8 +221,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; FillImage(initField, zeroVec); //---------------------------------------------------------------- diff --git a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx index 7f95898de62..46988e67d73 100644 --- a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -154,8 +154,7 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) FillWithCircle(fixed, center, radius, fgnd, bgnd); // fill initial deformation with zero vectors - VectorType zeroVec; - zeroVec.Fill(0.0); + VectorType zeroVec{}; initField->FillBuffer(zeroVec); std::cout << "Run registration and warp moving" << std::endl;