Skip to content
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

MHUB/IDC - Implementing the Prostate158 whole prostate gland segmentation model available in MONAI (T2 only) #71

Merged
merged 10 commits into from
Mar 6, 2024

Conversation

ccosmin97
Copy link
Contributor

Adding template for PR request

@ccosmin97 ccosmin97 marked this pull request as ready for review December 15, 2023 22:43
@ccosmin97
Copy link
Contributor Author

I finished the implementation of the prostate158 model in mhub.ai configuration. Generated outputs are conform with my study.

Instructions for testing can be found here -- .md file.
Input data is here -- test_data.zip and output data -- monai_prostate158.zip is here. Testing sample size is one serieUID only -- although that can be changed easily if deemed necessary for testing.

@kbressem The meta information for the model is located here. The default workflow applies the same center-cropping strategy as defined in the prostate158 model training process. For DICOM SEG conversion purposes, the output segmentation file is padded back to the original (pre-centering) image size. This center-cropping strategy is a parameter of the Prostate158Runner, and can be changed to False.

@LennyN95 Please let me know whenever you have a minute if my testing procedure is enough or needs to be extended/modified, thank you!

@kbressem
Copy link

The meta information seems all correct to me.

Copy link
Member

@LennyN95 LennyN95 left a comment

Choose a reason for hiding this comment

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

Looking good overall. Some small issues to be adressed.

models/monai_prostate158/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
models/monai_prostate158/utils/Prostate158Runner.py Outdated Show resolved Hide resolved
models/monai_prostate158/utils/Prostate158Runner.py Outdated Show resolved Hide resolved
models/monai_prostate158/utils/Prostate158Runner.py Outdated Show resolved Hide resolved
models/monai_prostate158/utils/Prostate158Runner.py Outdated Show resolved Hide resolved
removed commented code
delete center_crop = True argument, since its enabled by default

renamed model_name in DsegConverter
added external evaluation tables and references
Copy link
Contributor Author

@ccosmin97 ccosmin97 left a comment

Choose a reason for hiding this comment

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

reviewed changes.

models/monai_prostate158/config/default.yml Outdated Show resolved Hide resolved
models/monai_prostate158/config/default.yml Outdated Show resolved Hide resolved
models/monai_prostate158/meta.json Outdated Show resolved Hide resolved
models/monai_prostate158/meta.json Outdated Show resolved Hide resolved
changed seg output name and added '%Modality' filter
added license information
Copy link
Contributor Author

@ccosmin97 ccosmin97 left a comment

Choose a reason for hiding this comment

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

reviewed changes and added/modified model code based on @LennyN95 suggestions.

@LennyN95
Copy link
Member

LennyN95 commented Mar 4, 2024

Looking good. @ccosmin97 shall we proceed with testing? If you feel ready, you can create a /test comment as described in our documentation here.

@ccosmin97
Copy link
Contributor Author

Looking good. @ccosmin97 shall we proceed with testing? If you feel ready, you can create a /test comment as described in our documentation here.

Ok thanks @LennyN95 I will provide testing results later today.

@ccosmin97
Copy link
Contributor Author

ccosmin97 commented Mar 5, 2024

/test

sample:
  idc_version: 17.0
  data:
  - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7311.5101.117787454837907188090392680606
    aws_url: s3://idc-open-data/4a15953b-3e16-4aa3-beb3-53187d84b6ed/*
    path: dicom

reference:
  url: https://www.dropbox.com/scl/fi/j6ouks1vqfeofaek8n3dk/output.zip?rlkey=y0p4b9pi2ot099iyxcjiqpdoj&dl=0

Test Results (24.03.06_09.47.47_ROPNerVqB9)
id: a09b9f72-406f-47dd-bd38-ab883380bc8b
date: '2024-03-06 09:51:53'
checked_files:
- file: monai_prostate158.seg.dcm
  path: /app/test/src/1.3.6.1.4.1.14519.5.2.1.7311.5101.117787454837907188090392680606/monai_prostate158.seg.dcm
  checks:
  - checker: DicomsegContentCheck
    notes:
    - label: Segment Count
      description: The number of segments identified in the inspected dicomseg file.
      info: 2
summary:
  files_missing: 0
  files_extra: 0
  checks:
    DicomsegContentCheck:
      files: 1
conclusion: true

@github-actions github-actions bot added the INVALID TEST REQUEST The contributor requested a test but the test block is not valid. label Mar 5, 2024
@ccosmin97
Copy link
Contributor Author

@LennyN95

FYI
trying to run the mhub prostate158_model as suggested here
https://github.com/MHubAI/documentation/blob/main/documentation/mhub_contribution/testing_phase.md
by:
MHUB_OUTPUT_DIR=/path/to/your/output/folder
docker run dev/$MHUB_MODEL_NAME:latest -v /path/to/your/sample/data:/app/data/input_data:ro -v $MHUB_OUTPUT_DIR:/app/data/output_data
fails.

However, running:
docker run -it --rm --network=none -v /home/exouser/Documents/mhub_exps/prostate_158/idc_data/dicom_data/subject_1:/app/data/input_data:ro -v /home/exouser/Documents/mhub_exps/prostate_158/mhub_out/out_subject_1:/app/data/output_data --entrypoint bash dev/monai_prostate158:latest
then
mhub.run default
produces the correct output, i.e the one I tested and documented above.

Any idea why this is happening? A mistake on my end?

@github-actions github-actions bot added TEST REQUESTED and removed INVALID TEST REQUEST The contributor requested a test but the test block is not valid. labels Mar 5, 2024
@LennyN95
Copy link
Member

LennyN95 commented Mar 6, 2024

@ccosmin97 The docker-image needs to be declared after all docker run arguments. Any argument after the image name will be passed to the entry point (mhub.run by default).

The syntax is: docker run [docker run args] mhubai/$model_name:latest [mhub.run arrgs] where [docker run args] usually are the input and output volume mounts (-v /local/abs/path/:/app/data/input_data) and --rm -t --gpus all to remove the container after execution, stream output to the console and make all GPUs accessible to the container. [mhub.run arrgs] then can be, e.g., --workflow default to specify a workflow or --debug to enable debug mode (all available options are shown when passing --help).

Note that when performing a test run, there must be no mhub.run argument set!

@LennyN95 LennyN95 merged commit f7f1d6f into MHubAI:main Mar 6, 2024
1 check passed
@fedorov fedorov mentioned this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants