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: Use the new ITK 5.2 OptimizerParameters constructors #484

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

N-Dekker
Copy link
Member

Simplified the code by using these two explicit constructors, which are added with ITK 5.2:

OptimizerParameters(SizeValueType dimension, const ValueType & value);

OptimizerParameters(const ValueType * inputData, SizeValueType dimension);

Follow-up to pull request #475 commit 6803b26 "COMP: Upgrade ITK from v5.1.1 to v5.2.0"

Simplified the code by using these two `explicit` constructors, which are added with ITK 5.2:

    OptimizerParameters(SizeValueType dimension, const ValueType & value);

    OptimizerParameters(const ValueType * inputData, SizeValueType dimension);

Follow-up to pull request #475 commit 6803b26 "COMP: Upgrade ITK from v5.1.1 to v5.2.0"
@@ -56,13 +56,8 @@ StackTransform<TScalarType, NInputDimensions, NOutputDimensions>::SetParameters(
const NumberOfParametersType numSubTransformParameters = this->m_SubTransformContainer[0]->GetNumberOfParameters();
for (unsigned int t = 0; t < this->m_NumberOfSubTransforms; ++t)
{
// MS, \todo: the new itk::TransformParameters only have constructors taking 1 argument
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstaring This pull request finally fixes the \todo that you wrote many years ago 😃 The new (ITK 5.2) itk::OptmizerParameters does have a few more convenient constructors than before, including one that accepts a data pointer and a size as arguments! No need to use a temporary subarray anymore!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work and lgtm!

@N-Dekker N-Dekker merged commit 5680297 into develop Jun 23, 2021
@N-Dekker N-Dekker deleted the Use-new-ITK-5-2-OptimizerParameters-constructors branch June 23, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants