Download BrainWeb MRI data
Project description
Brainweb-DL
Welcome to Brainweb-DL, a powerful Python toolkit for downloading and converting the Brainweb dataset.
Features
-
Effortless Dataset Management: Automatically download, cache, and format the Brainweb dataset with ease. Convert it to the convenient nifti format or numpy array hassle-free.
-
Multiple Image Generation: Generate high-quality T1, T2, T2*, and PD images directly from the Brainweb dataset. Perfect for testing purposes, although keep in mind that the values provided are approximate.
Available data
The Brainweb project kindly provides:
- A normal brain phantom (named subject
0afterwards), with T1, T2 and PD contrasts, with a variety of noise levels and intensity non-uniformities. As well as a anatomical model (in the form of either crisp or fuzzy segmentation of brain tissues, at a fixed resolution of 181x217x181 images). - The same for a multiple sclerosis brain phantom (named subject
1afterwards). - A set of 20 normal brains (with ids equal to
[4, 5, 6, 18, 20, 38, 41-54]) , with a T1 contrast (with 1mm resolution at (181, 217,181)), as well as the crisp and fuzzy segmentation of brain tissues (with a shape of (362, 434,362)) [^1].
This project provides a CLI and a Python API to download and convert theses data. On top of that, it can generate new contrasts (e.g. T2*) from the segmentations, and reshape the data to the desired resolution [^2].
[^1]: Note that the classification of tissue is not the same as for subject 0 and 1 [^2]: This requires scipy to be installed.
Get Started
Data Location
The cached data directory follows this priority order:
- User-specific argument (
brainweb_dirin most functions) BRAINWEB_DIRenvironment variable~/.cache/brainwebfolder
Python Script Usage
from brainweb_dl import get_mri
# Get the phantom with id 44 with a T1 constrast
data = get_mri(sub_id=44, contrast="T1")
# Gt the 3rd phantomn with a fuzzy segmentation of its tissues.
data = get_mri(sub_id="3", contrast="fuzzy")
# Check the docstring for more information.
The Brainweb dataset is downloaded and cached by default in the ~/.cache/brainweb folder.
Command Line Interface
brainweb-dl 44 --contrast=T1
For more information, see brainweb-dl --help.
Installation
Get up and running quickly!
pip install brainweb-dl
Development
Join our community and contribute to Brainweb-DL!
git clone git@github.com/paquiteau/brainweb-dl
cd brainweb-dl
pip install -e .[dev,test,doc]
TODO List
Help us improve and shape the future of Brainweb-DL:
- Add unit tests.
- Implement fuzzy search and multiple subjects download in parallel.
- Develop an interface to generate T1, T2, T2*, and PD images.
- Enhance the search for the location of the Brainweb dataset (User > Environment Variable > Default Location).
- Introduce an interface to download as BIDS format.
Acknowledgement
We extend our gratitude to the following for their contributions:
-
Casper De Clercq for the preliminary work and original idea. Check out his great work if you are interested in PET imaging and registration functionalities.
-
BrainWeb for providing this valuable dataset to the community.
:star2: If you like this work, don't forget to star it and share it 🌟
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_dl-0.4.6.tar.gz.
File metadata
- Download URL: brainweb_dl-0.4.6.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34d684ad376c75df9285bd5123fcbb95e0d8102a22e50ac551434867d02ac722
|
|
| MD5 |
43e2e3b598b3a6c41af93449b0c923e5
|
|
| BLAKE2b-256 |
50b67b754329bc9674bf97564d5676b0e60c8a5cd5a8414443e150e507171633
|
Provenance
The following attestation bundles were made for brainweb_dl-0.4.6.tar.gz:
Publisher:
tags-release.yml on paquiteau/brainweb-dl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brainweb_dl-0.4.6.tar.gz -
Subject digest:
34d684ad376c75df9285bd5123fcbb95e0d8102a22e50ac551434867d02ac722 - Sigstore transparency entry: 575132254
- Sigstore integration time:
-
Permalink:
paquiteau/brainweb-dl@8c795ac957940d781c6dc93e74489fc127a93ff0 -
Branch / Tag:
refs/tags/v0.4.6 - Owner: https://github.com/paquiteau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tags-release.yml@8c795ac957940d781c6dc93e74489fc127a93ff0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brainweb_dl-0.4.6-py3-none-any.whl.
File metadata
- Download URL: brainweb_dl-0.4.6-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13eb1411d61cc3c5553ab2492eacb81f1cbe6952c25d18a4e89ad0a634477e19
|
|
| MD5 |
00914ee34fb91892b11c3f83a3f4f5b9
|
|
| BLAKE2b-256 |
58725b8c0297cbe308dae9e201e55c90eb422d82ce7f187ad5c62966dcb668b1
|
Provenance
The following attestation bundles were made for brainweb_dl-0.4.6-py3-none-any.whl:
Publisher:
tags-release.yml on paquiteau/brainweb-dl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brainweb_dl-0.4.6-py3-none-any.whl -
Subject digest:
13eb1411d61cc3c5553ab2492eacb81f1cbe6952c25d18a4e89ad0a634477e19 - Sigstore transparency entry: 575132268
- Sigstore integration time:
-
Permalink:
paquiteau/brainweb-dl@8c795ac957940d781c6dc93e74489fc127a93ff0 -
Branch / Tag:
refs/tags/v0.4.6 - Owner: https://github.com/paquiteau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tags-release.yml@8c795ac957940d781c6dc93e74489fc127a93ff0 -
Trigger Event:
push
-
Statement type: