-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix bug with show2D and 3D DataContainers #1539
Conversation
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.
Looks good.
If I understand correctly, the other way to fix the bug could have been to allow the data container get slice to take the force=True
kwarg without raising an error. For the ImageData and AquisitionData case, the force kwarg is used when setting the geometry for the new slice. However, this is not needed for the DataContainer as we do not require a geometry to initiatise a VectorData or DataContainer. Therefore we don't need a force
kwarg in the DataContainer case?
Yes, that’s right. With Acquisition/ImageData it tries to create a new Acquisition/ImageGeometry and Data and if it can’t, if force is set to True then it returns a DataContainer instead. CIL/Wrappers/Python/cil/framework/framework.py Lines 3628 to 3638 in 5406f33
I can't see there's anything we can use 'force' for in the case of a DataContainer, so it doesn't make sense for get_slice to take that parameter |
Thanks @lauramurgatroyd - happy to approve |
Signed-off-by: Laura Murgatroyd <[email protected]>
Signed-off-by: Laura Murgatroyd <[email protected]>
Describe your changes
Fixes bug which wouldn't allow 3D DataContainers to be viewed with show2D.
Note, this was just a bug with DataContainers, not with ImageData or AcquisitionData
Describe any testing you have performed
Please add any demo scripts to CIL-Demos/misc/
Tested with a 3D datacontainer
I could not see that there are any unit tests for show2D?
Added unit tests checking
get_slice
with a DataContainer.Link relevant issues
Fixes #1536
Checklist when you are ready to request a review
Contribution Notes
Please read and adhere to the developer guide and local patterns and conventions.