-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simulating MRI signal #55
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,6 +9,8 @@ import osipi | |||||
t = np.arange(0, 6*60, 1) | ||||||
ca = osipi.aif_parker(t) | ||||||
plt.plot(t, ca) | ||||||
plt.xlabel('Time (s)') | ||||||
plt.ylabel('Indicator concentration (mM)') | ||||||
plt.show() | ||||||
``` | ||||||
|
||||||
|
@@ -24,13 +26,55 @@ ca = osipi.aif_parker(t) | |||||
Ktrans = 0.6 | ||||||
ve = 0.2 | ||||||
ct = osipi.tofts(t, ca, Ktrans=Ktrans/60, ve=ve) | ||||||
plt.plot(t, ct) | ||||||
fig, ax = plt.subplots(1, 2) | ||||||
ax[0].plot(t, ca) | ||||||
ax[0].set_xlabel('Time (s)') | ||||||
ax[0].set_ylabel('Indicator concentration (mM)') | ||||||
ax[0].set_title('AIF') | ||||||
ax[1].plot(t, ct) | ||||||
ax[1].set_xlabel('Time (s)') | ||||||
ax[1].set_ylabel('Indicator concentration (mM)') | ||||||
ax[1].set_title('Tissue') | ||||||
|
||||||
fig.tight_layout() | ||||||
plt.show() | ||||||
``` | ||||||
|
||||||
## Generating an MRI signal | ||||||
!!! note "Coming Soon" | ||||||
This section is under development and will be available soon. | ||||||
|
||||||
``` py | ||||||
import numpy as np | ||||||
import matplotlib.pyplot as plt | ||||||
import osipi | ||||||
|
||||||
t = np.arange(0, 6*60, 1) | ||||||
ca = osipi.aif_parker(t) | ||||||
Ktrans = 0.6 | ||||||
ve = 0.2 | ||||||
ct = osipi.tofts(t, ca, Ktrans=Ktrans/60, ve=ve) | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
R10 = 0.5 | ||||||
r1 = 4.5 | ||||||
R1t = osipi.C_to_R1_linear_relaxivity(ct, R10, r1) | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Although maybe not directly related we should probably discuss: Rather than assuming signal_SPGR is the T1 weighted approximation, we should probably make the function general, and have it break down to it's simpler forms based on an argument. If not, we should at least indicate that this model assumes the T2* effects are negligible (maybe in the actual function, rather than in the example... |
||||||
S0 = 1 | ||||||
TR = 0.004 | ||||||
a = 12 | ||||||
St = osipi.signal_SPGR(R1t, S0, TR, a) | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fig, ax = plt.subplots(1, 2) | ||||||
ax[0].plot(t, ct) | ||||||
ax[0].set_xlabel('Time (s)') | ||||||
ax[0].set_ylabel('Indicator concentration (mM)') | ||||||
ax[0].set_title('Concentration') | ||||||
ax[1].plot(t, St) | ||||||
ax[1].set_xlabel('Time (s)') | ||||||
ax[1].set_ylabel('MRI signal (a.u)') | ||||||
ax[1].set_title('MRI signal') | ||||||
|
||||||
fig.tight_layout() | ||||||
plt.show() | ||||||
``` | ||||||
|
||||||
## Adding measurement error | ||||||
!!! note "Coming Soon" | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.