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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
matrix:
# using macos-15-intel, last available intel architecture. macos-latest is arm64 architecture.
os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
inputs: ["00_ or 01_ or 02_ or 03_ or 04_ or 05_", "06_ or 07_ or 08_ or 09_ or 10_"]
inputs: ["00_ or 01_ or 03_ or 04_ or 05_", "06_ or 07_ or 08_ or 09_ or 10_"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
Expand Down
19 changes: 12 additions & 7 deletions 00_setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
"\n",
"For additional details see the [Jupyter project documentation](https://jupyter.org/documentation) on Jupyter Notebook or JupyterLab.\n",
"\n",
"## Convenience\n",
"## Convenience (notebook v7.x)\n",
"By default the contents of the Jupyter notebooks do not occupy the full browser window width. To take advantage of the full window width you can either configure each notebook independently by adding the following into a code cell:\n",
"\n",
"```\n",
"from IPython.core.display import display, HTML\n",
"display(HTML(\"<style>.container { width:100% !important; }</style>\"))\n",
"from IPython.display import display, HTML\n",
"display(HTML(\"<style>:root { --jp-notebook-max-width: 100% !important; }</style>\"))\n",
"```\n",
"Or apply this configuration to all notebooks by adding the following to\n",
"the custom.css jupyter configuration file:\n",
"```\n",
".container { width:100% !important; }\n",
":root {\n",
" --jp-notebook-max-width: 100% !important;\n",
"}\n",
"```\n",
"On OSX/Linux this file is found in `~/.jupyter/custom/custom.css` on windows it is\n",
"found in `C:\\Users\\[your_user_name]\\.jupyter\\custom\\custom.css`.\n",
Expand Down Expand Up @@ -120,7 +123,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"<a href=\"01_spatial_transformations.ipynb\"><h2 align=right>Next &raquo;</h2></a>"
]
Expand All @@ -142,9 +147,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
11 changes: 7 additions & 4 deletions 01_spatial_transformations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
" plt.xlim(xlim)\n",
" plt.ylim(ylim)\n",
" plt.legend(loc=(0.25, 1.01))\n",
" plt.show()\n",
"\n",
"\n",
"# 2D square centered on (0,0)\n",
Expand Down Expand Up @@ -667,7 +668,7 @@
"original_transformed = np.array(bspline.TransformPoint(pnt))\n",
"secondary_transformed = np.array(displacement_field_transform.TransformPoint(pnt))\n",
"print(\"Original transformation result: {0}\".format(original_transformed))\n",
"print(\"Deformaiton field transformation result: {0}\".format(secondary_transformed))\n",
"print(\"Deformation field transformation result: {0}\".format(secondary_transformed))\n",
"print(\n",
" \"Difference between transformed points is: {0}\".format(\n",
" np.linalg.norm(original_transformed - secondary_transformed)\n",
Expand Down Expand Up @@ -863,7 +864,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"<a href=\"02_images_and_resampling.ipynb\"><h2 align=right>Next &raquo;</h2></a>"
]
Expand All @@ -885,9 +888,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
16 changes: 11 additions & 5 deletions 02_images_and_resampling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"Or, creation from file."
Expand Down Expand Up @@ -309,7 +312,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Comparative operators (&gt;, &gt;=, &lt;, &lt;=, ==) are also supported, returning binary images."
"Comparative operators (&gt;, &gt;=, &lt;, &lt;=, ==) are also supported, returning binary images with pixel type of sitkUInt8."
]
},
{
Expand Down Expand Up @@ -552,7 +555,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"Write the volume as a series of JPEGs. The WriteImage function receives a volume and a list of images names and writes the volume according to the z axis. For a displayable result we need to rescale the image intensities (default is [0,255]) since the JPEG format requires a cast to the UInt8 pixel type."
Expand Down Expand Up @@ -820,9 +826,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
18 changes: 8 additions & 10 deletions 03_trust_but_verify.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@
"import tempfile\n",
"import pickle\n",
"\n",
"%matplotlib notebook\n",
"%matplotlib ipympl\n",
"import matplotlib.pyplot as plt\n",
"import ipywidgets as widgets\n",
"\n",
"\n",
"# utility method that either downloads data from the Girder repository or\n",
"# if already downloaded returns the file name for reading from disk (cached data)\n",
"from downloaddata import fetch_data as fdata\n",
Expand Down Expand Up @@ -498,6 +497,7 @@
" )\n",
" self.fig.tight_layout()\n",
" self.update_display()\n",
" plt.show()\n",
"\n",
" def create_ui(self):\n",
" # Create the active GUI components. Height and width are specified in 'em' units. This is\n",
Expand Down Expand Up @@ -677,9 +677,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"with open(faux_image_volume_file_name, \"rb\") as fp:\n",
Expand Down Expand Up @@ -734,9 +732,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"with open(faux_series_volume_file_name, \"rb\") as fp:\n",
Expand Down Expand Up @@ -764,7 +760,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"<a href=\"04_data_augmentation.ipynb\"><h2 align=right>Next &raquo;</h2></a>"
]
Expand All @@ -786,7 +784,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
Expand Down
11 changes: 7 additions & 4 deletions 04_data_augmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"import numpy as np\n",
"import os\n",
"\n",
"%matplotlib notebook\n",
"%matplotlib ipympl\n",
"import gui\n",
"\n",
"from downloaddata import fetch_data as fdata\n",
Expand Down Expand Up @@ -386,7 +386,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## What about flipping\n",
Expand Down Expand Up @@ -884,9 +887,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
11 changes: 7 additions & 4 deletions 05_basic_registration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"import SimpleITK as sitk\n",
"from downloaddata import fetch_data as fdata\n",
"\n",
"%matplotlib notebook\n",
"%matplotlib ipympl\n",
"import gui\n",
"import registration_gui as rgui\n",
"\n",
Expand Down Expand Up @@ -445,7 +445,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Initialization\n",
Expand Down Expand Up @@ -757,9 +760,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
10 changes: 7 additions & 3 deletions 06_advanced_registration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,11 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jp-MarkdownHeadingCollapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"<a href=\"07_registration_application.ipynb\"><h2 align=right>Next &raquo;</h2></a>"
Expand All @@ -710,9 +714,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
14 changes: 5 additions & 9 deletions 07_registration_application.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"import os.path\n",
"import copy\n",
"\n",
"%matplotlib notebook\n",
"%matplotlib ipympl\n",
"import gui\n",
"import matplotlib.pyplot as plt\n",
"\n",
Expand Down Expand Up @@ -115,9 +115,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# The ROI we specify is in a region that is expected to have uniform intensities.\n",
Expand Down Expand Up @@ -473,9 +471,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"metric_sampling_percentage = 0.2\n",
Expand Down Expand Up @@ -684,9 +680,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
10 changes: 4 additions & 6 deletions 08_segmentation_and_shape_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"import SimpleITK as sitk\n",
"import pandas as pd\n",
"\n",
"%matplotlib notebook\n",
"%matplotlib ipympl\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import gui\n",
Expand Down Expand Up @@ -432,9 +432,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"bacteria_labels = shape_stats.GetLabels()\n",
Expand Down Expand Up @@ -505,9 +503,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
4 changes: 2 additions & 2 deletions 09_segmentation_evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading