MHubAI / models

Stores the MHub models dockerfiles and scripts.
MIT License
8 stars 16 forks source link

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

Closed ccosmin97 closed 8 months ago

ccosmin97 commented 11 months ago

Adding template for PR request

ccosmin97 commented 11 months ago

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 commented 11 months ago

The meta information seems all correct to me.

LennyN95 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

/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) ```yaml 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 ```
ccosmin97 commented 8 months ago

@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?

LennyN95 commented 8 months ago

@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!