Multimodal models of 20 normal brains
Project description
The relevant file is README.ipynb, accessible via any of the following:
BrainWeb: Multimodal models of 20 normal brains
Download and Preprocessing for PET-MR Simulations
This notebook will not re-download/re-process files if they already exist.
Output data
~/.brainweb/subject_*.npz: dtype(shape): float32(127, 344, 344)
~/.brainweb/subject_*.bin.gz: dtype(shape): uint16(362, 434, 362)
Prerequisites
Python: requirements.txt (e.g. pip install -r ../../requirements.txt)
Author: Casper da Costa-Luis <casper.dcl@physics.org>
Date: 2017-19
Licence: MPLv2.0
from __future__ import print_function, division
%matplotlib notebook
from utils import volshow
import utils as brainweb
import numpy as np
from os import path
from tqdm.auto import tqdm
import logging
logging.basicConfig(level=logging.INFO)
Raw Data
# download
files = brainweb.get_files()
# read
data = []
for f in tqdm(files, desc="Uncompressing into memory", unit="subject"):
data.append(brainweb.load_file(f))
# show last subject
print(files[-1])
volshow(data[-1]);
~/.brainweb/subject_54.bin.gz
Transform
Convert raw image data:
Siemens Biograph mMR resolution (~2mm) & dimensions (127, 344, 344)
PET/T1/T2/uMap intensities
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
brainweb.seed(1337)
with tqdm(total=len(files), desc="mMR ground truths", unit="subject") as progress:
for (f, vol) in zip(files, data):
cache = f.replace('.bin.gz', '.npz')
vol = brainweb.get_mmr(cache, vol,
petNoise=1, t1Noise=0.75, t2Noise=0.75,
petSigma=1, t1Sigma=1, t2Sigma=1)
progress.update()
# show last subject
#f = files[-1].replace('.bin.gz', '.npz')
#vol = np.load(f)
print(f)
volshow([vol['PET' ][:, 100:-100, 100:-100],
vol['uMap'][:, 100:-100, 100:-100],
vol['T1' ][:, 100:-100, 100:-100],
vol['T2' ][:, 100:-100, 100:-100]],
cmaps=["hot", "bone", "Greys_r", "Greys_r"],
titles=["PET", "uMap", "T1", "T2"]);
~/.brainweb/subject_54.bin.gz
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brainweb-0.2.1.tar.gz.
File metadata
- Download URL: brainweb-0.2.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aec97c9d79d73a982c667bef27f851aba2ef2c05db682727d6675637204a9d96
|
|
| MD5 |
2fb6799a35774e61d6a18daebf9a0e30
|
|
| BLAKE2b-256 |
fd5b991c8eef591b4474fe7399cd7deb683c4277b62e1c88f7aec0bcf5b42750
|
File details
Details for the file brainweb-0.2.1-py2.py3-none-any.whl.
File metadata
- Download URL: brainweb-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21505717ee9ce4659f1e967dbe2c1dcc16d6a85fc256c21ccf0c755423fc8607
|
|
| MD5 |
bef25a515e5fc8a10db8c32391ce12f5
|
|
| BLAKE2b-256 |
ef7aad88f6e70ed034fb7af398d276ddc7126637c80c8497f6d4309378a47af8
|