-
Notifications
You must be signed in to change notification settings - Fork 18
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
SMIT CT Lung GTV segmentation model #108
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 🚀
- Can we avoid using conda and instead install all requirements with uv? Our base image comes with uv installed and a virtual environment set-up. However, it is suggested that you create your own virtual environment with uv, e.g.,
uv venv -p 3.10 .venv310
- The contents of the
meta.json
are used to populate the model card on our website under mhub.ai/models. The more information, the better. - To test-build the model and to move forward with our test routine, an mhub.toml file needs to be created.
|
||
WORKDIR ${WORK_DIR}/msk_smit_lung_gtv/src | ||
ENV WEIGHTS_URL=https://mskcc.box.com/shared/static/sf7jic4m2dk67413cipbbq6hddvhpj61.gz | ||
ENV CONDA_URL=https://mskcc.box.com/shared/static/d580gfjzzmt26v8klwp8pivb6wafomag.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this using a conda environment for dependencies?
We should avoid conda in open source projects due to it's licensing scheme.
I suggest we install all dependencies with uv (which comes with our base image), e.g., you could provide a pyproject.toml to make src installable or just provide a list with dependencies (like a requirements.txt) and install with uv pip install
.
{ | ||
"id": "", | ||
"name": "msk_smit_lung_gtv", | ||
"title": "CT Lung GTV SMIT Segmentation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does SMIT stand for :)?
"name": "msk_smit_lung_gtv", | ||
"title": "CT Lung GTV SMIT Segmentation", | ||
"summary": { | ||
"description": "GTV segmentation from CT scan", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be slightly longer, this is what the user sees on the website.
"description": "Segmentation of the lung GTV from NIfTI CT images.", | ||
"type": "Segmentation", | ||
"classes": [ | ||
"GTV" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment in SMITrunner.py.
"version": "1.0.0", | ||
"devteam": "", | ||
"authors": ["Jue Jiang, Harini Veeraraghavan"], | ||
"type": "it is a 3D Swin transformer based segmentation net", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just Segmentation
?
|
||
@IO.Instance() | ||
@IO.Input('scan', 'nifti:mod=ct', the='input ct scan') | ||
@IO.Output('gtv_mask', 'gtv_mask.nii.gz', 'nifti:mod=seg:model=SMIT:roi=GTV',data='scan', the='predicted lung gtv') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IO.Instance() | ||
@IO.Input('scan', 'nifti:mod=ct', the='input ct scan') | ||
@IO.Output('gtv_mask', 'gtv_mask.nii.gz', 'nifti:mod=seg:model=SMIT:roi=GTV',data='scan', the='predicted lung gtv') | ||
def task(self, instance: Instance, scan: InstanceData, gtv_mask: InstanceData) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input ct image is available under scan.abspath
, the segmentation mask generated by the model should be written or copied into gtv_mask.abspath
.
@IO.Output('gtv_mask', 'gtv_mask.nii.gz', 'nifti:mod=seg:model=SMIT:roi=GTV',data='scan', the='predicted lung gtv') | ||
def task(self, instance: Instance, scan: InstanceData, gtv_mask: InstanceData) -> None: | ||
|
||
workDir = os.path.join(os.environ['WORK_DIR'],'models','msk_smit_lung_gtv','src') # Needs to be defined in docker file as ENV WORK_DIR=path_to_dir e.g. /app/models/SMIT/workDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use pathlib
for all path concatenations to increase readability?
#condaEnvDir = os.path.join(wrapperInstallDir,'conda-pack') | ||
#condaEnvActivateScript = os.path.join(condaEnvDir, 'bin', 'activate') | ||
wrapperPath = os.path.join(workDir,'bash_run_SMIT_Segmentation.sh') | ||
load_weight_name = os.path.join(workDir,'trained_weights','model.pt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there multiple weights trained for this model architecture? Otherwise, I'd suggest we make this parameter fixed, to increase the readability.
} | ||
], | ||
"model": { | ||
"architecture": "Swin Transformer based segmentation, self-supervised pretrained with 10k CT data", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just Swin3D
?
@LennyN95 Thank you for the in-depth feedback! We're working to address the suggestions. I have an additional question: when we upload our test data to Zenodo (for the mhub.toml), should we refer to the mHub DOI# 13785615 or create a new DOI from an independent/new entry? |
I would recommend renaming the PR to "SMIT CT Lung GTV segmentation model" (or something similar). |
You're more than welcome. Thank you and your team for the great work.
@locastre We mainly use Zenodo for it's reproducible storage mechanism, so you can create a new DOI for your sample & reference. |
@locastre FYI; There are also some errors in the compliance check that need to be resolved:
|
Submitting the SMIT CT Lung GTV segmentation model for mHub