Skip to content

Remove p->Initialize() calls directly after p = T::New(), in tests and example #4976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ main(int argc, char * argv[])
// Software Guide : BeginCodeSnippet
ImageType::ConstPointer image = reader->GetOutput();
auto path = PathType::New();
path->Initialize();

using ContinuousIndexType = PathType::ContinuousIndexType;
ContinuousIndexType cindex;
Expand Down
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
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