CIL
CIL copied to clipboard
Remove empty dimensions from DataContainer array
Changes
- When passed a
numpy.ndarray
AcquisitionData
andImageData
now remove dimensions of 1 from the numpy meta data before passing toDataContainer
. This matchesAcquisitionGeometry
andImageGeometry
-
ImageData
andAcquisitionData
compare squeezed array shape with geometry, which does not report 1's in shape. -
DataContainer.(fill)
removes shape check fornumpy.ndarray
and relies on numpy raiseing the error. Note:np.copyto
does not care about singleton dimensions. - FBP unittests updated to test reconstruction of a single slice (where bug was initially reported)
- Added unittests on
ImageData
andAcquisitionData
for initialisation and filling.
Testing you performed
Please add any demo scripts to https://github.com/TomographicImaging/CIL-Demos/tree/main/misc
Tested on example code in issue.
Related issues/links
closes #1884
Checklist
- [x] I have performed a self-review of my code
- [x] I have added docstrings in line with the guidance in the developer guide
- [x] I have updated the relevant documentation
- [x] I have implemented unit tests that cover any new or modified functionality
- [x] CHANGELOG.md has been updated with any functionality change
- [x] Request review from all relevant developers
- [x] Change pull request label to 'Waiting for review'
Contribution Notes
Please read and adhere to the developer guide and local patterns and conventions.
- [x] The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
- [x] I confirm that the contribution does not violate any intellectual property rights of third parties