Skip to content

ENH: Array, OptimizerParameters constructors with size and initial value#2248

Merged
dzenanz merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Array-OptimizerParameters-constructor-with-initial-value
Jan 11, 2021
Merged

ENH: Array, OptimizerParameters constructors with size and initial value#2248
dzenanz merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Array-OptimizerParameters-constructor-with-initial-value

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Added explicit constructors to Array and OptimizerParameters, allowing to specify the size (dimension) and the initial value of each element.

Both std::vector and vnl_vector have a similar constructor.

Included a GoogleTest unit test for OptimizerParameters.

Added explicit constructors to `Array` and `OptimizerParameters`, allowing to specify the size (dimension) and the initial value of each element.

Both `std::vector` and `vnl_vector` have a similar constructor.

Included a GoogleTest unit test for `OptimizerParameters`.
@N-Dekker N-Dekker marked this pull request as ready for review January 10, 2021 18:13
@N-Dekker
Copy link
Copy Markdown
Contributor Author

Thanks for your approval, Dženan!

@thewtex Matt, do you think that this pull request could still be included with ITK 5.2? I think it's pretty simple enhancement, but it could certainly make the use of OptimizerParameters easier. This is how I created a const OptimizerParameters variable of two elements for an elastix unit test with ITK 5.1:

const itk::OptimizerParameters<double> optimizerParameters(itk::Array<double>(vnl_vector<double>(2U, testValue)));  

https://github.com/SuperElastix/elastix/blob/b60640fe6e0ef002ca567768cce404573f0c0109/Common/GTesting/elxTransformIOGTest.cxx#L324

The pull request would allow, hopefully for ITK 5.2:

const itk::OptimizerParameters<double> optimizerParameters(2U, testValue);  

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Jan 11, 2021

This does not seem like a potentially problematic feature. #2246 might qualify for that. But we did not announce a feature freeze.

If you are not going to request more reviews, you could merge this PR Niels.

@N-Dekker
Copy link
Copy Markdown
Contributor Author

If you are not going to request more reviews, you could merge this PR Niels.

@dzenanz Thanks Dženan, could you please do the merge? I always prefer not to merge my own PRs, if possibly 😃 It looks nicer to me when there are two names with a commit (author + committer).

@dzenanz dzenanz merged commit 73ce4ca into InsightSoftwareConsortium:master Jan 11, 2021
@N-Dekker N-Dekker deleted the Array-OptimizerParameters-constructor-with-initial-value branch January 11, 2021 16:29
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 29, 2022
Using the `OptimizerParameters(const SizeValueType dimension, const ValueType & value)` constructor, which was added to ITK with pull request InsightSoftwareConsortium/ITK#2248 commit  InsightSoftwareConsortium/ITK@73ce4ca (merged on 11 January 2021).
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 29, 2022
Using the `OptimizerParameters(const SizeValueType dimension, const ValueType & value)` constructor, which was added to ITK with pull request InsightSoftwareConsortium/ITK#2248 commit  InsightSoftwareConsortium/ITK@73ce4ca (merged on 11 January 2021).
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2025
Follow-up to pull request InsightSoftwareConsortium#2248
commit 73ce4ca
"ENH: Array, OptimizerParameters constructors with size and initial value"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2025
Follow-up to pull request InsightSoftwareConsortium#2248
commit 73ce4ca
"ENH: Array, OptimizerParameters constructors with size and initial value"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2025
Follow-up to pull request InsightSoftwareConsortium#2248
commit 73ce4ca
"ENH: Array, OptimizerParameters constructors with size and initial value"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2025
Follow-up to pull request InsightSoftwareConsortium#2248
commit 73ce4ca
"ENH: Array, OptimizerParameters constructors with size and initial value"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Dec 16, 2025
Follow-up to pull request InsightSoftwareConsortium#2248
commit 73ce4ca
"ENH: Array, OptimizerParameters constructors with size and initial value"
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