Skip to content

Commit

Permalink
STYLE: Do not set GridSize when TransformIsStackTransform, in Metrics
Browse files Browse the repository at this point in the history
The GridSize is only relevant when the transform is _not_ a stack transform!
  • Loading branch information
N-Dekker committed Jul 1, 2024
1 parent fd2e462 commit 7259081
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
9 changes: 0 additions & 9 deletions Components/Metrics/PCAMetric/elxPCAMetric.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ PCAMetric<TElastix>::BeforeEachResolution()
/** Set itk member variable. */
this->SetTransformIsStackTransform(true);

if (const unsigned int numberOfSubTransforms{ stackTransform->GetNumberOfSubTransforms() };
numberOfSubTransforms > 0)
{
/** Check if subtransform is a B-spline transform. */
if (dynamic_cast<ReducedDimensionBSplineTransformBaseType *>(stackTransform->GetSubTransform(0).GetPointer()))
{
this->SetGridSize(FixedImageSizeType::Filled(numberOfSubTransforms));
}
}
// Return early, now that the current transform is a stack transform.
return;
}
Expand Down
9 changes: 0 additions & 9 deletions Components/Metrics/PCAMetric2/elxPCAMetric2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ PCAMetric2<TElastix>::BeforeEachResolution()
/** Set itk member variable. */
this->SetTransformIsStackTransform(true);

if (const unsigned int numberOfSubTransforms{ stackTransform->GetNumberOfSubTransforms() };
numberOfSubTransforms > 0)
{
/** Check if subtransform is a B-spline transform. */
if (dynamic_cast<ReducedDimensionBSplineTransformBaseType *>(stackTransform->GetSubTransform(0).GetPointer()))
{
this->SetGridSize(FixedImageSizeType::Filled(numberOfSubTransforms));
}
}
// Return early, now that the current transform is a stack transform.
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ SumOfPairwiseCorrelationCoefficientsMetric<TElastix>::BeforeEachResolution()
/** Set itk member variable. */
this->SetTransformIsStackTransform(true);

if (const unsigned int numberOfSubTransforms{ stackTransform->GetNumberOfSubTransforms() };
numberOfSubTransforms > 0)
{
/** Check if subtransform is a B-spline transform. */
if (dynamic_cast<ReducedDimensionBSplineTransformBaseType *>(stackTransform->GetSubTransform(0).GetPointer()))
{
this->SetGridSize(FixedImageSizeType::Filled(numberOfSubTransforms));
}
}
// Return early, now that the current transform is a stack transform.
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,6 @@ VarianceOverLastDimensionMetric<TElastix>::BeforeEachResolution()
/** Set itk member variable. */
this->SetTransformIsStackTransform(true);

if (const unsigned int numberOfSubTransforms{ stackTransform->GetNumberOfSubTransforms() };
numberOfSubTransforms > 0)
{
/** Check if subtransform is a B-spline transform. */
if (dynamic_cast<ReducedDimensionBSplineTransformBaseType *>(stackTransform->GetSubTransform(0).GetPointer()))
{
this->SetGridSize(FixedImageSizeType::Filled(numberOfSubTransforms));
}
}
// Return early, now that the current transform is a stack transform.
return;
}
Expand Down

0 comments on commit 7259081

Please sign in to comment.