Skip to content
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

STYLE: Remove p->Initialize() calls directly after p = T::New() #4972

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 @@ BSplineTransformInitializer<TTransform, TImage>::InitializeTransform() const

using PointSetType = PointSet<CoordRepType, SpaceDimension>;
auto cornerPoints = PointSetType::New();
cornerPoints->Initialize();

using PointType = typename PointSetType::PointType;
using PointIdentifier = typename PointSetType::PointIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,12 @@ N4BiasFieldCorrectionImageFilter<TInputImage, TMaskImage, TOutputImage>::UpdateB
const typename ImporterType::OutputImageType * parametricFieldEstimate = importer->GetOutput();

PointSetPointer fieldPoints = PointSetType::New();
fieldPoints->Initialize();
auto & pointSTLContainer = fieldPoints->GetPoints()->CastToSTLContainer();
auto & pointSTLContainer = fieldPoints->GetPoints()->CastToSTLContainer();
pointSTLContainer.reserve(numberOfIncludedPixels);
auto & pointDataSTLContainer = fieldPoints->GetPointData()->CastToSTLContainer();
pointDataSTLContainer.reserve(numberOfIncludedPixels);

auto weights = BSplineFilterType::WeightsContainerType::New();
weights->Initialize();
auto weights = BSplineFilterType::WeightsContainerType::New();
auto & weightSTLContainer = weights->CastToSTLContainer();
weightSTLContainer.reserve(numberOfIncludedPixels);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ DisplacementFieldToBSplineImageFilter<TInputImage, TInputPointSet, TOutputImage>
}

auto fieldPoints = InputPointSetType::New();
fieldPoints->Initialize();

auto weights = WeightsContainerType::New();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ FastMarchingImageToNodePairContainerAdaptor<TInput, TOutput, TImage>::SetPointsF
if (iLabel == Traits::Alive || iLabel == Traits::InitialTrial || iLabel == Traits::Forbidden)
{
NodePairContainerPointer nodes = NodePairContainerType::New();
nodes->Initialize();

using IteratorType = ImageRegionConstIteratorWithIndex<ImageType>;
IteratorType it(image, image->GetBufferedRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ WindowConvergenceMonitoringFunction<TScalar>::GetConvergenceValue() const -> Rea
bspliner->SetNumberOfWorkUnits(1);

auto energyProfileWindow = EnergyProfileType::New();
energyProfileWindow->Initialize();

for (unsigned int n = 0; n < this->m_WindowSize; ++n)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ LandmarkBasedTransformInitializer<TTransform, TFixedImage, TMovingImage>::Intern

// Set a pointSet from the input landmarks.
auto pointSet = PointSetType::New();
pointSet->Initialize();

PointsContainerConstIterator fixedIt = this->m_FixedLandmarks.begin();
PointsContainerConstIterator movingIt = this->m_MovingLandmarks.begin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ typename LabeledPointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInt
GetLabeledFixedPointSet(const LabelType label) const
{
auto fixedPointSet = FixedPointSetType::New();
fixedPointSet->Initialize();

typename FixedPointSetType::PointIdentifier count{};

Expand All @@ -156,7 +155,6 @@ typename LabeledPointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInt
GetLabeledMovingPointSet(const LabelType label) const
{
auto movingPointSet = MovingPointSetType::New();
movingPointSet->Initialize();

typename MovingPointSetType::PointIdentifier count{};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ typename BSplineSyNImageRegistrationMethod<TFixedImage, TMovingImage, TOutputTra
}

auto gradientPointSet = BSplinePointSetType::New();
gradientPointSet->Initialize();

if (fixedPointSets[0]->GetNumberOfPoints() > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ ImageRegistrationMethodv4<TFixedImage, TMovingImage, TTransform, TVirtualImage,
for (SizeValueType n = 0; n < numberOfLocalMetrics; ++n)
{
auto samplePointSet = MetricSamplePointSetType::New();
samplePointSet->Initialize();

using SamplePointType = typename MetricSamplePointSetType::PointType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,10 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod<TFixedImage,

// Keep track of velocityFieldPointSet from the previous iteration
VelocityFieldPointSetPointer velocityFieldPointSetFromPreviousIteration = VelocityFieldPointSetType::New();
velocityFieldPointSetFromPreviousIteration->Initialize();

VelocityFieldPointSetPointer velocityFieldPointSet = VelocityFieldPointSetType::New();
velocityFieldPointSet->Initialize();

auto velocityFieldWeights = WeightsContainerType::New();
velocityFieldWeights->Initialize();

// Monitor the convergence
using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction<RealType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ BayesianClassifierInitializationImageFilter<TInputImage, TProbabilityPrecisionTy
covarianceEstimatorsContainer->Reserve(m_NumberOfClasses);

m_MembershipFunctionContainer = MembershipFunctionContainerType::New();
m_MembershipFunctionContainer->Initialize(); // Clear elements
for (unsigned int i = 0; i < m_NumberOfClasses; ++i)
{
meanEstimatorsContainer->InsertElement(i, new typename GaussianMembershipFunctionType::MeanVectorType(1));
Expand Down