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

[feat] Add data_prep and dummy_model configurations for two BraTS 2024 challenges #609

Merged
merged 10 commits into from
Aug 20, 2024

Conversation

vpchung
Copy link
Contributor

@vpchung vpchung commented Aug 2, 2024

BraTS 2024 features two new challenges that requires new data_prep and dummy_model MLCubes:

  • BraTS-MEN-RT (Meningioma Radiotherapy)
  • BraTS-Path (Pathology)

Specifically, BraTS-MEN-RT will only contain a single modality for the data (t1c) and will use gtv as the labels; BraTS-Path will contain a single directory of PNG files as the data and will use a single 2-column CSV as the labels.

Changelog

  • update prepare.py to handle the raw data of BraTS-MEN-RT and BraTS-Path
  • update sanity_check.py to assert the expectations mentioned above ^
  • update infer.py to output a 2-column CSV for BraTS-Path (minor changes needed for BraTS-MEN-RT, e.g. using underscore instead of a dash in the filenames)
  • add pandas and numpy to dummy model requirements
  • update mlcube.yaml files
  • add project code for mock metrics (for the compatibility test)
  • add project code for mock data prep (for the compatibility test)

Preview

BraTS-MEN-RT

Prepare the raw data

$ python data_prep/project/mlcube.py prepare \
  --data_path ~/brats2024-sample-data/BraTS-MEN-RT/ \
  --labels_path ~/brats2024-sample-data/BraTS-MEN-RT/ \
  --output_path test_data \
  --output_labels_path test_labels \
  --parameters_file data_prep/mlcube/workspace/parameters-rt.yaml 
$
$ tree test_*
test_data
├── BraTS-MEN-RT-xxxx-x
│   └── BraTS-MEN-RT-xxxx-x_t1c.nii.gz
├── BraTS-MEN-RT-yyyy-y
│   └── BraTS-MEN-RT-yyyy-y_t1c.nii.gz
└── BraTS-MEN-RT-zzzz-z
    └── BraTS-MEN-RT-zzzz-z_t1c.nii.gz
test_labels
├── BraTS-MEN-RT-xxxx-x_gtv.nii.gz
├── BraTS-MEN-RT-yyyy-y_gtv.nii.gz
└── BraTS-MEN-RT-zzzz-z_gtv.nii.gz

Validate the prepared data

$ python data_prep/project/mlcube.py sanity_check \
  --data_path test_data/ \
  --labels_path test_labels/ \
  --parameters_file data_prep/mlcube/workspace/parameters-rt.yaml 
$

Run dummy model

$ python dummy_model/project/mlcube.py infer \
  --data_path test_data/ \
  --parameters_file dummy_model/mlcube/workspace/parameters-rt.yaml \
  --output_path test_predictions/
$
$ tree test_predictions
test_predictions
├── BraTS-MEN-RT-xxxx-x.nii.gz
├── BraTS-MEN-RT-yyyy-y.nii.gz
└── BraTS-MEN-RT-zzzz-z.nii.gz

BraTS-Path

Prepare the raw data

$ python data_prep/project/mlcube.py prepare \
  --data_path ~/brats2024-sample-data/BraTS-Path/ \
  --labels_path ~/brats2024-sample-data/BraTS-Path/ \
  --output_path test_data \
  --output_labels_path test_labels \
  --parameters_file data_prep/mlcube/workspace/parameters-path.yaml 
$
$ tree test_*
test_data
├── BraTSPath_cohort_xxxxxxx.png
├── BraTSPath_cohort_yyyyyyy.png
└── BraTSPath_cohort_zzzzzzz.png
test_labels
└── BraTS-PATH-cohort-Labels.csv

Validate the prepared data

$ python data_prep/project/mlcube.py sanity_check \
  --data_path test_data/ \
  --labels_path test_labels/ \
  --parameters_file data_prep/mlcube/workspace/parameters-path.yaml 
$

Run dummy model

$ python dummy_model/project/mlcube.py infer \
  --data_path test_data/ \
  --parameters_file dummy_model/mlcube/workspace/parameters-path.yaml \
  --output_path test_predictions/
$
$ cat test_predictions/predictions.csv
SubjectID,Prediction
BraTSPath_cohort_xxxxxxx.png,A
BraTSPath_cohort_yyyyyyy.png,B
BraTSPath_cohort_zzzzzzz.png,C

where A, B, and C are integers from 0 to 5.

@vpchung vpchung requested a review from a team as a code owner August 2, 2024 09:22
@vpchung vpchung had a problem deploying to testing-external-code August 2, 2024 09:22 — with GitHub Actions Failure
Copy link
Contributor

github-actions bot commented Aug 2, 2024

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@vpchung vpchung had a problem deploying to testing-external-code August 3, 2024 22:08 — with GitHub Actions Failure
hasan7n
hasan7n previously approved these changes Aug 4, 2024
@hasan7n hasan7n had a problem deploying to testing-external-code August 4, 2024 19:29 — with GitHub Actions Failure
@hasan7n hasan7n had a problem deploying to testing-external-code August 20, 2024 22:46 — with GitHub Actions Failure
@hasan7n hasan7n merged commit 7348aca into mlcommons:main Aug 20, 2024
5 of 6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants