-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
Modified code, tests, docs and examples for S to C.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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: e14b72e891830c1f1d56435aced99033 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
============== | ||
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() | ||
|
||
# Choose the last image as a thumbnail for the gallery | ||
# sphinx_gallery_thumbnail_number = -1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
====================================== | ||
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 0s. 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() | ||
|
||
# Choose the last image as a thumbnail for the gallery | ||
# sphinx_gallery_thumbnail_number = -1 |