brainweb-dl


Namebrainweb-dl JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryDownload BrainWeb MRI data
upload_time2024-09-20 08:31:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT License Copyright (c) 2023 Pierre-Antoine Comby Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords brainweb mri download data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Brainweb-DL

Welcome to Brainweb-DL, a powerful Python toolkit for downloading and converting the Brainweb dataset. 

<p align="center">
<a href=https://github.com/paquiteau/brainweb-dl/blob/master/LICENSE><img src=https://img.shields.io/github/license/paquiteau/brainweb-dl></a>
<a href=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl><img src=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl/badge></a>
<a href=https://github.com/psf/black><img src=https://img.shields.io/badge/style-black-black></a>
<a href=https://pypi.org/project/brainweb-dl><img src=https://img.shields.io/pypi/v/brainweb-dl></a>
<a href=https://pypi.org/project/brainweb-dl><img src=https://img.shields.io/pypi/pyversions/brainweb-dl></a>
</p>

## 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 `0` afterwards), 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 `1` afterwards). 
 - 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:

1. User-specific argument (`brainweb_dir` in most functions)
2. `BRAINWEB_DIR` environment variable
3. `~/.cache/brainweb` folder

### Python Script Usage
```python
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

```bash
brainweb-dl 44 --contrast=T1
```

For more information, see `brainweb-dl --help`.

## Installation 

Get up and running quickly!

```bash 
pip install brainweb-dl
```

### Development

Join our community and contribute to Brainweb-DL!

```bash
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:

- [x] Add unit tests.
- [x] Implement fuzzy search and multiple subjects download in parallel.
- [x] Develop an interface to generate T1, T2, T2*, and PD images.
- [x] 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](https://github.com/casperdcl/brainweb/) for the preliminary work and original idea. Check out his great work if you are interested in PET imaging and registration functionalities.

- [BrainWeb](https://brainweb.bic.mni.mcgill.ca/) for providing this valuable dataset to the community.



<p align=center> :star2: If you like this work, don't forget to star it and share it 🌟 </p>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "brainweb-dl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "brainweb, mri, download, data",
    "author": null,
    "author_email": "Pierre-Antoine Comby <pierre-antoine.comby@cea.fr>",
    "download_url": "https://files.pythonhosted.org/packages/91/d3/0e31076c492b1798c8420895118e1e65fabc1149726cdff435e77fb9650c/brainweb_dl-0.3.0.tar.gz",
    "platform": null,
    "description": "# Brainweb-DL\n\nWelcome to Brainweb-DL, a powerful Python toolkit for downloading and converting the Brainweb dataset. \n\n<p align=\"center\">\n<a href=https://github.com/paquiteau/brainweb-dl/blob/master/LICENSE><img src=https://img.shields.io/github/license/paquiteau/brainweb-dl></a>\n<a href=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl><img src=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl/badge></a>\n<a href=https://github.com/psf/black><img src=https://img.shields.io/badge/style-black-black></a>\n<a href=https://pypi.org/project/brainweb-dl><img src=https://img.shields.io/pypi/v/brainweb-dl></a>\n<a href=https://pypi.org/project/brainweb-dl><img src=https://img.shields.io/pypi/pyversions/brainweb-dl></a>\n</p>\n\n## Features\n\n- **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.\n\n- **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.\n\n### Available data \n\nThe Brainweb project kindly provides:\n \n - A normal brain phantom (named subject `0` afterwards), 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).\n - The same for a multiple sclerosis brain phantom (named subject `1` afterwards). \n - 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].\n \nThis 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].\n\n\n[^1]: Note that the classification of tissue is not the same as for subject 0 and 1\n[^2]: This requires scipy to be installed. \n\n## Get Started\n\n### Data Location\n\nThe cached data directory follows this priority order:\n\n1. User-specific argument (`brainweb_dir` in most functions)\n2. `BRAINWEB_DIR` environment variable\n3. `~/.cache/brainweb` folder\n\n### Python Script Usage\n```python\nfrom brainweb_dl import get_mri \n\n# Get the phantom with id 44 with a T1 constrast \ndata = get_mri(sub_id=44, contrast=\"T1\") \n# Gt the 3rd phantomn with a fuzzy segmentation of its tissues. \ndata = get_mri(sub_id=\"3\", contrast=\"fuzzy\") \n\n# Check the docstring for more information.\n```\n\nThe Brainweb dataset is downloaded and cached by default in the `~/.cache/brainweb` folder.\n\n### Command Line Interface\n\n```bash\nbrainweb-dl 44 --contrast=T1\n```\n\nFor more information, see `brainweb-dl --help`.\n\n## Installation \n\nGet up and running quickly!\n\n```bash \npip install brainweb-dl\n```\n\n### Development\n\nJoin our community and contribute to Brainweb-DL!\n\n```bash\ngit clone git@github.com/paquiteau/brainweb-dl \ncd brainweb-dl\npip install -e .[dev,test,doc]\n```\n\n### TODO List\nHelp us improve and shape the future of Brainweb-DL:\n\n- [x] Add unit tests.\n- [x] Implement fuzzy search and multiple subjects download in parallel.\n- [x] Develop an interface to generate T1, T2, T2*, and PD images.\n- [x] Enhance the search for the location of the Brainweb dataset (User > Environment Variable > Default Location).\n- [ ] Introduce an interface to download as BIDS format.\n\n## Acknowledgement\n\nWe extend our gratitude to the following for their contributions:\n\n- [Casper De Clercq](https://github.com/casperdcl/brainweb/) for the preliminary work and original idea. Check out his great work if you are interested in PET imaging and registration functionalities.\n\n- [BrainWeb](https://brainweb.bic.mni.mcgill.ca/) for providing this valuable dataset to the community.\n\n\n\n<p align=center> :star2: If you like this work, don't forget to star it and share it \ud83c\udf1f </p>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Pierre-Antoine Comby  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Download BrainWeb MRI data",
    "version": "0.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/paquiteau/brainweb-dl/issues",
        "Homepage": "https://github.com/paquiteau/brainweb-dl",
        "Source": "https://github.com/paquiteau/brainweb-dl"
    },
    "split_keywords": [
        "brainweb",
        " mri",
        " download",
        " data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "584288452889466071179f3958b959c426213f0dd70de16e72c363d8581c51f6",
                "md5": "3cd6baadafe50b111baae0dc7fc4a982",
                "sha256": "24e8fcf60f6154708d3165559fc776e843a4050e25d6465b7251e6810846ca51"
            },
            "downloads": -1,
            "filename": "brainweb_dl-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3cd6baadafe50b111baae0dc7fc4a982",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15818,
            "upload_time": "2024-09-20T08:31:04",
            "upload_time_iso_8601": "2024-09-20T08:31:04.375993Z",
            "url": "https://files.pythonhosted.org/packages/58/42/88452889466071179f3958b959c426213f0dd70de16e72c363d8581c51f6/brainweb_dl-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91d30e31076c492b1798c8420895118e1e65fabc1149726cdff435e77fb9650c",
                "md5": "52983f85f1a32be25b0f12ab95b3ed82",
                "sha256": "87d757c87b9b78d22aed3ced2e44f0a6896fa8ad6b533f4a6191ec1aa25ac3f5"
            },
            "downloads": -1,
            "filename": "brainweb_dl-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "52983f85f1a32be25b0f12ab95b3ed82",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18962,
            "upload_time": "2024-09-20T08:31:05",
            "upload_time_iso_8601": "2024-09-20T08:31:05.384520Z",
            "url": "https://files.pythonhosted.org/packages/91/d3/0e31076c492b1798c8420895118e1e65fabc1149726cdff435e77fb9650c/brainweb_dl-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-20 08:31:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "paquiteau",
    "github_project": "brainweb-dl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "brainweb-dl"
}
        
Elapsed time: 4.86953s