To contact us with problems or questions, please post to this repository's GitHub issue reporting system (requires a GitHub user account).

Overview

SimpleITK is a simplified programming interface to the algorithms and data structures of the Insight Segmentation and Registration Toolkit (ITK). It supports bindings for multiple programming languages including C++, Python, R, Java, C#, Lua, Ruby and TCL. Combining SimpleITK's Python or R bindings with the Jupyter notebook web application creates an environment which facilitates collaborative development of biomedical image analysis workflows.

In this tutorial, we will use a hands-on approach utilizing Jupyter notebooks to explore and experiment with various SimpleITK features in the Python and R programming languages. Participants will follow along using their personal laptops, enabling them to explore the effects of code changes and parameter settings not covered by the instructor. We will start by introducing the toolkit's two basic data elements, Images and Transformations. We illustrate how the two are combined to perform image resampling. We then show how to use SimpleITK as a tool for image preparation and data augmentation for deep learning via spatial (resampling) and intensity transformations. We will then explore the various features available in the toolkit's registration framework including: optimizer selection, the use of linear and deformable transformations, the embedded multi-resolution framework, self-calibrating optimizers and the use of callbacks for registration progress monitoring. Time permitting, we will provide a short overview of SimpleITK's approach to development of a maintainable collabaritve Jupyter notebook environment.

Beyond the notebooks used in this course you can find the main SimpleITK notebooks repository on GitHub.

Organizers

  • Hans J. Johnson, University of Iowa.
  • Bradley C. Lowekamp, Medical Science & Computing and National Institutes of Health.
  • Ziv Yaniv, TAJ Technologies Inc. and National Institutes of Health.

Prerequisites

If you encounter problems or have questions, please post using this repository's GitHub issue reporting system (requires a GitHub user account).

In this course we will use the Anaconda Python distribution (required even if you intend to work in R). Please follow the instructions below to setup the environment we will use during the course. All commands below are issued on the command line (Linux/Mac - terminal, Windows - Anaconda Prompt).

  1. Download and install the Fiji image viewer. This is the default image viewer used by SimpleITK:
    • On Windows: Install into your user directory (e.g. C:\Users\[your name]\Fiji.app).
    • On Linux: Install into ~/bin .
    • On Mac: Install into /Applications .
  2. Download and install the Anaconda Python 3.6 version for your operating system. We assume it is installed in a directory named anaconda3.
    • On Windows: open the Anaconda Prompt (found under the Anaconda3 start menu).
    • On Linux/Mac: on the command line source path_to_anaconda3/bin/activate base
  3. Update the base anaconda environment and install the git version control system into it.
    conda update conda
    conda update anaconda
    conda install git
    
  4. Clone this repository:
    git clone https://github.com/SimpleITK/ISBI2018_TUTORIAL.git
    
  5. Create the virtual environment containing all packages required for the course:
    conda env create -f ISBI2018_TUTORIAL/python/environment.yml
    
  6. Activate the virtual environment. On the commandline, on Windows this is the Anaconda Prompt found under the Anaconda3 start menu, and on Linux/Mac this is the terminal: conda activate sitkISBI18.

Continue With Python

  1. On the command line: jupyter nbextension enable --py --sys-prefix widgetsnbextension
  2. Go over the setup notebook (requires internet connectivity). This notebook checks the environment setup and downloads all of the required data:
    jupyter notebook ISBI2018_TUTORIAL/python/setup.ipynb
    

Continue With R

To work with the R programming language you will have to build SimpleITK on your computer. Currently this only works for OS X and Linux. We assume you have the CMake program, git (you just installed it above) and a compiler in your path.

  1. Install R on your machine.
  2. From the R prompt (appropriate number of parallel jobs, MAKEJ, depends on your specific machine):
  3. install.packages(c("devtools", "rPython", "plot3D", "tidyr", "ggplot2", "purrr"))
    devtools::install_github('IRkernel/IRkernel')
    IRkernel::installspec()
    devtools::install_github("SimpleITK/SimpleITKRInstaller", args=c('--configure-vars="MAKEJ=6"'))
    
  4. Go over the setup notebook (requires internet connectivity). This notebook checks the environment setup and downloads all of the required data:
    jupyter notebook ISBI2018_TUTORIAL/r/setup.ipynb
    

Program

  • [1:30PM- 2:00PM] history and overview of SimpleITK. [ppt: setup and schedule, history, overview]
  • [2:00PM- 2:30PM] spatial transformations.
  • [2:30PM- 3:00PM] images and resampling.
  • [3:00PM - 3:15PM] (shortened) coffee break [coffee ] - so much material, so little time.
  • [3:15PM - 3:45PM] data augmentation for deep learning.
  • [3:45PM - 4:30PM] basic registration.
  • [4:30PM - 5:15PM] advanced registration / segmentation.
  • [5:15PM - 5:30PM] notebook development and testing, concluding remarks. [ppt: development and testing ]
* You will have to run the jupyter notebook command in the main directory of the repository, otherwise the static images shared by the Python and R notebooks are not displayed (this is a feature not a bug).

Supplementary Material

For those interested in reading more about the design of SimpleITK and the Notebooks environmnet: