Skip to content
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

Develop #3

Merged
merged 7 commits into from
Apr 14, 2022
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
2 changes: 1 addition & 1 deletion .idea/SEPAL.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

**Please note: This library is also hosted in the [OSIPI DCE-DSC-MRI_CodeCollection repository](https://github.com/OSIPI/DCE-DSC-MRI_CodeCollection), where unit tests and perfusion code by other authors can also be found.**

Python library for simulating and fitting DCE-MRI data. It permits arbitrary combinations of pulse sequence, pharmacokinetic model, water exchange model, etc. The code is a work-in-progress, has not been extensively tested and is not recommended or approved for use.
Python library for simulating and fitting DCE-MRI data. It permits arbitrary combinations of pulse sequence, pharmacokinetic model, water exchange model, etc. The code is a work-in-progress, has not been extensively tested and is not recommended or approved for clinical use.

Created 28 September 2020
Created 28 September 2020
@authors: Michael Thrippleton
@email: [email protected]
@institution: University of Edinburgh, UK
Expand All @@ -14,24 +14,22 @@ Created 28 September 2020
- Fit tissue concentration using pharmacokinetic model
- Fit signal enhancement using pharmacokinetic model
- Pharmacokinetic models: steady-state, Patlak, extended Tofts, Tofts, 2CXM, 2CUM
- AIFs: patient-specific (measured), Parker, bi-exponential Parker
- Patlak fitting with multiple linear regression
- AIFs: including patient-specific (measured), Parker, bi-exponential Parker
- Fitting free AIF time delay parameter
- Relaxivity models: linear
- Signal models: spoiled gradient echo
- Water exchange models: FXL, NXL, NXL_be
- T1 fitting using variable flip angle method, IR-SPGR and DESPOT1-HIFI

### Not yet implemented/limitations:
- Generally untested. Not optimised for speed or robustness.
- Additional pharmacokinetic models (add by inheriting from PkModel class)
- Additional relaxivity models (add by inheriting from CRModel class)
- Additional water exchange models, e.g. 3S2X, 2S1X (add by inheriting from WaterExModel class)
- Additional signal models (add by inheriting from SignalModel class)
- R2/R2* effects not included in fitting of enhancement curves (but is included for enhancement-to-concentration conversion)
- Compartment-specific relaxivity parameters/models
- Fitting free water exchange parameters
- Special model implementations, e.g. linear and graphical versions of Patlak model

### TODO:
- fast C calculation for SPGR with r2=0
- inversion recovery T1 measurement
- inversion recovery T1 measurment
100 changes: 100 additions & 0 deletions demo/demo_conc_to_enh.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 34,
"id": "3b2d4aa7-5b11-44fc-ad48-069caaeab47a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"import sys\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"sys.path.append('../src')\n",
"import dce_fit, relaxivity, signal_models, water_ex_models, aifs, pk_models\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "9439e538-cdd8-4849-bedf-1ead532f0811",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x22bbaed05e0>,\n",
" <matplotlib.lines.Line2D at 0x22bbaed0610>]"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAm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kEc7R1P9dHqTcCDXuc5S9buVB9p/hJY/XVeoD0wD9gQ+NjuhNc8GBjbOjw4W+Ok/LOo/hX2GNV7BjfXJjvgo/qHcBPwDIF3/YbBWP4vsApYGfiB6hjuYwFGUf0r9UogP/BnfCRulzOMJRK3ywBgRSBzAfCfgeX1tl30VnoRkQgVCVMoIiJyCipwEZEIpQIXEYlQKnARkQilAhcRiVAqcBGRCKUCFxGJUP8P3RUpr/2wS80AAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"r1, r2 = 5.0, 0\n",
"tr, fa, te = 3.4e-3, 15, 1.7e-3\n",
"t10 = 2\n",
"k_fa = 1.4\n",
"\n",
"enh = np.arange(3000)\n",
"\n",
"c_to_r_model = relaxivity.CRLinear(r1, r2)\n",
"signal_model = signal_models.SPGR(tr, fa, te)\n",
"e_to_c_num = dce_fit.EnhToConc(c_to_r_model, signal_model)\n",
"C_t_num = e_to_c_num.proc(enh, t10, k_fa)\n",
"\n",
"e_to_c_ana = dce_fit.EnhToConcSPGR(tr, fa, r1)\n",
"C_t_ana = e_to_c_ana.proc(enh, t10, k_fa)\n",
"\n",
"plt.plot(enh, C_t_num, 'k-',\n",
" enh, C_t_ana, 'r-')"
]
}
],
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
4 changes: 2 additions & 2 deletions demo/demo_fit_dce.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -598,7 +598,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
Loading