Pancreas segmentation in UK Biobank VIBE data, using the PyTorch implementation of UNet from Project MONAI.
Example VIBE (left), manual annotation (middle), model prediction (right)
Creating a conda environment is recommended.
pip install requirements.txt
You may download a trained model here and make segmentation predictions using predict.py.
From the installed python environment, run:
python predict.py --filename YYYYYYY.nii.gz --model trained_model.pth --output YYYYYYY-seg.nii.gz
Data needs to be organised in the file structure below. Run data.py to see dataset examples.
In order to train a model, optionally change the parameters in params.py and then run train.py.
├── data
│ ├── imgs
│ │ ├── AAAAAAA.nii.gz
│ │ ├── BBBBBBB.nii.gz
│ │ ├── CCCCCCC.nii.gz
│ │ ├── DDDDDDD.nii.gz
│ │ └── EEEEEEE.nii.gz
│ └── masks
│ ├── AAAAAAA-seg.nii.gz
│ ├── BBBBBBB-seg.nii.gz
│ ├── CCCCCCC-seg.nii.gz
│ ├── DDDDDDD-seg.nii.gz
│ └── EEEEEEE-seg.nii.gz
TensorBoard may be used to log training, via
tensorboard --logdir=runs
- A. T. Bagur, G. Ridgway, J. McGonigle, S. M. Brady, and D. Bulte, “Pancreas Segmentation-Derived Biomarkers: Volume and Shape Metrics in the UK Biobank Imaging Study,” in Communications in Computer and Information Science, vol. 1248 CCIS, 2020, pp. 131–142.
Paper
Conference Presentation