-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b52e3c7
Showing
167 changed files
with
33,248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 8c6220d7d44658699a85f45a14ded2b0 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
""" | ||
============== | ||
A dummy script | ||
============== | ||
Dummy script to illustrate structure of examples folder | ||
""" | ||
|
||
# %% | ||
# Import necessary packages | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import osipi | ||
|
||
# %% | ||
# Generate synthetic AIF with default settings and plot the result. | ||
|
||
# Define time points in units of seconds - in this case we use a time resolution of 0.5 sec and a total duration of 6 minutes. | ||
t = np.arange(0, 6*60, 0.5) | ||
|
||
# Create an AIF with default settings | ||
ca = osipi.aif_parker(t) | ||
|
||
# Plot the AIF over the full range | ||
plt.plot(t, ca, 'r-') | ||
plt.plot(t, 0*t, 'k-') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.show() | ||
|
||
# %% | ||
# The bolus arrival time (BAT) defaults to 30s. What happens if we change it? Let's try, by changing it in steps of 30s: | ||
|
||
ca = osipi.aif_parker(t, BAT=0) | ||
plt.plot(t, ca, 'b-', label='BAT = 0s') | ||
ca = osipi.aif_parker(t, BAT=30) | ||
plt.plot(t, ca, 'r-', label='BAT = 30s') | ||
ca = osipi.aif_parker(t, BAT=60) | ||
plt.plot(t, ca, 'g-', label='BAT = 60s') | ||
ca = osipi.aif_parker(t, BAT=90) | ||
plt.plot(t, ca, 'm-', label='BAT = 90s') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.legend() | ||
plt.show() | ||
|
||
# %% | ||
# the dose defaults to 0.1- what happens if we change it too? | ||
|
||
ca = osipi.aif_parker(t, BAT=0, dose=0.05) | ||
plt.plot(t, ca, 'b-', label='BAT = 0s, dose = 0.05') | ||
ca = osipi.aif_parker(t, BAT=30, dose=0.1) | ||
plt.plot(t, ca, 'r-', label='BAT = 30s, dose = 0.1') | ||
ca = osipi.aif_parker(t, BAT=60, dose=0.2) | ||
plt.plot(t, ca, 'g-', label='BAT = 60s, dose = 0.2') | ||
ca = osipi.aif_parker(t, BAT=90, dose=0.3) | ||
plt.plot(t, ca, 'm-', label='BAT = 90s, dose = 0.3') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.legend() | ||
plt.show() | ||
|
||
# Choose the last image as a thumbnail for the gallery | ||
# sphinx_gallery_thumbnail_number = -1 |
61 changes: 61 additions & 0 deletions
61
_downloads/63a8dfc7aa971c336ef8774e6dbfd272/plot_dummy.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n# Dummy script as demo\n\nDummy script to show the examples structure. \n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\nimport matplotlib.pyplot as plt\nimport osipi" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Generate synthetic AIF with default settings and plot the result.\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 0.5 sec and a total duration of 6 minutes.\nt = np.arange(0, 6*60, 0.5)\n\n# Create an AIF with default settings\nca = osipi.aif_parker(t)\n\n# Plot the AIF over the full range\nplt.plot(t, ca)\nplt.show()\n\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.10" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
64 changes: 64 additions & 0 deletions
64
_downloads/6794ff0fe2ebfd1be519862fb198ceb5/plot_aif_parker.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
""" | ||
====================================== | ||
The Parker AIF - a play with variables | ||
====================================== | ||
Simulating a Parker AIF with different settings. | ||
""" | ||
|
||
# %% | ||
# Import necessary packages | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import osipi | ||
|
||
# %% | ||
# Generate synthetic AIF with default settings and plot the result. | ||
|
||
# Define time points in units of seconds - in this case we use a time resolution of 0.5 sec and a total duration of 6 minutes. | ||
t = np.arange(0, 6*60, 0.5) | ||
|
||
# Create an AIF with default settings | ||
ca = osipi.aif_parker(t) | ||
|
||
# Plot the AIF over the full range | ||
plt.plot(t, ca, 'r-') | ||
plt.plot(t, 0*t, 'k-') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.show() | ||
|
||
# %% | ||
# The bolus arrival time (BAT) defaults to 30s. What happens if we change it? Let's try, by changing it in steps of 30s: | ||
|
||
ca = osipi.aif_parker(t, BAT=0) | ||
plt.plot(t, ca, 'b-', label='BAT = 0s') | ||
ca = osipi.aif_parker(t, BAT=30) | ||
plt.plot(t, ca, 'r-', label='BAT = 30s') | ||
ca = osipi.aif_parker(t, BAT=60) | ||
plt.plot(t, ca, 'g-', label='BAT = 60s') | ||
ca = osipi.aif_parker(t, BAT=90) | ||
plt.plot(t, ca, 'm-', label='BAT = 90s') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.legend() | ||
plt.show() | ||
|
||
# %% | ||
# the dose defaults to 0.1- what happens if we change it too? | ||
|
||
ca = osipi.aif_parker(t, BAT=0, dose=0.05) | ||
plt.plot(t, ca, 'b-', label='BAT = 0s, dose = 0.05') | ||
ca = osipi.aif_parker(t, BAT=30, dose=0.1) | ||
plt.plot(t, ca, 'r-', label='BAT = 30s, dose = 0.1') | ||
ca = osipi.aif_parker(t, BAT=60, dose=0.2) | ||
plt.plot(t, ca, 'g-', label='BAT = 60s, dose = 0.2') | ||
ca = osipi.aif_parker(t, BAT=90, dose=0.3) | ||
plt.plot(t, ca, 'm-', label='BAT = 90s, dose = 0.3') | ||
plt.xlabel('Time (sec)') | ||
plt.ylabel('Plasma concentration (mM)') | ||
plt.legend() | ||
plt.show() | ||
|
||
# Choose the last image as a thumbnail for the gallery | ||
# sphinx_gallery_thumbnail_number = -1 |
104 changes: 104 additions & 0 deletions
104
_downloads/9dd8307460a64f1314f28e1650ea27b2/plot_aif_parker.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n# The Parker AIF - a play with variables\n\nSimulating a Parker AIF with different settings. \n" | ||
] | ||
}, | ||
{ | ||
"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 matplotlib.pyplot as plt\nimport osipi" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Generate synthetic AIF with default settings and plot the result.\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 0.5 sec and a total duration of 6 minutes.\nt = np.arange(0, 6*60, 0.5)\n\n# Create an AIF with default settings\nca = osipi.aif_parker(t)\n\n# Plot the AIF over the full range\nplt.plot(t, ca, 'r-')\nplt.plot(t, 0*t, 'k-')\nplt.xlabel('Time (sec)')\nplt.ylabel('Plasma concentration (mM)')\nplt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The bolus arrival time (BAT) defaults to 30s. What happens if we change it? Let's try, by changing it in steps of 30s:\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"ca = osipi.aif_parker(t, BAT=0)\nplt.plot(t, ca, 'b-', label='BAT = 0s')\nca = osipi.aif_parker(t, BAT=30)\nplt.plot(t, ca, 'r-', label='BAT = 30s')\nca = osipi.aif_parker(t, BAT=60)\nplt.plot(t, ca, 'g-', label='BAT = 60s')\nca = osipi.aif_parker(t, BAT=90)\nplt.plot(t, ca, 'm-', label='BAT = 90s')\nplt.xlabel('Time (sec)')\nplt.ylabel('Plasma concentration (mM)')\nplt.legend()\nplt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"the dose defaults to 0.1- what happens if we change it too?\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"ca = osipi.aif_parker(t, BAT=0, dose=0.05)\nplt.plot(t, ca, 'b-', label='BAT = 0s, dose = 0.05')\nca = osipi.aif_parker(t, BAT=30, dose=0.1)\nplt.plot(t, ca, 'r-', label='BAT = 30s, dose = 0.1')\nca = osipi.aif_parker(t, BAT=60, dose=0.2)\nplt.plot(t, ca, 'g-', label='BAT = 60s, dose = 0.2')\nca = osipi.aif_parker(t, BAT=90, dose=0.3)\nplt.plot(t, ca, 'm-', label='BAT = 90s, dose = 0.3')\nplt.xlabel('Time (sec)')\nplt.ylabel('Plasma 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.10" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Oops, something went wrong.