+.. thumbnail-parent-div-open
+
+.. thumbnail-parent-div-close
.. raw:: html
@@ -25,16 +26,15 @@ Arterial Input Functions
-
-
.. raw:: html
+.. thumbnail-parent-div-open
.. raw:: html
-
+
.. only:: html
@@ -51,7 +51,7 @@ Arterial Input Functions
.. raw:: html
-
+
.. only:: html
@@ -66,6 +66,8 @@ Arterial Input Functions
+.. thumbnail-parent-div-close
+
.. raw:: html
@@ -76,12 +78,11 @@ Tissue concentrations
-
-
.. raw:: html
+.. thumbnail-parent-div-open
.. raw:: html
@@ -117,6 +118,8 @@ Tissue concentrations
+.. thumbnail-parent-div-close
+
.. raw:: html
diff --git a/docs/source/generated/examples/index.rst.new b/docs/source/generated/examples/index.rst.new
deleted file mode 100644
index 031e6a8..0000000
--- a/docs/source/generated/examples/index.rst.new
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-.. _sphx_glr_generated_examples:
-
-########
-Examples
-########
-
-Illustrating common use cases of osipi.
-
-
-
-.. raw:: html
-
-
-
-.. thumbnail-parent-div-open
-
-.. thumbnail-parent-div-close
-
-.. raw:: html
-
-
diff --git a/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_001.png b/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_001.png
index 7946b14..d1fd592 100755
Binary files a/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_001.png and b/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_001.png differ
diff --git a/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_002.png b/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_002.png
index f3cf070..579b30a 100755
Binary files a/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_002.png and b/docs/source/generated/examples/tissue/images/sphx_glr_plot_extended_tofts_002.png differ
diff --git a/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_001.png b/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_001.png
index ba5f383..7ef6265 100755
Binary files a/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_001.png and b/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_001.png differ
diff --git a/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_002.png b/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_002.png
index 49b1ccd..0276780 100755
Binary files a/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_002.png and b/docs/source/generated/examples/tissue/images/sphx_glr_plot_tofts_002.png differ
diff --git a/docs/source/generated/examples/tissue/images/thumb/sphx_glr_plot_tofts_thumb.png b/docs/source/generated/examples/tissue/images/thumb/sphx_glr_plot_tofts_thumb.png
index 6aaabaa..bd0ec5f 100755
Binary files a/docs/source/generated/examples/tissue/images/thumb/sphx_glr_plot_tofts_thumb.png and b/docs/source/generated/examples/tissue/images/thumb/sphx_glr_plot_tofts_thumb.png differ
diff --git a/docs/source/generated/examples/tissue/index.rst b/docs/source/generated/examples/tissue/index.rst
index a1b6f62..f2e344d 100755
--- a/docs/source/generated/examples/tissue/index.rst
+++ b/docs/source/generated/examples/tissue/index.rst
@@ -8,12 +8,11 @@ Tissue concentrations
-
-
.. raw:: html
+.. thumbnail-parent-div-open
.. raw:: html
@@ -49,6 +48,8 @@ Tissue concentrations
+.. thumbnail-parent-div-close
+
.. raw:: html
diff --git a/docs/source/generated/examples/tissue/plot_extended_tofts.ipynb b/docs/source/generated/examples/tissue/plot_extended_tofts.ipynb
index 52b04cd..b4d9c3c 100755
--- a/docs/source/generated/examples/tissue/plot_extended_tofts.ipynb
+++ b/docs/source/generated/examples/tissue/plot_extended_tofts.ipynb
@@ -1,133 +1,115 @@
{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n# The Extended Tofts model\n\nSimulating tissue concentrations from extended Tofts model with different settings.\n"
- ]
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n# The Extended Tofts model\n\nSimulating tissue concentrations from extended Tofts model with different settings.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import matplotlib.pyplot as plt"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Import necessary packages\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import numpy as np\nimport osipi"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Generate Parker AIF with default settings.\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "# Define time points in units of seconds - in this case we use a time\n# resolution of 1 sec and a total duration of 6 minutes.\nt = np.arange(0, 6 * 60, 1)\n\n# Create an AIF with default settings\nca = osipi.aif_parker(t)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Plot the tissue concentrations for an extracellular volume fraction\nof 0.2 and 3 different plasma volumes of 0.05, 0.2 and 0.6\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "Ktrans = 0.2 # in units of 1/min\nve = 0.2 # volume fraction between 0 and 1\nvp = [0.05, 0.2, 0.6] # volume fraction between 0 and 1\nct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0])\nplt.plot(t, ct, \"b-\", label=f\"vp = {vp[0]}\")\nct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[1])\nplt.plot(t, ct, \"g-\", label=f\"vp = {vp[1]}\")\nct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[2])\nplt.plot(t, ct, \"m-\", label=f\"vp = {vp[2]}\")\nplt.xlabel(\"Time (sec)\")\nplt.ylabel(\"Tissue concentration (mM)\")\nplt.legend()\nplt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Comparing different discretization methods for an extracellular\nvolume fraction of 0.2, Ktrans of 0.2 /min and vp of 0.05\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0]) # Defaults to Convolution\nplt.plot(t, ct, \"b-\", label=\"Convolution\")\nct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0], discretization_method=\"exp\")\nplt.plot(t, ct, \"g-\", label=\"Exponential Convolution\")\nplt.title(f\"Ktrans = {Ktrans} /min\")\nplt.xlabel(\"Time (sec)\")\nplt.ylabel(\"Tissue concentration (mM)\")\nplt.legend()\nplt.show()\n\n# Choose the last image as a thumbnail for the gallery\n# sphinx_gallery_thumbnail_number = -1"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.8"
+ }
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Import necessary packages\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "import numpy as np\n",
- "import matplotlib.pyplot as plt\n",
- "import osipi"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Generate Parker AIF with default settings.\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "# Define time points in units of seconds - in this case we use a time resolution of 1 sec and a total duration of 6 minutes.\n",
- "t = np.arange(0, 6 * 60, 1)\n",
- "\n",
- "# Create an AIF with default settings\n",
- "ca = osipi.aif_parker(t)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3 different plasma volumes of 0.05, 0.2 and 0.6\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "Ktrans = 0.2 # in units of 1/min\n",
- "ve = 0.2 # volume fraction between 0 and 1\n",
- "vp = [0.05, 0.2, 0.6] # volume fraction between 0 and 1\n",
- "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0])\n",
- "plt.plot(t, ct, \"b-\", label=f\"vp = {vp[0]}\")\n",
- "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[1])\n",
- "plt.plot(t, ct, \"g-\", label=f\"vp = {vp[1]}\")\n",
- "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[2])\n",
- "plt.plot(t, ct, \"m-\", label=f\"vp = {vp[2]}\")\n",
- "plt.xlabel(\"Time (sec)\")\n",
- "plt.ylabel(\"Tissue concentration (mM)\")\n",
- "plt.legend()\n",
- "plt.show()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Comparing different discretization methods for an extracellular volume fraction of 0.2, Ktrans of 0.2 /min and vp of 0.05\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0]) # Defaults to Convolution\n",
- "plt.plot(t, ct, \"b-\", label=\"Convolution\")\n",
- "ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0], discretization_method=\"exp\")\n",
- "plt.plot(t, ct, \"g-\", label=\"Exponential Convolution\")\n",
- "plt.title(f\"Ktrans = {Ktrans} /min\")\n",
- "plt.xlabel(\"Time (sec)\")\n",
- "plt.ylabel(\"Tissue concentration (mM)\")\n",
- "plt.legend()\n",
- "plt.show()\n",
- "\n",
- "# Choose the last image as a thumbnail for the gallery\n",
- "# sphinx_gallery_thumbnail_number = -1"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.11.2"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat": 4,
+ "nbformat_minor": 0
}
diff --git a/docs/source/generated/examples/tissue/plot_extended_tofts.py.md5 b/docs/source/generated/examples/tissue/plot_extended_tofts.py.md5
index ec1a537..1e726a8 100755
--- a/docs/source/generated/examples/tissue/plot_extended_tofts.py.md5
+++ b/docs/source/generated/examples/tissue/plot_extended_tofts.py.md5
@@ -1 +1 @@
-fe125cfe0a7b9603e82149422673111f
+67f6424a8ea349ea69f2a6e0993d78c7
diff --git a/docs/source/generated/examples/tissue/plot_extended_tofts.rst b/docs/source/generated/examples/tissue/plot_extended_tofts.rst
index 3fc70b2..13d638f 100755
--- a/docs/source/generated/examples/tissue/plot_extended_tofts.rst
+++ b/docs/source/generated/examples/tissue/plot_extended_tofts.rst
@@ -2,7 +2,7 @@
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
-.. "generated/examples/tissue/plot_extended_tofts.py"
+.. "generated\examples\tissue\plot_extended_tofts.py"
.. LINE NUMBERS ARE GIVEN BELOW.
.. only:: html
@@ -11,29 +11,42 @@
:class: sphx-glr-download-link-note
:ref:`Go to the end
`
- to download the full example code
+ to download the full example code.
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_generated_examples_tissue_plot_extended_tofts.py:
-========================
+=========================
The Extended Tofts model
-========================
+=========================
Simulating tissue concentrations from extended Tofts model with different settings.
-.. GENERATED FROM PYTHON SOURCE LINES 10-11
+.. GENERATED FROM PYTHON SOURCE LINES 8-11
+
+.. code-block:: Python
+
+
+ import matplotlib.pyplot as plt
+
+
+
+
+
+
+
+
+.. GENERATED FROM PYTHON SOURCE LINES 12-13
Import necessary packages
-.. GENERATED FROM PYTHON SOURCE LINES 11-15
+.. GENERATED FROM PYTHON SOURCE LINES 13-16
.. code-block:: Python
import numpy as np
- import matplotlib.pyplot as plt
import osipi
@@ -43,17 +56,18 @@ Import necessary packages
-.. GENERATED FROM PYTHON SOURCE LINES 16-17
+.. GENERATED FROM PYTHON SOURCE LINES 17-18
Generate Parker AIF with default settings.
-.. GENERATED FROM PYTHON SOURCE LINES 17-24
+.. GENERATED FROM PYTHON SOURCE LINES 18-26
.. code-block:: Python
- # Define time points in units of seconds - in this case we use a time resolution of 1 sec and a total duration of 6 minutes.
- t = np.arange(0, 6*60, 1)
+ # Define time points in units of seconds - in this case we use a time
+ # resolution of 1 sec and a total duration of 6 minutes.
+ t = np.arange(0, 6 * 60, 1)
# Create an AIF with default settings
ca = osipi.aif_parker(t)
@@ -65,25 +79,26 @@ Generate Parker AIF with default settings.
-.. GENERATED FROM PYTHON SOURCE LINES 25-26
+.. GENERATED FROM PYTHON SOURCE LINES 27-29
-Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3 different plasma volumes of 0.05, 0.2 and 0.6
+Plot the tissue concentrations for an extracellular volume fraction
+of 0.2 and 3 different plasma volumes of 0.05, 0.2 and 0.6
-.. GENERATED FROM PYTHON SOURCE LINES 26-40
+.. GENERATED FROM PYTHON SOURCE LINES 29-43
.. code-block:: Python
- Ktrans = 0.2 # in units of 1/min
+ Ktrans = 0.2 # in units of 1/min
ve = 0.2 # volume fraction between 0 and 1
- vp = [0.05, 0.2, 0.6] # volume fraction between 0 and 1
+ vp = [0.05, 0.2, 0.6] # volume fraction between 0 and 1
ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0])
- plt.plot(t, ct, 'b-', label=f'vp = {vp[0]}')
+ plt.plot(t, ct, "b-", label=f"vp = {vp[0]}")
ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[1])
- plt.plot(t, ct, 'g-', label=f'vp = {vp[1]}')
+ plt.plot(t, ct, "g-", label=f"vp = {vp[1]}")
ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[2])
- plt.plot(t, ct, 'm-', label=f'vp = {vp[2]}')
- plt.xlabel('Time (sec)')
- plt.ylabel('Tissue concentration (mM)')
+ plt.plot(t, ct, "m-", label=f"vp = {vp[2]}")
+ plt.xlabel("Time (sec)")
+ plt.ylabel("Tissue concentration (mM)")
plt.legend()
plt.show()
@@ -99,21 +114,22 @@ Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3
-.. GENERATED FROM PYTHON SOURCE LINES 41-42
+.. GENERATED FROM PYTHON SOURCE LINES 44-46
-Comparing different discretization methods for an extracellular volume fraction of 0.2, Ktrans of 0.2 /min and vp of 0.05
+Comparing different discretization methods for an extracellular
+volume fraction of 0.2, Ktrans of 0.2 /min and vp of 0.05
-.. GENERATED FROM PYTHON SOURCE LINES 42-54
+.. GENERATED FROM PYTHON SOURCE LINES 46-58
.. code-block:: Python
- ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0]) # Defaults to Convolution
- plt.plot(t, ct, 'b-', label='Convolution')
- ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0], discretization_method='exp')
- plt.plot(t, ct, 'g-', label='Exponential Convolution')
- plt.title(f'Ktrans = {Ktrans} /min')
- plt.xlabel('Time (sec)')
- plt.ylabel('Tissue concentration (mM)')
+ ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0]) # Defaults to Convolution
+ plt.plot(t, ct, "b-", label="Convolution")
+ ct = osipi.extended_tofts(t, ca, Ktrans, ve, vp[0], discretization_method="exp")
+ plt.plot(t, ct, "g-", label="Exponential Convolution")
+ plt.title(f"Ktrans = {Ktrans} /min")
+ plt.xlabel("Time (sec)")
+ plt.ylabel("Tissue concentration (mM)")
plt.legend()
plt.show()
@@ -134,7 +150,7 @@ Comparing different discretization methods for an extracellular volume fraction
.. rst-class:: sphx-glr-timing
- **Total running time of the script:** (0 minutes 0.113 seconds)
+ **Total running time of the script:** (0 minutes 0.136 seconds)
.. _sphx_glr_download_generated_examples_tissue_plot_extended_tofts.py:
diff --git a/docs/source/generated/examples/tissue/plot_extended_tofts_codeobj.pickle b/docs/source/generated/examples/tissue/plot_extended_tofts_codeobj.pickle
index b503898..b58f99b 100755
Binary files a/docs/source/generated/examples/tissue/plot_extended_tofts_codeobj.pickle and b/docs/source/generated/examples/tissue/plot_extended_tofts_codeobj.pickle differ
diff --git a/docs/source/generated/examples/tissue/plot_tofts.ipynb b/docs/source/generated/examples/tissue/plot_tofts.ipynb
index 91cda66..1e137aa 100755
--- a/docs/source/generated/examples/tissue/plot_tofts.ipynb
+++ b/docs/source/generated/examples/tissue/plot_tofts.ipynb
@@ -1,132 +1,115 @@
{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n# The Tofts model\n\nSimulating tissue concentrations from Tofts model with different settings.\n"
- ]
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n# The Tofts model\n\nSimulating tissue concentrations from Tofts model with different settings.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import matplotlib.pyplot as plt"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Import necessary packages\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import numpy as np\nimport osipi"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Generate Parker AIF with default settings.\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "# Define time points in units of seconds - in this case we use a time\n# resolution of 1 sec and a total duration of 6 minutes.\nt = np.arange(0, 6 * 60, 1)\n\n# Create an AIF with default settings\nca = osipi.aif_parker(t)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Plot the tissue concentrations for an extracellular volume fraction\nof 0.2 and 3 different transfer rate constants of 0.05, 0.2 and 0.6\n/min\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "Ktrans = [0.05, 0.2, 0.6] # in units of 1/min\nve = 0.2 # volume fraction between 0 and 1\nct = osipi.tofts(t, ca, Ktrans=Ktrans[0], ve=ve)\nplt.plot(t, ct, \"b-\", label=f\"Ktrans = {Ktrans[0]} /min\")\nct = osipi.tofts(t, ca, Ktrans[1], ve)\nplt.plot(t, ct, \"g-\", label=f\"Ktrans = {Ktrans[1]} /min\")\nct = osipi.tofts(t, ca, Ktrans[2], ve)\nplt.plot(t, ct, \"m-\", label=f\"Ktrans = {Ktrans[2]} /min\")\nplt.xlabel(\"Time (sec)\")\nplt.ylabel(\"Tissue concentration (mM)\")\nplt.legend()\nplt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Comparing different discretization methods for an extracellular\nvolume fraction of 0.2 and Ktrans of 0.2 /min\n\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve) # Defaults to Convolution\nplt.plot(t, ct, \"b-\", label=\"Convolution\")\nct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve, discretization_method=\"exp\")\nplt.plot(t, ct, \"g-\", label=\"Exponential Convolution\")\nplt.title(f\"Ktrans = {Ktrans[1]} /min\")\nplt.xlabel(\"Time (sec)\")\nplt.ylabel(\"Tissue concentration (mM)\")\nplt.legend()\nplt.show()\n\n# Choose the last image as a thumbnail for the gallery\n# sphinx_gallery_thumbnail_number = -1"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.8"
+ }
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Import necessary packages\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "import numpy as np\n",
- "import matplotlib.pyplot as plt\n",
- "import osipi"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Generate Parker AIF with default settings.\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "# Define time points in units of seconds - in this case we use a time resolution of 1 sec and a total duration of 6 minutes.\n",
- "t = np.arange(0, 6 * 60, 1)\n",
- "\n",
- "# Create an AIF with default settings\n",
- "ca = osipi.aif_parker(t)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3 different transfer rate constants of 0.05, 0.2 and 0.6 /min\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "Ktrans = [0.05, 0.2, 0.6] # in units of 1/min\n",
- "ve = 0.2 # volume fraction between 0 and 1\n",
- "ct = osipi.tofts(t, ca, Ktrans=Ktrans[0], ve=ve)\n",
- "plt.plot(t, ct, \"b-\", label=f\"Ktrans = {Ktrans[0]} /min\")\n",
- "ct = osipi.tofts(t, ca, Ktrans[1], ve)\n",
- "plt.plot(t, ct, \"g-\", label=f\"Ktrans = {Ktrans[1]} /min\")\n",
- "ct = osipi.tofts(t, ca, Ktrans[2], ve)\n",
- "plt.plot(t, ct, \"m-\", label=f\"Ktrans = {Ktrans[2]} /min\")\n",
- "plt.xlabel(\"Time (sec)\")\n",
- "plt.ylabel(\"Tissue concentration (mM)\")\n",
- "plt.legend()\n",
- "plt.show()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Comparing different discretization methods for an extracellular volume fraction of 0.2 and Ktrans of 0.2 /min\n\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve) # Defaults to Convolution\n",
- "plt.plot(t, ct, \"b-\", label=\"Convolution\")\n",
- "ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve, discretization_method=\"exp\")\n",
- "plt.plot(t, ct, \"g-\", label=\"Exponential Convolution\")\n",
- "plt.title(f\"Ktrans = {Ktrans[1]} /min\")\n",
- "plt.xlabel(\"Time (sec)\")\n",
- "plt.ylabel(\"Tissue concentration (mM)\")\n",
- "plt.legend()\n",
- "plt.show()\n",
- "\n",
- "# Choose the last image as a thumbnail for the gallery\n",
- "# sphinx_gallery_thumbnail_number = -1"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.9.16"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat": 4,
+ "nbformat_minor": 0
}
diff --git a/docs/source/generated/examples/tissue/plot_tofts.py.md5 b/docs/source/generated/examples/tissue/plot_tofts.py.md5
index 10b2daf..2ef949a 100755
--- a/docs/source/generated/examples/tissue/plot_tofts.py.md5
+++ b/docs/source/generated/examples/tissue/plot_tofts.py.md5
@@ -1 +1 @@
-562f87655efc9f9b885f617d06bc5dba
+00e98a230054047d6b50baaf857b22b3
diff --git a/docs/source/generated/examples/tissue/plot_tofts.rst b/docs/source/generated/examples/tissue/plot_tofts.rst
index bd7378d..2b0b9e0 100755
--- a/docs/source/generated/examples/tissue/plot_tofts.rst
+++ b/docs/source/generated/examples/tissue/plot_tofts.rst
@@ -2,7 +2,7 @@
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
-.. "generated/examples/tissue/plot_tofts.py"
+.. "generated\examples\tissue\plot_tofts.py"
.. LINE NUMBERS ARE GIVEN BELOW.
.. only:: html
@@ -11,7 +11,7 @@
:class: sphx-glr-download-link-note
:ref:`Go to the end `
- to download the full example code
+ to download the full example code.
.. rst-class:: sphx-glr-example-title
@@ -24,16 +24,29 @@ The Tofts model
Simulating tissue concentrations from Tofts model with different settings.
-.. GENERATED FROM PYTHON SOURCE LINES 10-11
+.. GENERATED FROM PYTHON SOURCE LINES 8-11
+
+.. code-block:: Python
+
+
+ import matplotlib.pyplot as plt
+
+
+
+
+
+
+
+
+.. GENERATED FROM PYTHON SOURCE LINES 12-13
Import necessary packages
-.. GENERATED FROM PYTHON SOURCE LINES 11-15
+.. GENERATED FROM PYTHON SOURCE LINES 13-16
-.. code-block:: default
+.. code-block:: Python
import numpy as np
- import matplotlib.pyplot as plt
import osipi
@@ -43,17 +56,18 @@ Import necessary packages
-.. GENERATED FROM PYTHON SOURCE LINES 16-17
+.. GENERATED FROM PYTHON SOURCE LINES 17-18
Generate Parker AIF with default settings.
-.. GENERATED FROM PYTHON SOURCE LINES 17-24
+.. GENERATED FROM PYTHON SOURCE LINES 18-26
-.. code-block:: default
+.. code-block:: Python
- # Define time points in units of seconds - in this case we use a time resolution of 1 sec and a total duration of 6 minutes.
- t = np.arange(0, 6*60, 1)
+ # Define time points in units of seconds - in this case we use a time
+ # resolution of 1 sec and a total duration of 6 minutes.
+ t = np.arange(0, 6 * 60, 1)
# Create an AIF with default settings
ca = osipi.aif_parker(t)
@@ -65,24 +79,26 @@ Generate Parker AIF with default settings.
-.. GENERATED FROM PYTHON SOURCE LINES 25-26
+.. GENERATED FROM PYTHON SOURCE LINES 27-30
-Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3 different transfer rate constants of 0.05, 0.2 and 0.6 /min
+Plot the tissue concentrations for an extracellular volume fraction
+of 0.2 and 3 different transfer rate constants of 0.05, 0.2 and 0.6
+/min
-.. GENERATED FROM PYTHON SOURCE LINES 26-39
+.. GENERATED FROM PYTHON SOURCE LINES 30-43
-.. code-block:: default
+.. code-block:: Python
Ktrans = [0.05, 0.2, 0.6] # in units of 1/min
ve = 0.2 # volume fraction between 0 and 1
ct = osipi.tofts(t, ca, Ktrans=Ktrans[0], ve=ve)
- plt.plot(t, ct, 'b-', label=f'Ktrans = {Ktrans[0]} /min')
+ plt.plot(t, ct, "b-", label=f"Ktrans = {Ktrans[0]} /min")
ct = osipi.tofts(t, ca, Ktrans[1], ve)
- plt.plot(t, ct, 'g-', label=f'Ktrans = {Ktrans[1]} /min')
+ plt.plot(t, ct, "g-", label=f"Ktrans = {Ktrans[1]} /min")
ct = osipi.tofts(t, ca, Ktrans[2], ve)
- plt.plot(t, ct, 'm-', label=f'Ktrans = {Ktrans[2]} /min')
- plt.xlabel('Time (sec)')
- plt.ylabel('Tissue concentration (mM)')
+ plt.plot(t, ct, "m-", label=f"Ktrans = {Ktrans[2]} /min")
+ plt.xlabel("Time (sec)")
+ plt.ylabel("Tissue concentration (mM)")
plt.legend()
plt.show()
@@ -98,21 +114,22 @@ Plot the tissue concentrations for an extracellular volume fraction of 0.2 and 3
-.. GENERATED FROM PYTHON SOURCE LINES 40-41
+.. GENERATED FROM PYTHON SOURCE LINES 44-46
-Comparing different discretization methods for an extracellular volume fraction of 0.2 and Ktrans of 0.2 /min
+Comparing different discretization methods for an extracellular
+volume fraction of 0.2 and Ktrans of 0.2 /min
-.. GENERATED FROM PYTHON SOURCE LINES 41-53
+.. GENERATED FROM PYTHON SOURCE LINES 46-58
-.. code-block:: default
+.. code-block:: Python
- ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve) # Defaults to Convolution
- plt.plot(t, ct, 'b-', label='Convolution')
- ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve, discretization_method='exp')
- plt.plot(t, ct, 'g-', label='Exponential Convolution')
- plt.title(f'Ktrans = {Ktrans[1]} /min')
- plt.xlabel('Time (sec)')
- plt.ylabel('Tissue concentration (mM)')
+ ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve) # Defaults to Convolution
+ plt.plot(t, ct, "b-", label="Convolution")
+ ct = osipi.tofts(t, ca, Ktrans=Ktrans[1], ve=ve, discretization_method="exp")
+ plt.plot(t, ct, "g-", label="Exponential Convolution")
+ plt.title(f"Ktrans = {Ktrans[1]} /min")
+ plt.xlabel("Time (sec)")
+ plt.ylabel("Tissue concentration (mM)")
plt.legend()
plt.show()
@@ -133,7 +150,7 @@ Comparing different discretization methods for an extracellular volume fraction
.. rst-class:: sphx-glr-timing
- **Total running time of the script:** (0 minutes 0.093 seconds)
+ **Total running time of the script:** (0 minutes 0.143 seconds)
.. _sphx_glr_download_generated_examples_tissue_plot_tofts.py:
@@ -142,17 +159,14 @@ Comparing different discretization methods for an extracellular volume fraction
.. container:: sphx-glr-footer sphx-glr-footer-example
+ .. container:: sphx-glr-download sphx-glr-download-jupyter
-
+ :download:`Download Jupyter notebook: plot_tofts.ipynb `
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_tofts.py `
- .. container:: sphx-glr-download sphx-glr-download-jupyter
-
- :download:`Download Jupyter notebook: plot_tofts.ipynb `
-
.. only:: html
diff --git a/docs/source/generated/examples/tissue/plot_tofts_codeobj.pickle b/docs/source/generated/examples/tissue/plot_tofts_codeobj.pickle
index dfbf690..deefd59 100755
Binary files a/docs/source/generated/examples/tissue/plot_tofts_codeobj.pickle and b/docs/source/generated/examples/tissue/plot_tofts_codeobj.pickle differ
diff --git a/docs/source/generated/examples/tissue/sg_execution_times.rst b/docs/source/generated/examples/tissue/sg_execution_times.rst
index d653090..b41261a 100755
--- a/docs/source/generated/examples/tissue/sg_execution_times.rst
+++ b/docs/source/generated/examples/tissue/sg_execution_times.rst
@@ -6,7 +6,7 @@
Computation times
=================
-**00:00.113** total execution time for 2 files **from generated/examples/tissue**:
+**00:00.279** total execution time for 2 files **from generated\examples\tissue**:
.. container::
@@ -32,9 +32,9 @@ Computation times
* - Example
- Time
- Mem (MB)
- * - :ref:`sphx_glr_generated_examples_tissue_plot_extended_tofts.py` (``plot_extended_tofts.py``)
- - 00:00.113
- - 0.0
* - :ref:`sphx_glr_generated_examples_tissue_plot_tofts.py` (``plot_tofts.py``)
- - 00:00.000
+ - 00:00.143
+ - 0.0
+ * - :ref:`sphx_glr_generated_examples_tissue_plot_extended_tofts.py` (``plot_extended_tofts.py``)
+ - 00:00.136
- 0.0
diff --git a/docs/source/sg_execution_times.rst b/docs/source/sg_execution_times.rst
index 2f4c88e..2effc0a 100755
--- a/docs/source/sg_execution_times.rst
+++ b/docs/source/sg_execution_times.rst
@@ -6,7 +6,7 @@
Computation times
=================
-**00:00.113** total execution time for 4 files **from all galleries**:
+**00:00.580** total execution time for 4 files **from all galleries**:
.. container::
@@ -32,15 +32,15 @@ Computation times
* - Example
- Time
- Mem (MB)
- * - :ref:`sphx_glr_generated_examples_tissue_plot_extended_tofts.py` (``../examples/tissue/plot_extended_tofts.py``)
- - 00:00.113
+ * - :ref:`sphx_glr_generated_examples_aif_plot_aif_parker.py` (``..\examples\aif\plot_aif_parker.py``)
+ - 00:00.183
- 0.0
- * - :ref:`sphx_glr_generated_examples_aif_plot_aif_parker.py` (``../examples/aif/plot_aif_parker.py``)
- - 00:00.000
+ * - :ref:`sphx_glr_generated_examples_tissue_plot_tofts.py` (``..\examples\tissue\plot_tofts.py``)
+ - 00:00.143
- 0.0
- * - :ref:`sphx_glr_generated_examples_aif_plot_dummy.py` (``../examples/aif/plot_dummy.py``)
- - 00:00.000
+ * - :ref:`sphx_glr_generated_examples_tissue_plot_extended_tofts.py` (``..\examples\tissue\plot_extended_tofts.py``)
+ - 00:00.136
- 0.0
- * - :ref:`sphx_glr_generated_examples_tissue_plot_tofts.py` (``../examples/tissue/plot_tofts.py``)
- - 00:00.000
+ * - :ref:`sphx_glr_generated_examples_aif_plot_dummy.py` (``..\examples\aif\plot_dummy.py``)
+ - 00:00.118
- 0.0