Skip to content

Commit

Permalink
Merge pull request #1 from mjt320/develop
Browse files Browse the repository at this point in the history
major update
  • Loading branch information
mjt320 authored Jan 28, 2022
2 parents 43c504b + 5e50834 commit 02eabb9
Show file tree
Hide file tree
Showing 42 changed files with 3,416 additions and 2,166 deletions.
7 changes: 5 additions & 2 deletions .idea/SEPAL.iml

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

9 changes: 9 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ Created 28 September 2020
- Fit signal enhancement using pharmacokinetic model
- Pharmacokinetic models: steady-state, Patlak, extended Tofts, Tofts, 2CXM, 2CUM
- AIFs: patient-specific (measured), Parker, bi-exponential Parker
- Fitting an AIF time delay
- 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 pk_model class)
- Additional relaxivity models (add by inheriting from c_to_r_model class)
- Additional AIF functions (add by inheriting from aif class)
- Additional water exchange models, e.g. 3S2X, 2S1X (add by inheriting from water_ex_model class)
- Additional signal models (add by inheriting from signal_model class)
- 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:
- Convert fitting functions to OO methods. Add image processing functions.
- Parallel
- Calculate IRF integrals exactly.
### TODO:
- linear Patlak model
- option to truly constrain k in HIFI fit
- fast C calculation for SPGR with r2=0
- inversion recovery T1 measurement
Binary file added demo/DCE_ROI_data/k_tissue.npy
Binary file not shown.
Binary file added demo/DCE_ROI_data/k_vif.npy
Binary file not shown.
Binary file added demo/DCE_ROI_data/signal_tissue.npy
Binary file not shown.
Binary file added demo/DCE_ROI_data/signal_vif.npy
Binary file not shown.
Binary file added demo/DCE_ROI_data/t1_tissue.npy
Binary file not shown.
Binary file added demo/DCE_ROI_data/t1_vif.npy
Binary file not shown.
Binary file added demo/T1_data/FA12.nii.gz
Binary file not shown.
Binary file added demo/T1_data/FA2.nii.gz
Binary file not shown.
Binary file added demo/T1_data/FA5.nii.gz
Binary file not shown.
Binary file added demo/T1_data/TI_1068ms.nii.gz
Binary file not shown.
Binary file added demo/T1_data/TI_168ms.nii.gz
Binary file not shown.
Binary file added demo/T1_data/mask.nii.gz
Binary file not shown.
296 changes: 296 additions & 0 deletions demo/demo_aif_module.ipynb

Large diffs are not rendered by default.

545 changes: 545 additions & 0 deletions demo/demo_fit_dce.ipynb

Large diffs are not rendered by default.

465 changes: 465 additions & 0 deletions demo/demo_fit_t1.ipynb

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions demo/demo_pk_models.ipynb

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions demo/demo_relaxivity_module.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "fifty-passport",
"metadata": {},
"source": [
"## Relaxivity module demo"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "internal-arbor",
"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 relaxivity\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "markdown",
"id": "arabic-latvia",
"metadata": {},
"source": [
"### The CRModel class\n",
"This is an abstract base class. Subclasses represent specific relaxivity models. \n",
"The main function of these objects is to return relaxation rates as a function of contrast agent concentration. \n",
"At the moment, only the linear model is implemented:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "4080ceab-24f8-4b2e-b57d-816474887489",
"metadata": {},
"outputs": [],
"source": [
"cr_model = relaxivity.CRLinear(r1=5.0, r2=7.1)"
]
},
{
"cell_type": "markdown",
"id": "52762d06-81e5-4153-88f5-5d0e827d7f82",
"metadata": {},
"source": [
"Now we can use the R1 and R2 methods to calculate the relaxation rates for a given concentration and pre-contrast relaxation rate values:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "a3c01c12-fb5e-4aed-b9fb-b882270ba27f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1. 6. 11. 16. 21. 26.]\n"
]
}
],
"source": [
"C_t = np.array([0, 1, 2, 3, 4, 5])\n",
"R10 = 1\n",
"R1_post = cr_model.R1(R10, C_t)\n",
"print(R1_post)"
]
},
{
"cell_type": "markdown",
"id": "4a7c1681-7e9d-49b2-9474-56f86a8f25ef",
"metadata": {},
"source": [
"Additional subclasses could be implemented to represent other concentration-relaxation relationships, e.g. quadratic."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
108 changes: 108 additions & 0 deletions demo/demo_signal_models.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "eb332c7d-4589-47da-81d0-e2697ee70254",
"metadata": {},
"source": [
"## Signal models demo"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "42671502-6096-4107-8c21-3f876b950a66",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import sys\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"sys.path.append('../src')\n",
"import signal_models\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "markdown",
"id": "33acaa3b-10e0-454f-b62b-6a2cb5b1d0f4",
"metadata": {},
"source": [
"### The SignalModel Class\n",
"This abstract base class represents different signal models i.e. conversion between relaxation parameters and signal intensity for a given pulse sequence. The model is defined by specifying the sequence parameters. At present, only the SPGR signal model is implemented:"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "c2e14ed8-c6f6-4e79-9fe0-fbc9b323d156",
"metadata": {},
"outputs": [],
"source": [
"sm = signal_models.SPGR(tr=5e-3, fa=15, te=1.5e-3)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "25cb9206-ef8d-4d4f-bf82-779d9463530a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'signal')"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq/5QAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAgG0lEQVR4nO3deZhU1Z3/8fe394XeNxp6YxcEBQREcUGJilsck4yJE6MxJvjLaHYdTeLvmSxPEpOZONnml8RRRxOjWYy7RsUlalwB2deWraG76ZXe9+7z+6MKbRGwka663fd+Xs9TT9W9XcX9HoEPx1PnnmPOOUREJDhivC5ARESiS8EvIhIw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text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"R1_range = np.linspace(0.5, 50, 100)\n",
"s = sm.R_to_s(s0=100, R1=R1_range, R2s=0, k_fa=1)\n",
"\n",
"plt.plot(R1_range, s)\n",
"plt.xlabel('R1 (/s)')\n",
"plt.ylabel('signal')"
]
}
],
"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
}
Loading

0 comments on commit 02eabb9

Please sign in to comment.