Skip to content

Commit

Permalink
bump version, merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Sep 16, 2020
2 parents 8579ac1 + 7eaa3ee commit c6789d0
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 70 deletions.
24 changes: 19 additions & 5 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"\n",
"- Siemens Biograph mMR resolution (~2mm) & dimensions (127, 344, 344)\n",
"- PET/T1/T2/uMap intensities\n",
" + PET defaults to FDG intensity ratios; could use e.g. Amyloid instead\n",
"- randomised structure for PET/T1/T2\n",
" + $\\bm{\\theta} \\circ (\\bm{1} + \\gamma[2G_\\sigma(\\bm{\\rho}) - \\bm{1}])$\n",
" * $\\bm{\\rho} = rand(127, 344, 344) \\in [0, 1)$\n",
Expand All @@ -105,6 +106,18 @@
" * $\\bm{\\theta}$ is the PET or MR piecewise constant phantom"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# show region probability masks\n",
"PetClass = brainweb.FDG\n",
"label_probs = brainweb.get_label_probabilities(files[-1], labels=PetClass.all_labels)\n",
"volshow(label_probs[brainweb.trim_zeros_ROI(label_probs)], titles=PetClass.all_labels, frameon=False);"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -118,7 +131,7 @@
" f,\n",
" petNoise=1, t1Noise=0.75, t2Noise=0.75,\n",
" petSigma=1, t1Sigma=1, t2Sigma=1,\n",
" PetClass=brainweb.FDG)"
" PetClass=PetClass)"
]
},
{
Expand All @@ -128,13 +141,14 @@
"outputs": [],
"source": [
"# show last subject\n",
"print(f)\n",
"print(files[-1])\n",
"volshow([vol['PET' ][:, 100:-100, 100:-100],\n",
" vol['uMap'][:, 100:-100, 100:-100],\n",
" vol['T1' ][:, 100:-100, 100:-100],\n",
" vol['T2' ][:, 100:-100, 100:-100]],\n",
" cmaps=['hot', 'bone', 'Greys_r', 'Greys_r'],\n",
" titles=[\"PET\", \"uMap\", \"T1\", \"T2\"]);"
" titles=[\"PET\", \"uMap\", \"T1\", \"T2\"],\n",
" frameon=False);"
]
},
{
Expand Down Expand Up @@ -172,9 +186,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
28 changes: 21 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,26 @@ Convert raw image data:

- Siemens Biograph mMR resolution (~2mm) & dimensions (127, 344, 344)
- PET/T1/T2/uMap intensities

- PET defaults to FDG intensity ratios; could use e.g. Amyloid instead

- randomised structure for PET/T1/T2
- t (1 + g [2 G_sigma(r) - 1]), where

- r = rand(127, 344, 344) in [0, 1),
- Gaussian smoothing sigma = 1,
- g = 1 for PET; 0.75 for MR, and
- t = the PET or MR piecewise constant phantom
- t (1 + g [2 G_sigma(r) - 1]), where

- r = rand(127, 344, 344) in [0, 1),
- Gaussian smoothing sigma = 1,
- g = 1 for PET; 0.75 for MR, and
- t = the PET or MR piecewise constant phantom

.. code:: python
# show region probability masks
PetClass = brainweb.FDG
label_probs = brainweb.get_label_probabilities(files[-1], labels=PetClass.all_labels)
volshow(label_probs[brainweb.trim_zeros_ROI(label_probs)], titles=PetClass.all_labels, frameon=False);
.. image:: https://raw.githubusercontent.com/casperdcl/brainweb/master/pmasks.png

.. code:: python
Expand All @@ -116,7 +129,7 @@ Convert raw image data:
f,
petNoise=1, t1Noise=0.75, t2Noise=0.75,
petSigma=1, t1Sigma=1, t2Sigma=1,
PetClass=brainweb.FDG)
PetClass=PetClass)
.. code:: python
Expand All @@ -127,7 +140,8 @@ Convert raw image data:
vol['T1' ][:, 100:-100, 100:-100],
vol['T2' ][:, 100:-100, 100:-100]],
cmaps=['hot', 'bone', 'Greys_r', 'Greys_r'],
titles=["PET", "uMap", "T1", "T2"]);
titles=["PET", "uMap", "T1", "T2"],
frameon=False);
::

Expand Down
2 changes: 1 addition & 1 deletion brainweb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from .utils import __all__ # NOQA
__author__ = "Casper O. da Costa-Luis <casper.dcl@physics.org>"
__licence__ = __license__ = "[MPLv2.0](https://www.mozilla.org/MPL/2.0)"
__version__ = "1.5.2"
__version__ = "1.6.0"
Loading

0 comments on commit c6789d0

Please sign in to comment.