The tutorials require a few dependencies, numpy, matplotlib, in addition to one of the two deep learning libraries. Individual tutorials may also require other libraries which will be specified in the readme.md in individual tutorial folders (see links below). Conda is recommended to manage the required dependencies.
It is not mandatory, in tutorials or assessed coursework, to use any specific development, package or environment management tools. However, technical support is available for the setups detailed in Development Environment.
Module tutorials are implemented in both TensorFlow and PyTorch.
Learning materials for TensorFlow for Medical Imaging are recommended in Learning TensorFlow for Medical Imaging.
Learning materials for PyTorch for Medical Imaging are recommended in Learning PyTorch for Medical Imaging.
To run the tutorial examples, follow the instruction below.
For the first time only, create a conda environment mphy0041
.
Note: some tutorials may need additional tools, please read readme.md in individual subfolder.
Next, activate the created mphy0041
environment:
conda activate mphy0041
Then, cd
to each individual tutorial subfolder as the working directory, e.g.:
cd tutorials/classification # e.g. `cd segmentation`
Usually, run the data.py
script first to download tutorial data:
python data.py
Run one of the training scripts:
python tf_train.py # train using TensorFlow 2
or
python pt_train.py # train using PyTorch
Visualise example data and (predicted) labels:
python visualise.py
Anatomical structure classification on 2D ultrasound images
Segmentation of organs on 3D MR images
Unsupervised registration of CT image slices
A list of tasks are detailed in the Formative Assessment. Complete them for individual tutorials.