├── .github ├── dependabot.yml └── workflows │ └── main.yml ├── .gitignore ├── 00_setup.ipynb ├── 01_spatial_transformations.ipynb ├── 02_images_and_resampling.ipynb ├── 03_trust_but_verify.ipynb ├── 04_data_augmentation.ipynb ├── 05_basic_registration.ipynb ├── 06_advanced_registration.ipynb ├── 07_registration_application.ipynb ├── 08_segmentation_and_shape_analysis.ipynb ├── 09_segmentation_evaluation.ipynb ├── 10_results_visualization.ipynb ├── LICENSE ├── README.md ├── binder ├── requirements.txt └── runtime.txt ├── characterize_data.py ├── data └── manifest.json ├── docs ├── index.html ├── mec2020.png ├── simpleitk.bib ├── simpleitkFundamentalConcepts.pptx ├── simpleitkHistoricalOverview.pptx └── simpleitkLogo.jpg ├── downloaddata.py ├── environment.yml ├── environment_dev.yml ├── figures ├── ITKv4RegistrationComponentsDiagram.svg ├── ImageOriginAndSpacing.png ├── hkaAngle.png ├── registrationFrameworkTransformations.svg └── resampling.svg ├── gui.py ├── output └── .gitignore ├── registration_gui.py ├── tests ├── additional_dictionary.txt ├── requirements_testing.txt └── test_notebooks.py └── utilities.py /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | day: "sunday" 8 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Notebook Testing 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - 'docs/**' 9 | - 'binder/**' 10 | - 'figures/**' 11 | pull_request: 12 | branches: 13 | - main 14 | paths-ignore: 15 | - 'docs/**' 16 | - 'binder/**' 17 | - 'figures/**' 18 | schedule: 19 | # run testing on the first of each month 5am ET / 9am UTC 20 | - cron: '0 9 1 * *' 21 | 22 | # Enable manual running of workflow, so we can force execution 23 | workflow_dispatch: 24 | 25 | jobs: 26 | lint: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - uses: actions/checkout@v4 30 | - name: Set up Python 3.9 31 | uses: actions/setup-python@v5 32 | with: 33 | python-version: 3.9 34 | - name: Install and run black for notebooks 35 | run: | 36 | python -m pip install --upgrade pip 37 | python -m pip install black[jupyter] 38 | black --check --diff --verbose . 39 | test: 40 | needs: lint 41 | strategy: 42 | matrix: 43 | # not using macos-latest because pyenchant doesn't work with the new macos-14 arm64 44 | os: [ubuntu-latest, macos-13, windows-latest] 45 | inputs: ["00_ or 01_ or 02_ or 03_ or 04_ or 05_", "06_ or 07_ or 08_ or 09_ or 10_"] 46 | runs-on: ${{ matrix.os }} 47 | steps: 48 | - uses: actions/checkout@v4 49 | - uses: actions/cache@v4 50 | id: cache 51 | with: 52 | path: | 53 | data 54 | key: notebook-data-${{ hashFiles('data/manifest.json') }} 55 | restore-keys: | 56 | notebook-data-${{ hashFiles('data/manifest.json') }} 57 | - name: Set up Python 3.9 58 | uses: actions/setup-python@v5 59 | with: 60 | python-version: 3.9 61 | - name: Install enchant on non windows systems 62 | shell: bash 63 | run: | 64 | if [ "$RUNNER_OS" == "Linux" ]; then 65 | sudo apt-get update 66 | sudo apt-get install enchant-2 67 | elif [ "$RUNNER_OS" == "macOS" ]; then 68 | brew update 69 | brew install enchant 70 | fi 71 | # on windows, the pyenchant package includes enchant 72 | - name: Install dependencies 73 | run: | 74 | python -m pip install --upgrade pip 75 | python -m pip install -r tests/requirements_testing.txt 76 | jupyter nbextension enable --py --sys-prefix widgetsnbextension 77 | - name: Download data 78 | if: steps.cache.outputs.cache-hit != 'true' 79 | run: python downloaddata.py data/ data/manifest.json 80 | - name: run the test 81 | env: 82 | SIMPLE_ITK_MEMORY_CONSTRAINED_ENVIRONMENT: 1 83 | run: | 84 | pytest -v --tb=short -k "${{matrix.inputs}}" tests/test_notebooks.py::Test_notebooks::test_python_notebook 85 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Data 3 | build 4 | *.o 5 | \#*\# 6 | *\# 7 | *~ 8 | *.pyc 9 | *.orig 10 | .ipynb_checkpoints/ 11 | .*.swp 12 | .mha 13 | .jpg 14 | -------------------------------------------------------------------------------- /00_setup.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "
53 | ![]() |
57 | ![]() |
61 | 78 | |
84 |
85 | 86 | 87 | 88 | 89 | 90 |91 | If you encounter problems or have tutorial specific questions, please post on 92 | the tutorial's GitHub issue 93 | reporting system (requires a GitHub user account). For general SimpleITK questions, please 94 | use the ITK discourse forum. 95 | 96 |Overview97 | 98 | 99 |100 | SimpleITK is a simplified programming 101 | interface to the algorithms and data 102 | structures of the Insight Toolkit (ITK) for 104 | segmentation, registration and 105 | advanced image analysis. It supports bindings for multiple programming languages 106 | including C++, Python, R, Java, C#, Lua, Ruby and TCL. Combining SimpleITK’s 107 | Python bindings with the Jupyter 108 | notebook web application creates an environment 109 | which facilitates collaborative development of biomedical image analysis 110 | workflows. 111 | 112 | 113 |114 | In this tutorial, we use a hands-on approach utilizing Python and Jupyter notebooks to 115 | explore and experiment with various SimpleITK features. You can browse the Jupyter notebooks on 116 | your own, watch the videos associated with these notebooks or work your way through the notebooks 117 | following along with the videos. 118 | 119 | 120 |121 | Additional details and notebooks can be found on the main SimpleITK 123 | notebooks repository. 124 | 125 | 126 | 127 |Setup128 | 129 | 130 | 131 |132 | In this tutorial we will use the Anaconda Python distribution. Please follow the 133 | instructions below to setup the environment. All 134 | commands below are issued on the command line (Linux/Mac - terminal, 135 | Windows - Anaconda Prompt). 136 | 137 | 138 |
Tutorial - v2.0.0204 |
205 | Click the launch binder button to try things out without installing
206 |
208 | 212 | The videos may differ slightly from the current notebooks as they were created for the initial tutorial version, v1.0.0. 213 | 214 |
Support the Toolkit265 | 266 |267 | Star us on GitHub (requires GitHub account): 268 |
275 | If you find that SimpleITK has been useful in your research, cite the appropriate paper (citations.bib): 277 |
|
291 |