Skip to content

Correct the MONAI models' error in OrientationD pre-processing transforms from "RAS" to "LPS"#559

Merged
MMelQin merged 1 commit into
mainfrom
mq/monai_compatibility
Sep 30, 2025
Merged

Correct the MONAI models' error in OrientationD pre-processing transforms from "RAS" to "LPS"#559
MMelQin merged 1 commit into
mainfrom
mq/monai_compatibility

Conversation

@MMelQin
Copy link
Copy Markdown
Collaborator

@MMelQin MMelQin commented Sep 30, 2025

See detailed description in issue #557 .

The OrientationD in the Pre-processing transforms of the MONAI models that were trained with flipped DICOM CT images from Medical Decathlon contains error to transform the loaded DICOM images in LPS to RAS. Now, after the fix in monai v1.5.1 where input image's space metadata is properly parsed (MD App SDK sets it for loaded DICOM image as "LPS", but not labels) and affects the transform to RAS take effects, adverse that is, because before the image labels defaults to RAS and space not parsed.

Pull Request Overview
This PR corrects orientation transform parameters in MONAI-based medical imaging models to resolve compatibility issues with MONAI v1.5.1. The change addresses preprocessing errors that occurred after MONAI updated how image space metadata is parsed for DICOM CT images.

  • Updates OrientationD transform parameter from "RAS" to "LPS" across multiple operators
  • Fixes preprocessing pipeline compatibility with MONAI v1.5.1's improved space metadata parsing
  • Ensures consistent image orientation handling for DICOM images that are loaded with LPS space metadata

Verification and Validation
The updated Jupyter notebook in the pull request was used to test the updates with input DICOM CT Series downloaded from TCIA.

Signed-off-by: M Q <mingmelvinq@nvidia.com>
@MMelQin MMelQin requested a review from Copilot September 30, 2025 07:15
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
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

This PR corrects orientation transform parameters in MONAI-based medical imaging models to resolve compatibility issues with MONAI v1.5.1. The change addresses preprocessing errors that occurred after MONAI updated how image space metadata is parsed for DICOM CT images.

  • Updates OrientationD transform parameter from "RAS" to "LPS" across multiple operators
  • Fixes preprocessing pipeline compatibility with MONAI v1.5.1's improved space metadata parsing
  • Ensures consistent image orientation handling for DICOM images that are loaded with LPS space metadata

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
platforms/nuance_pin/app/inference.py Updated OrientationD axcodes parameter in preprocessing pipeline
examples/apps/cchmc_ped_abd_ct_seg_app/abdomen_seg_operator.py Updated OrientationD axcodes parameter for pediatric abdomen segmentation
examples/apps/ai_unetr_seg_app/unetr_seg_operator.py Updated OrientationD axcodes parameter for UNETR segmentation
examples/apps/ai_remote_infer_app/spleen_seg_operator.py Updated OrientationD axcodes parameter for spleen segmentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MMelQin MMelQin changed the title Correct the MONAI models' error in OrientationD to "RAS" Correct the MONAI models' error in OrientationD pre-processing transforms from "RAS" to "LPS" Sep 30, 2025
@MMelQin MMelQin merged commit a1c067b into main Sep 30, 2025
6 checks passed
@MMelQin MMelQin deleted the mq/monai_compatibility branch November 5, 2025 21:34
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.

2 participants