Scikit-rt by examples

Jupyter notebooks are available that demonstrate scikit-rt functionality. These may be obtained through either of the following:

  1. Click on any of the notebook links given below. On the linked page, which shows the rendered notebook, click on the button marked Raw (top right, just above the notebook). Right click on the resulting code document, select Save As..., and save with extension .ipynb. (Some browsers may try to add the extension .txt.)

  2. Clone the scikit-rt repository:

    git clone https://github.com/scikit-rt/scikit-rt
    

    Navigate to the example notebooks, in the directory scikit-rt/examples/notebooks.

The scikit-rt installation includes both Jupyter Notebook and JupyterLab. With the environment for using scikit-rt activated, a downloaded notebook can be loaded with, for example:

jupyter lab path/to/notebook.ipynb

Notebooks using public datasets, or not requiring data

The following notebooks either use public datasets or don’t require input data. They can be run as they are, possibly after modifying paths to directories for copying data and saving outputs.

  • patient_datasets.ipynb : introduction to working with patient datasets.

  • plotting_demo.ipynb : plotting capabilities.

  • application_demo.ipynb : definition and running of a scikit-rt application, for (non-interactive) processing of datasets for multiple patients.

  • image_processing.ipynb : image cropping, resampling, translation, size matching, and intensity banding.

  • roi_algebra.ipynb : creating an ROI from a combination of ROIs, a difference between ROIs, or an intersection of ROIs.

  • roi_resizing.ipynb : adding and subtracting margins around an ROI.

  • roi_intensities.ipynb : hisogramming voxel intensities inside an ROI.

  • dose_volume_rois.ipynb : creation of ROI objects corresponding to volumes receiving a specified radiation dose.

  • eqd.ipynb : calculation of equivalent dose, for specified dose per fraction, and of biologically effective dose.

  • synthetic_dicom_dataset.ipynb : creation and writing (DICOM format) of a synthetic image and associated structure set, which can be useful for code testing.

  • grid_creation.ipynb : creation of a grid image, which can be useful, for example, for understanding the effect of applying a registration transform.

  • image_registration_checks.ipynb: registration of images featuring geometrical shapes, and qualitative checks of registration performance.

Notebooks using non-public datasets

The following were run using data from the VoxTox study. They can’t be rerun without equivalent data, but may be useful for code examples.

  • workshop_26_09_22.ipynb : overview of interactive functionality; presentation by K. Harrison, 26th September 2022.

  • kvct_to_mvct.ipynb: generation of a megavoltage (MV) computed-tomography (CT) guidance scan, starting from a (downsampled) kilovoltage (kV) CT scan, used in radiotherapy planning.

  • workshop_19_01_22.ipynb : overview of interactive functionality; presentation by H. Pullen, 19th January 2022.