-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
BUG: Move InputSpaceName, OutputSpaceName from Transform to Transform… #4734
BUG: Move InputSpaceName, OutputSpaceName from Transform to Transform… #4734
Conversation
067b56e
to
00456a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks Matt! It looks fine to me, to move those two data members from Of course I would have liked to see unit tests of the form: itk::TransformBase & transformBase = ...; // Arrange
transformBase.SetInputSpaceName(exampleSpaceName); // Act
EXPECT_EQ(transformBase.GetInputSpaceName(), exampleSpaceName); // Assert Following the AAA pattern: Arrange-Act-Assert. Maybe to consider for a follow-up....? Update: I see now that such unit tests are already there (albeit in the old-style test framework, rather than my favorite GoogleTest), as added by @PranjalSahu: ITK/Modules/Core/Transform/test/itkTransformTest.cxx Lines 314 to 318 in 87bcabf
transform->SetInputSpaceName("test_inputspace");
ITK_TEST_EXPECT_EQUAL(std::string("test_inputspace"), transform->GetInputSpaceName());
transform->SetOutputSpaceName("test_outputspace");
ITK_TEST_EXPECT_EQUAL(std::string("test_outputspace"), transform->GetOutputSpaceName()); For this pull request, I think it would be sufficient to add transform->itk::TransformBase::SetInputSpaceName("test_inputspace");
ITK_TEST_EXPECT_EQUAL(std::string("test_inputspace"), transform->itk::TransformBase::GetInputSpaceName());
transform->itk::TransformBase::SetOutputSpaceName("test_outputspace");
ITK_TEST_EXPECT_EQUAL(std::string("test_outputspace"), transform->itk::TransformBase::GetOutputSpaceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little request! Please declare those two data members private! They were originally private
already!
Any consideration for putting these into the meta-data dictionary over member variables? Would we get serialization for free with any transform IO's if we did that? |
I guess, the question could be, are these "space names" fundamental general properties of any transform, or are they very much application specific? (In the latter case, I guess it would be better to have them as meta-data dictionary entries, rather than member variables.) Having said so, the decision was made already almost two years ago, by adding them to |
They could still have setter and getter member functions even if they are in the meta-data dictionary. It is more of a question if having them in the dictionary would make serialization easier. Yes, this question is incidental to the intent of this PR. |
…Base These were added to support features of the OME-Zarr transform proposals. However, they need to be available in itk::TransformBase instead of itk::Transform for access in TransformIO classes.
00456a6
to
107e3ad
Compare
Thanks for the reviews. @N-Dekker I added the extra coverage requested. Regarding metadata vs member, I think member is more appropriate in this case: this is an explicit property that we want all tooling / IO to eventually interpret and the explicit interface is helpful. In practice it is easier to work with, including for IO, when the explicit interface is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments, Matt! Approved 👍
0d8a535
into
InsightSoftwareConsortium:release-5.4
…Base
These were added to support features of the OME-Zarr transform proposals. However, they need to be available in itk::TransformBase instead of itk::Transform for access in TransformIO classes.