Skip to content

Commit

Permalink
STYLE: Remove p->Initialize() calls after p = T::New() in tests
Browse files Browse the repository at this point in the history
- Follow-up to pull request InsightSoftwareConsortium#4972
commit 674b3d2
"STYLE: Remove `p->Initialize()` calls directly after `p = T::New()`"
  • Loading branch information
N-Dekker committed Nov 21, 2024
1 parent 674b3d2 commit a549d01
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[])
confidenceImage->FillBuffer(1.0);

auto pointSet = PointSetType::New();
pointSet->Initialize();

auto ones_points = itk::MakeFilled<VectorType>(1.0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[])

FilterType::WeightsContainerType::Pointer pointWeights = FilterType::WeightsContainerType::New();

pointWeights->Initialize();

unsigned int abritrarySize = filter->GetInput()->GetNumberOfPoints() - 1;
pointWeights->resize(abritrarySize);
for (unsigned int i = 0; i < pointWeights->Size(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[])
// Instantiate example corresponding points with relative weighting

auto pointSet = PointSetType::New();
pointSet->Initialize();

using WeightsContainerType = FilterType::WeightsContainerType;
auto weights = WeightsContainerType::New();
weights->Initialize();

// Create first landmark pair and weights
PointType landmarkInFirstImage1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[])
using PointType = PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();
auto movingPoints = PointSetType::New();
movingPoints->Initialize();

itk::Size<Dimension> virtualDomainSize;
virtualDomainSize[0] = static_cast<itk::SizeValueType>(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[])
using NumberGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;

auto randomNumberGenerator = NumberGeneratorType::New();
randomNumberGenerator->Initialize();

using MeasurementVectorType = itk::VariableLengthVector<double>;
using SampleType = itk::Statistics::ListSample<MeasurementVectorType>;
Expand Down
1 change: 0 additions & 1 deletion Modules/Registration/Common/test/itkPointsLocatorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ testPointsLocatorTest()

using PointsContainerType = TPointsContainer;
auto points = PointsContainerType::New();
points->Initialize();

using PointsLocatorType = itk::PointsLocator<PointsContainerType>;
auto pointsLocator = PointsLocatorType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ itkEuclideanDistancePointSetMetricRegistrationTestRun(unsigned int
using CoordRepType = typename PointType::CoordRepType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Create a few points and apply a small rotation to make the moving point set

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ itkEuclideanDistancePointSetMetricTestRun()
using PointType = typename PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Produce two simple point sets of 1) a circle and 2) the same circle with an offset;
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ itkEuclideanDistancePointSetMetricTest2Run()
using PointType = typename PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Create a few points and apply a small offset to make the moving points
auto pointMax = static_cast<float>(100.0);
Expand Down Expand Up @@ -200,7 +198,6 @@ itkEuclideanDistancePointSetMetricTest2Run()

// Test with no valid points.
auto fixedPoints2 = PointSetType::New();
fixedPoints2->Initialize();
fixedPoint[0] = -pointMax;
fixedPoint[1] = 0.0;
fixedPoints2->SetPoint(0, fixedPoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ itkEuclideanDistancePointSetMetricTest3Run(double distanceThreshold)
auto pointsLocator = PointsLocatorType::New();

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Create a few points and apply a small offset to make the moving points
auto pointMax = static_cast<float>(1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[])
using PointType = PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();


// two ellipses, one rotated slightly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ itkExpectationBasedPointSetMetricTestRun()
using PointType = typename PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Produce two simple point sets of 1) a circle and 2) the same circle with an offset;
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg
using PointType = PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();


// two ellipses, one rotated slightly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun()
using VectorType = typename PointType::VectorType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Produce two simple point sets of 1) a circle and 2) the same circle with an offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ itkLabeledPointSetMetricRegistrationTestPerMetric(unsigned int numberOfIteration
using PointType = typename PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// two circles with a small offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ itkLabeledPointSetMetricTestRun()
using PointType = typename PointSetType::PointType;

auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// Produce two simple point sets of 1) a circle and 2) the same circle with an offset;
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar


auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// two circles with a small offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[


auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// two circles with a small offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[])


auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// two circles with a small offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc),


auto fixedPoints = PointSetType::New();
fixedPoints->Initialize();

auto movingPoints = PointSetType::New();
movingPoints->Initialize();

// two circles with a small offset
PointType offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ itkShapePriorMAPCostFunctionTest(int, char *[])
*/
using ShapeFunctionType = itk::SphereSignedDistanceFunction<double, Dimension>;
auto shape = ShapeFunctionType::New();
shape->Initialize();

/**
* Set up a statistical model of the shape parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[])

using ShapeFunctionType = itk::SphereSignedDistanceFunction<double, Dimension>;
auto shape = ShapeFunctionType::New();
shape->Initialize();

ShapeFunctionType::ParametersType parameters(shape->GetNumberOfParameters());
parameters[0] = 10.0;
Expand Down

0 comments on commit a549d01

Please sign in to comment.