-
Notifications
You must be signed in to change notification settings - Fork 54
Minor updates to ensure compatibility with HSDK v3.5.0 #549
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
Conversation
Min Python version is now 3.10 Use of NumPy can_cast with Python type is removed Update the DICOM series to volume image to use pydicom apply_rescale directly Tested Jupyter notebooks (using locally built SDK for monai-deploy package command) Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
The doc build requirements need to be fully examined and updated in another PR Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
…float64. In the last version, rescale slope and intercept values were tried to cast to the smallest can_cast Nunpy type. Using pydicom apply_rescale loses this as it returns float64 if rescale slope and intercept are applied. So, enhancing the code will test for equivalence before "unsafely" casting the data. This will NOT reduce the mem usage of this operator as a new array will be created by casting from float64, and there is a small overhead for the checks. However, there are cases where downstream custom operators may save memory footprint. Signed-off-by: M Q <[email protected]>
…rry to min size. Signed-off-by: M Q <[email protected]>
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.
Pull Request Overview
This PR updates the MONAI Deploy App SDK to ensure compatibility with HSDK v3.5.0, addressing Python version requirements and NumPy API changes. The changes focus on maintaining compatibility while resolving deprecation issues.
- Updates Python version requirements from >=3.9 to >=3.9,<3.14 and documentation examples to use Python 3.10
- Refactors DICOM series to volume operator to use pydicom's apply_rescale function directly instead of deprecated NumPy can_cast with Python types
- Improves memory efficiency by pre-allocating volume arrays and using pydicom utilities for pixel data processing
Reviewed Changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
setup.cfg | Updates Python version constraint to support up to 3.13 |
monai/deploy/operators/dicom_series_to_volume_operator.py | Major refactor to use pydicom utilities and improve memory efficiency |
README.md | Updates Python version requirement documentation |
docs/source/getting_started/tutorials/*.md | Updates tutorial setup instructions from Python 3.9 to 3.10 |
Signed-off-by: M Q <[email protected]>
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. For the DSTVO, essentially just outsourcing the existing logic to the pydicom methods (which were previously being emulating) with improved memory usage and slice-by-slice checks.
Only minor suggestion (take it or leave it) would be to make the casting logs ("Rescaled pixel array can be safely cast to {datatype} with equivalence test."
) debug, or somehow consolidate them into a single log. That being said, it is nice to see the details of how the casting is occurring, so I think I would ultimately be fine keeping these as info logs.
Signed-off-by: M Q <[email protected]>
|
Uh oh!
There was an error while loading. Please reload this page.