-
Notifications
You must be signed in to change notification settings - Fork 20
BAMF Lung and FDG-Avid Tumor #86
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
25c975f
create PET CT multi modality nnUnetRunner
jithenece 74232c5
Resampler module
jithenece 5167ae4
define flow
jithenece ec8ba04
use FDG_AVID_TUMOR entry
jithenece aa3d6d7
add meta information
jithenece 8dcbd53
update label info
jithenece ef8433a
fix entrypoint
jithenece b0024ed
Merge branch 'MHubAI:main' into bamf_nnunet_pet_ct_lung
jithenece 3660f06
update results stats
jithenece d118d3f
change post-processing logic
jithenece 3e84dd9
comments
jithenece ea50a98
format logic
jithenece 5a3ba63
rename the folder
jithenece 0f7bb8c
comments updated
jithenece f9e1456
use NiftiConverter
jithenece 670823d
fix review comments
jithenece 1f12571
update dcm2niix to fix conversion errors
jithenece c9b74f8
extract lung only segments from ts
jithenece effdccc
fix pip errors
jithenece d781beb
remove dcm2niix
jithenece a65489e
Merge branch 'MHubAI:main' into bamf_pet_ct_lung_tumor
jithenece 368654a
Merge branch 'MHubAI:main' into bamf_pet_ct_lung_tumor
jithenece 0f43346
Merge branch 'MHubAI:main' into bamf_pet_ct_lung_tumor
jithenece 3a4ee41
/test validation
jithenece 7223fee
Update Dockerfile
LennyN95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| general: | ||
| data_base_dir: /app/data | ||
| version: 1.0 | ||
| description: default configuration for Bamf NNUnet Lung and FDG-avid lesions in the lung from FDG PET/CT scans (dicom to dicom) | ||
|
|
||
| execute: | ||
| - FileStructureImporter | ||
| - module: NiftiConverter | ||
| in_datas: dicom:mod=ct | ||
| - module: NiftiConverter | ||
| in_datas: dicom:mod=pt | ||
| engine: dcm2niix | ||
| - Registration | ||
| - NNUnetPETCTRunner | ||
| - TotalSegmentatorMLRunner | ||
| - LungPostProcessor | ||
| - DsegConverter | ||
| - DataOrganizer | ||
|
|
||
| modules: | ||
| FileStructureImporter: | ||
| input_dir: 'input_data' | ||
| structures: | ||
| - $patientID@instance/ct@dicom:mod=ct | ||
| - $patientID/pt@dicom:mod=pt | ||
| import_id: patientID | ||
|
|
||
| NNUnetPETCTRunner: | ||
| in_ct_data: nifti:mod=ct:registered=true | ||
| in_pt_data: nifti:mod=pt | ||
| nnunet_task: Task762_PET_CT_Breast | ||
| nnunet_model: 3d_fullres | ||
| roi: LIVER,KIDNEY,URINARY_BLADDER,SPLEEN,LUNG,BRAIN,HEART,SMALL_INTESTINE,LUNG+FDG_AVID_TUMOR | ||
|
|
||
| TotalSegmentatorMLRunner: | ||
| in_data: nifti:mod=ct:registered=true | ||
| use_fast_mode: False | ||
LennyN95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| DsegConverter: | ||
| source_segs: nifti:mod=seg:processor=bamf | ||
| model_name: BAMF Lung and FDG Tumor Segmentation | ||
| target_dicom: dicom:mod=pt | ||
| skip_empty_slices: True | ||
|
|
||
| DataOrganizer: | ||
| targets: | ||
| - dicomseg-->[i:patientID]/bamf_pet_ct_lung_tumor.seg.dcm | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| FROM mhubai/base:latest | ||
|
|
||
| # FIXME: set this environment variable as a shortcut to avoid nnunet crashing the build | ||
| # by pulling sklearn instead of scikit-learn | ||
| # N.B. this is a known issue: | ||
| # https://github.com/MIC-DKFZ/nnUNet/issues/1281 | ||
| # https://github.com/MIC-DKFZ/nnUNet/pull/1209 | ||
| ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True | ||
|
|
||
| # Install nnunet and totalsegmentator | ||
| RUN pip3 install TotalSegmentator==1.5.7 nnunet==1.6.6 | ||
|
|
||
| # Clone the main branch of MHubAI/models | ||
| ARG MHUB_MODELS_REPO | ||
| RUN buildutils/import_mhub_model.sh bamf_pet_ct_lung_tumor ${MHUB_MODELS_REPO} | ||
|
|
||
| # Pull nnUNet model weights into the container for Task777_CT_Nodules | ||
| ENV WEIGHTS_DIR=/root/.nnunet/nnUNet_models/nnUNet/ | ||
| RUN mkdir -p $WEIGHTS_DIR | ||
| ENV TASK_NAME=Task762_PET_CT_Breast | ||
| ENV WEIGHTS_FN=$TASK_NAME.zip | ||
| ENV WEIGHTS_URL=https://zenodo.org/record/8290055/files/$WEIGHTS_FN | ||
| RUN wget --directory-prefix ${WEIGHTS_DIR} ${WEIGHTS_URL} --no-check-certificate | ||
| RUN unzip ${WEIGHTS_DIR}${WEIGHTS_FN} -d ${WEIGHTS_DIR} | ||
| RUN rm ${WEIGHTS_DIR}${WEIGHTS_FN} | ||
|
|
||
| # specify nnunet specific environment variables | ||
| ENV WEIGHTS_FOLDER=$WEIGHTS_DIR | ||
|
|
||
| # Default run script | ||
| ENTRYPOINT ["mhub.run"] | ||
| CMD ["--config", "/app/models/bamf_pet_ct_lung_tumor/config/default.yml"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| { | ||
| "id": "", | ||
| "name": "bamf_pet_ct_lung_tumor", | ||
| "title": "FDG PET/CT Lung and Lung Tumor Annotation", | ||
| "summary": { | ||
| "description": "An nnU-Net based model to segment Lung and FDG-avid lesions in the lung from FDG PET/CT scans", | ||
| "inputs": [ | ||
| { | ||
| "label": "Input Image", | ||
| "description": "The CT scan of a patient.", | ||
| "format": "DICOM", | ||
| "modality": "CT", | ||
| "bodypartexamined": "Lung", | ||
| "slicethickness": "5mm", | ||
| "non-contrast": true, | ||
| "contrast": false | ||
| }, | ||
| { | ||
| "label": "Input Image", | ||
| "description": "The PET scan of a patient.", | ||
| "format": "DICOM", | ||
| "modality": "PT", | ||
| "bodypartexamined": "Lung", | ||
| "slicethickness": "4mm", | ||
| "non-contrast": false, | ||
| "contrast": false | ||
| } | ||
| ], | ||
| "outputs": [ | ||
| { | ||
| "label": "Segmentation", | ||
| "type": "Segmentation", | ||
| "description": "Segmentation Lung and tumor", | ||
| "classes": [ | ||
| "LUNG", | ||
| "LUNG+FDG_AVID_TUMOR" | ||
| ] | ||
| } | ||
| ], | ||
| "model": { | ||
| "architecture": "U-net", | ||
| "training": "supervised", | ||
| "cmpapproach": "3D" | ||
| }, | ||
| "data": { | ||
| "training": { | ||
| "vol_samples": 1014 | ||
| }, | ||
| "evaluation": { | ||
| "vol_samples": 77 | ||
| }, | ||
| "public": true, | ||
| "external": true | ||
| } | ||
| }, | ||
| "details": { | ||
| "name": "AIMI PET CT Lung", | ||
| "version": "1.0.0", | ||
| "devteam": "BAMF Health", | ||
| "authors": [ | ||
| "Soni, Rahul", | ||
| "McCrumb, Diana", | ||
| "Murugesan, Gowtham Krishnan", | ||
| "Van Oss, Jeff" | ||
| ], | ||
| "type": "nnU-Net (U-Net structure, optimized by data-driven heuristics)", | ||
| "date": { | ||
| "code": "17.10.2023", | ||
| "weights": "28.08.2023", | ||
| "pub": "23.10.2023" | ||
| }, | ||
| "cite": "Murugesan, Gowtham Krishnan, Diana McCrumb, Mariam Aboian, Tej Verma, Rahul Soni, Fatima Memon, and Jeff Van Oss. The AIMI Initiative: AI-Generated Annotations for Imaging Data Commons Collections. arXiv preprint arXiv:2310.14897 (2023).", | ||
| "license": { | ||
| "code": "MIT", | ||
| "weights": "CC BY-NC 4.0" | ||
| }, | ||
| "publications": [ | ||
| { | ||
| "title": "The AIMI Initiative: AI-Generated Annotations in IDC Collections", | ||
| "uri": "https://arxiv.org/abs/2310.14897" | ||
| } | ||
| ], | ||
| "github": "https://github.com/bamf-health/aimi-lung-pet-ct" | ||
| }, | ||
| "info": { | ||
| "use": { | ||
| "title": "Intended Use", | ||
| "text": "This model is intended to perform lung and tumor segmentation in FDG PET CT scans. The model has been trained and tested on scans acquired during clinical care of patients, so it might not be suited for a healthy population. The generalization capabilities of the model on a range of ages, genders, and ethnicities are unknown. For detailed information on the training set design, please refer to reference section in the training section" | ||
| }, | ||
| "analyses": { | ||
| "title": "Quantitative Analyses", | ||
| "text": "Label-wise metrics (mean (standard deviation)) between AI derived and manual corrected FDG PET/CT lungs and tumor annotations.", | ||
| "tables": [ | ||
| { | ||
| "label": "Segmentation Metric Expert", | ||
| "entries": { | ||
| "Lung DSC": "1.00 (0.00) ", | ||
| "Tumor DSC": "0.97 (0.11) ", | ||
| "Lung 95% Hausdorff (mm)": "0.10 (0.58)", | ||
| "Tumor 95% Hausdorff (mm)": "5.83 (19.42) " | ||
| } | ||
| }, | ||
| { | ||
| "label": "Segmentation Metric Tumor - Non-Expert", | ||
| "entries": { | ||
| "Lung DSC": "0.99 (0.04)", | ||
| "Tumor DSC": "0.92 (0.20)", | ||
| "Lung 95% Hausdorff (mm)": "1.97 (10.50)", | ||
| "Tumor 95% Hausdorff (mm)": "10.00 (26.34)" | ||
| } | ||
| }, | ||
| { | ||
| "label": "Detection Accuracy", | ||
| "entries": { | ||
| "Sensitivity": "0.91", | ||
| "False negative rate": "0.09", | ||
| "F1 score": "0.94" | ||
| } | ||
| } | ||
| ], | ||
| "references": [ | ||
| { | ||
| "label": "The AIMI Initiative: AI-Generated Annotations for Imaging Data Commons Collections", | ||
| "uri": "https://arxiv.org/abs/2310.14897" | ||
| } | ||
| ] | ||
| }, | ||
| "evaluation": { | ||
| "title": "Evaluation Data", | ||
| "text": "The model was used to segment cases from the IDC [1] collection of ACRIN-NSCLC-FDG-PET [2], Anti-PD-1-Lung [3], LUNG-PET-CT-Dx[4], NSCLC Radiogenomics[5], RIDER Lung PET-CT[6], TCGA-LUAD[7], TCGA-LUSC[8] . Approximately 20% of those cases were randomly selected to be reviewed and corrected by a board-certified radiologist. The model predictions, and radiologist corrections are published on zenodo [9]", | ||
| "references": [ | ||
| { | ||
| "label": "Imaging Data Collections (IDC)", | ||
| "uri": "https://datacommons.cancer.gov/repository/imaging-data-commons" | ||
| }, | ||
| { | ||
| "label": "ACRIN-NSCLC-FDG-PET", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/acrin-nsclc-fdg-pet/" | ||
| }, | ||
| { | ||
| "label": "Anti-PD-1-Lung", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/anti-pd-1_lung/" | ||
| }, | ||
| { | ||
| "label": "LUNG-PET-CT-Dx", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/lung-pet-ct-dx/" | ||
| }, | ||
| { | ||
| "label": "NSCLC Radiogenomics", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/nsclc-radiogenomics/" | ||
| }, | ||
| { | ||
| "label": "RIDER Lung PET-CT", | ||
| "uri": "https://wiki.cancerimagingarchive.net/display/Public/RIDER+Collections" | ||
| }, | ||
| { | ||
| "label": "TCGA-LUAD", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/tcga-luad/" | ||
| }, | ||
| { | ||
| "label": "TCGA-LUSC", | ||
| "uri": "https://www.cancerimagingarchive.net/collection/tcga-lusc/" | ||
| }, | ||
| { | ||
| "label": "Image segmentations produced by the AIMI Annotations initiative", | ||
| "uri": "https://zenodo.org/records/10009368" | ||
| } | ||
| ] | ||
| }, | ||
| "training": { | ||
| "title": "Training Data", | ||
| "text": "The AutoPET Challenge 2023 dataset is comprised of whole-body FDG-PET/CT data from 900 patients, encompassing 1014 studies with tumor annotations. This dataset was augmented by adding labels for the bladder, kidneys, liver, stomach, spleen, lungs, and heart generated by the TotalSegmentator model. A multi-task AI model was trained using the augmented datasets", | ||
| "references": [ | ||
| { | ||
| "label": "AutoPET Challenge 2023 dataset", | ||
| "uri": "https://doi.org/10.7937/gkr0-xv29" | ||
| }, | ||
| { | ||
| "label": "Total Segmentator", | ||
| "uri": "https://doi.org/10.48550/arXiv.2208.05868" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.