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
36 changes: 28 additions & 8 deletions R/00_Setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,32 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"vscode": {
"languageId": "r"
}
},
"outputs": [],
"source": [
"# check that all packages are installed (see requirements.txt file)\n",
"required_packages <- c(\"SimpleITK\", \"rPython\", \"scatterplot3d\", \"tidyr\", \"ggplot2\", \"xtable\", \"purrr\")\n",
"required_packages <- c(\"SimpleITK\", \"reticulate\", \"scatterplot3d\", \"tidyr\", \"ggplot2\", \"xtable\", \"purrr\")\n",
"missing_packages <- required_packages[!unlist(lapply(required_packages, require, character.only = TRUE, quietly = TRUE))]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"vscode": {
"languageId": "r"
}
},
"outputs": [],
"source": [
Expand All @@ -67,8 +79,14 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"simpleitk_error_allowed": "Exception in SITK"
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"simpleitk_error_allowed": "Exception in SITK",
"vscode": {
"languageId": "r"
}
},
"outputs": [],
"source": [
Expand All @@ -91,7 +109,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"vscode": {
"languageId": "r"
}
},
"outputs": [],
"source": [
Expand All @@ -111,9 +131,9 @@
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.2.3"
"version": "4.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
16 changes: 11 additions & 5 deletions R/22_Transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Similarity to Affine [3D]\n",
Expand Down Expand Up @@ -935,7 +938,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Writing and Reading\n",
Expand Down Expand Up @@ -980,7 +986,7 @@
"displacement$SetFixedParameters(c(field_size, field_origin, field_spacing, field_direction))\n",
"displacement$SetParameters(runif(length(displacement$GetParameters())))\n",
"\n",
"composite_transform <- Transform(basic_transform)\n",
"composite_transform <- CompositeTransform(basic_transform)\n",
"composite_transform$AddTransform(displacement)\n",
"\n",
"full_file_name <- file.path(OUTPUT_DIR, \"composite.tfm\")\n",
Expand Down Expand Up @@ -1030,9 +1036,9 @@
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.5.3"
"version": "4.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
48 changes: 27 additions & 21 deletions R/300_Segmentation_Overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -35,7 +38,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -61,7 +63,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -76,7 +77,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -101,6 +101,9 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand Down Expand Up @@ -137,6 +140,9 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -148,7 +154,7 @@
"seg <- Image(img_T1$GetSize(), \"sitkUInt8\")\n",
"seg$CopyInformation(img_T1)\n",
"seg$SetPixel(seed,1)\n",
"seg <- BinaryDilate(seg, 3)\n",
"seg <- BinaryDilate(seg, c(3,3,3))\n",
"\n",
"Show(LabelOverlay(img_T1_255, seg))"
]
Expand All @@ -164,7 +170,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -187,7 +192,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -212,7 +216,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand Down Expand Up @@ -241,7 +244,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -264,7 +266,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -291,7 +292,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand Down Expand Up @@ -323,17 +323,15 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"seed <- c(132,142,96)\n",
"\n",
"seg <- Image(img_T1$GetSize(), \"sitkUInt8\")\n",
"seg$CopyInformation(img_T1)\n",
"seg$SetPixel(seed, 1)\n",
"seg <- BinaryDilate(seg, 3)"
"seg <- BinaryDilate(seg, c(3,3,3))"
]
},
{
Expand All @@ -347,7 +345,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -365,7 +366,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -376,7 +380,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -396,7 +403,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"simpleitk_error_allowed": "Exception in SITK"
},
"outputs": [],
Expand All @@ -418,9 +424,9 @@
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.2.3"
"version": "4.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Loading