Skip to content

Conversation

@MMelQin
Copy link
Collaborator

@MMelQin MMelQin commented Oct 7, 2025

This Pull Request is to ensure the volume image have consistent affine and space metadata after it is converted from DICOM instances.

  • As described in [BUG] Examples using older MONAI Bundles not compatible with MONAI v1.5.1 (which reveals errors in older MONAI bundles) #557 , the affine derived from the DICOM metadata had been switched to be in RAS+ space to be more aligned with the norm of MONAI models/bundles, while the original orientation from the DICOM Image Orientation Patient metadata is in LPS+.

  • The resulting space metadata for the converted image was then supposedly to be switched to RAS from LPS, but was inadvertently missed due partly to the fact that this metadata was ignored in the MONAI Orientation transform in v1.5.0 and below. Now with MONAI v1.5.1 parsing and using this data, this inconsistency causes image flipping issues.

So

  • the key changes in this PR is to make affine and space consistent
  • expand the support to the latest Holoscan SDK, CUDA 12 version
  • other changes are to revert the workarounds, fix linting complaints, and update docs build to use Python >= v3.10

Test result:
Changes were tested by running the example apps and Jupyter notebook.

@MMelQin MMelQin requested a review from Copilot October 7, 2025 01:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out dated

@MMelQin MMelQin changed the title [WIP] Make affine and space consistent and correct on converting DICOM image to volume image [WIP] Make affine and space metadata consistent as MONAI Orientation transform consumes both correctly now Oct 29, 2025
@MMelQin MMelQin requested a review from Copilot October 29, 2025 22:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MMelQin MMelQin requested a review from Copilot October 30, 2025 00:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MMelQin MMelQin changed the title [WIP] Make affine and space metadata consistent as MONAI Orientation transform consumes both correctly now Make affine and space metadata consistent as well as updating support of latest holoscan SDK CUDA 12 version Oct 30, 2025
@sonarqubecloud
Copy link

@MMelQin MMelQin merged commit f4c1ba4 into main Oct 30, 2025
5 checks passed
MMelQin added a commit that referenced this pull request Oct 31, 2025
… of latest holoscan SDK CUDA 12 version (#565)

* Make affine and space consistent as space is properly parse by MONAI transforms

Signed-off-by: M Q <[email protected]>

* Typing improvements

Signed-off-by: M Q <[email protected]>

* Make image metadata Affine and Space consistent, either LPS or RAS

Signed-off-by: M Q <[email protected]>

* Update monai/deploy/operators/monai_seg_inference_operator.py

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ming M Qin <[email protected]>

* Correct CoPilot suggested code which failed liniting

Signed-off-by: M Q <[email protected]>

* Fix complaint from new version of mypy

Signed-off-by: M Q <[email protected]>

* Support the latest holoscan SDK CUDA 12 version, holoscan-cu12

Signed-off-by: M Q <[email protected]>

* Docs gen works with Python 3.10+

Signed-off-by: M Q <[email protected]>

* Fix complaints on single quote vs dhouble quote for string

Signed-off-by: M Q <[email protected]>

* Making docs gen require python >= 3.10

Signed-off-by: M Q <[email protected]>

* Fix docs build error on readthedocs, although local builds had no issues

Signed-off-by: M Q <[email protected]>

---------

Signed-off-by: M Q <[email protected]>
Signed-off-by: Ming M Qin <[email protected]>
Co-authored-by: Copilot <[email protected]>
MMelQin added a commit that referenced this pull request Oct 31, 2025
)

* Initial code for making a RESTful miscroservice with MONAI App SDK

Signed-off-by: M Q <[email protected]>

* Removed operator local fix and use newly released MONAI App SDK v3.5.1 release

Signed-off-by: M Q <[email protected]>

* Removed local copy of operator that had a temp fix

Signed-off-by: M Q <[email protected]>

* Add proper callback message

Signed-off-by: M Q <[email protected]>

* Proper json string and security fix

Signed-off-by: M Q <[email protected]>

* Fix complaints

Signed-off-by: M Q <[email protected]>

* Updated readme

Signed-off-by: M Q <[email protected]>

* Update per review comments

Signed-off-by: M Q <[email protected]>

* More update

Signed-off-by: M Q <[email protected]>

* Set header

Signed-off-by: M Q <[email protected]>

* Added packaging and running MAP of the REST service

Signed-off-by: M Q <[email protected]>

* Add app.yaml that has missed the checkin

Signed-off-by: M Q <[email protected]>

* pin monai<=1.5.0 for now as 1.5.1 has breaking changes

Signed-off-by: M Q <[email protected]>

* Add CCHMC nnUNet fifteen checkpoint application example

Signed-off-by: Elan Somasundaram <[email protected]>
Signed-off-by: chezhia <[email protected]>

* Update README documentation

Signed-off-by: Elan Somasundaram <[email protected]>
Signed-off-by: chezhia <[email protected]>

* flake8 fixed

Signed-off-by: chezhia <[email protected]>

* all tests pass

Signed-off-by: chezhia <[email protected]>

* Make affine and space metadata consistent as well as updating support of latest holoscan SDK CUDA 12 version (#565)

* Make affine and space consistent as space is properly parse by MONAI transforms

Signed-off-by: M Q <[email protected]>

* Typing improvements

Signed-off-by: M Q <[email protected]>

* Make image metadata Affine and Space consistent, either LPS or RAS

Signed-off-by: M Q <[email protected]>

* Update monai/deploy/operators/monai_seg_inference_operator.py

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ming M Qin <[email protected]>

* Correct CoPilot suggested code which failed liniting

Signed-off-by: M Q <[email protected]>

* Fix complaint from new version of mypy

Signed-off-by: M Q <[email protected]>

* Support the latest holoscan SDK CUDA 12 version, holoscan-cu12

Signed-off-by: M Q <[email protected]>

* Docs gen works with Python 3.10+

Signed-off-by: M Q <[email protected]>

* Fix complaints on single quote vs dhouble quote for string

Signed-off-by: M Q <[email protected]>

* Making docs gen require python >= 3.10

Signed-off-by: M Q <[email protected]>

* Fix docs build error on readthedocs, although local builds had no issues

Signed-off-by: M Q <[email protected]>

---------

Signed-off-by: M Q <[email protected]>
Signed-off-by: Ming M Qin <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Mq/release 3.3 (#567)

* Update release notes for v3.3.0

Signed-off-by: M Q <[email protected]>

* Update the index file

Signed-off-by: M Q <[email protected]>

* Bump version: 3.2.0 → 3.3.0

Signed-off-by: M Q <[email protected]>

---------

Signed-off-by: M Q <[email protected]>

* Use string enum for status

Signed-off-by: M Q <[email protected]>

* Fix the lovely formatting complaint

Signed-off-by: M Q <[email protected]>

---------

Signed-off-by: M Q <[email protected]>
Signed-off-by: Elan Somasundaram <[email protected]>
Signed-off-by: chezhia <[email protected]>
Signed-off-by: Ming M Qin <[email protected]>
Co-authored-by: Elan Somasundaram <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

[BUG] Examples using older MONAI Bundles not compatible with MONAI v1.5.1 (which reveals errors in older MONAI bundles)

2 participants