Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions Python/01_Image_Basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# SimpleITK Image Basics <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F01_Image_Basics.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F01_Image_Basics.ipynb\"><img src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a> \n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/01_Image_Basics.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SimpleITK Image Basics \n",
"\n",
"This document will give a brief orientation to the SimpleITK Image class.\n",
"\n",
Expand Down Expand Up @@ -427,7 +458,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -441,9 +472,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.12.11"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
35 changes: 33 additions & 2 deletions Python/02_Pythonic_Image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pythonic Syntactic Sugar <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F02_Pythonic_Image.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F02_Pythonic_Image.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a> \n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/02_Pythonic_Image.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pythonic Syntactic Sugar\n",
"\n",
"The Image Basics Notebook was straight forward and closely follows ITK's C++ interface.\n",
"\n",
Expand Down Expand Up @@ -423,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
35 changes: 33 additions & 2 deletions Python/03_Image_Details.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# SimpleITK Images, They're Physical Objects <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F03_Image_Details.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F03_Image_Details.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/03_Image_Details.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SimpleITK Images, They're Physical Objects\n",
"\n",
"**SimpleITK conventions**:\n",
"* Image access is in x,y,z order, image.GetPixel(x,y,z) or image[x,y,z], with zero based indexing.\n",
Expand Down Expand Up @@ -1429,7 +1460,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
35 changes: 33 additions & 2 deletions Python/04_Image_Display.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Image Display <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F04_Image_Display.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F04_Image_Display.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/04_Image_Display.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Image Display\n",
"\n",
"The native SimpleITK approach to displaying images is to use an external viewing program. In the notebook environment it is convenient to use matplotlib to display inline images and if the need arises we can implement some reasonably rich inline graphical user interfaces, combining control components from the ipywidgets package and matplotlib based display.\n",
"\n",
Expand Down Expand Up @@ -338,7 +369,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
35 changes: 33 additions & 2 deletions Python/05_Results_Visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Visualization of Segmentation and Registration Results <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F05_Results_Visualization.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F05_Results_Visualization.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/05_Results_Visualization.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Visualization of Segmentation and Registration Results\n",
"\n",
"In this notebook we illustrate various ways one can display the results of segmentation and registration algorithms so that they can be easily incorporated into a manuscript or presentation. For interactive data exploration we recommend using dedicated programs (e.g. 3D slicer). \n",
"\n",
Expand Down Expand Up @@ -1430,7 +1461,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
39 changes: 37 additions & 2 deletions Python/10_matplotlibs_imshow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using `matplotlib` to display inline images <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F10_matplotlib's_imshow.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F10_matplotlibs_imshow.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/10_matplotlibs_imshow.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using `matplotlib` to display inline images\n",
"\n",
"In this notebook we will explore using `matplotlib` to display images in our notebooks, and work towards developing a reusable function to display 2D,3D, color, and label overlays for SimpleITK images.\n",
"\n",
Expand All @@ -15,6 +46,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
Expand Down Expand Up @@ -85,6 +117,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
Expand Down Expand Up @@ -132,6 +165,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
Expand Down Expand Up @@ -338,6 +372,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
Expand Down Expand Up @@ -540,7 +575,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
35 changes: 33 additions & 2 deletions Python/11_Progress.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Progress Reporting and Command Observers <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/master?filepath=Python%2F11_Progress.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\"></a>\n",
"<table align=\"right\">\n",
" <tr>\n",
" <td>\n",
" <a href=\"https://mybinder.org/v2/gh/InsightSoftwareConsortium/SimpleITK-Notebooks/main?filepath=Python%2F11_Progress.ipynb\"><img style=\"float: right;\" src=\"https://mybinder.org/badge_logo.svg\" alt=\"Binder\"></a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/main/Python/11_Progress.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Colab\"/>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Setup to enable running the notebook in the Google Colab environment\n",
"import os\n",
"\n",
"if \"COLAB_NOTEBOOK_ID\" in os.environ:\n",
" !git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks\n",
" %cd SimpleITK-Notebooks/Python\n",
" !pip install -q -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Progress Reporting and Command Observers\n",
"\n",
"SimpleITK `Filter`s and other classes derived from `ProcessObject`s have the ability for user code to be executed when certain events occur. This is known as the Command and Observer design patters to implement user callbacks. This allows for the monitoring and abortion of processes as they are being executed.\n",
"\n",
Expand Down Expand Up @@ -571,7 +602,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
Loading