Project-MONAI / Project-MONAI/model-zoo

Spleen CT Segmentation bundle need to stop using the flipped images (in LPS but passed as in RAS) from Medical Decathlon as input

Open
#766 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
338
Forks
106
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
In the inference config of the Spleen CT seg bundle, dataset from the Medical Decathlon is still used as input images.

It had been known years ago when the initial versions of the segmentation models trained with the Medical Decathlon dataset came about, that their images are flipped. More specifically, the images are in LPS+ patient anatomical space, but the orientations are the same as if RAS+.

With Slicer, load one of their image files and inspect the IJKtoRASDirections, all positive/identity matrix but the image is LPS anatomically. Load a DICOM series from TCIA, or a properly converted NIfTI file from a DICOM series, and then see the same value also with the image in LPS+ anatomically.

Better yet, follow the README and run the inference, and then see the bad segmentation result.

To Reproduce
Steps to reproduce the behavior:

Follow the README and run the inference with the Medical Decathlon images as specified in the inference config JSON.

Alternative, inspect the said input images in Slicer or similar tools and compare to a known good DICOM series or NIfTI image file

Expected behavior

The inference config pre-processing Orientation transform had been corrected some time ago, and works with known good NIfTI images converted from "production" DICOM CT from TCIA, and input images should have been changed to good ones so that the segmentation result is as expected.

Screenshots

Image

Environment

================================
Printing MONAI config...
================================
MONAI version: 1.5.1
Numpy version: 2.2.6
Pytorch version: 2.8.0+cu128
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 9c6d819f97e37f36c72f3bdfad676b455bd2fa0d
MONAI __file__: /home/<username>/src/md-app-sdk/.venv/lib/python3.10/site-packages/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: NOT INSTALLED or UNKNOWN VERSION.
Nibabel version: 5.3.2
scikit-image version: 0.25.2
scipy version: 1.15.3
Pillow version: 11.3.0
Tensorboard version: NOT INSTALLED or UNKNOWN VERSION.
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: NOT INSTALLED or UNKNOWN VERSION.
tqdm version: NOT INSTALLED or UNKNOWN VERSION.
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 7.1.0
pandas version: NOT INSTALLED or UNKNOWN VERSION.
einops version: NOT INSTALLED or UNKNOWN VERSION.
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
System: Linux
Linux version: Ubuntu 22.04.5 LTS
Platform: Linux-6.5.0-45-generic-x86_64-with-glibc2.35
Processor: x86_64
Machine: x86_64
Python version: 3.10.12
Process name: python
Command: ['python', '-c', 'import monai; monai.config.print_debug_info()']
Open files: [popenfile(path='/home/mqin/.cursor-server/data/logs/20251003T112744/ptyhost.log', fd=19, position=7808, mode='a', flags=33793), popenfile(path='/home/mqin/.cursor-server/data/logs/20251003T112744/remoteagent.log', fd=22, position=27482, mode='a', flags=33793)]
Num physical CPUs: 6
Num logical CPUs: 12
Num usable CPUs: 12
CPU usage (%): [43.5, 60.1, 33.5, 33.7, 38.5, 33.3, 28.4, 33.6, 25.3, 30.1, 30.1, 37.2]
CPU freq. (MHz): 2317
Load avg. in last 1, 5, 15 mins (%): [66.5, 53.6, 43.9]
Disk usage (%): 86.3
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 31.0
Available memory (GB): 14.0
Used memory (GB): 17.0

================================
Printing GPU config...
================================
Num GPUs: 1
Has CUDA: True
CUDA version: 12.8
cuDNN enabled: True
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None
cuDNN version: 91002
Current device: 0
Library compiled for CUDA architectures: ['sm_70', 'sm_75', 'sm_80', 'sm_86', 'sm_90', 'sm_100', 'sm_120']
GPU 0 Name: NVIDIA RTX 6000 Ada Generation
GPU 0 Is integrated: False
GPU 0 Is multi GPU board: False
GPU 0 Multi processor count: 142
GPU 0 Total memory (GB): 47.4
GPU 0 CUDA capability (maj.min): 8.9

Additional context
All other segmentation models trained with the same dataset suffer from the same issue, if Orientation is in pre-processing transform.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with models/spleen_ct_segmentation/configs/inference.json at the linked input-image entry, then follow its README inference steps. Compare the configured Medical Decathlon images with a known-good DICOM-derived NIfTI in Slicer or a similar tool. Done means the bundle no longer uses the flipped inputs and inference produces the expected segmentation; check whether the additional segmentation models mentioned are in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.