brainweb-dl


Namebrainweb-dl JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummaryDownload BrainWeb MRI data
upload_time2024-02-23 15:19:57
maintainer
docs_urlNone
author
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 

data = get_mri(sub_id=44, contrast="T1")
```

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": "",
    "name": "brainweb-dl",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "brainweb,mri,download,data",
    "author": "",
    "author_email": "Pierre-Antoine Comby <pierre-antoine.comby@cea.fr>",
    "download_url": "https://files.pythonhosted.org/packages/06/b9/132b91f65e682e922daefaca64bafdecf7d5d735b9cde67f66d6c7d24945/brainweb-dl-0.2.1.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\ndata = get_mri(sub_id=44, contrast=\"T1\")\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.2.1",
    "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": "90137862074d91d5fa5ea38b80e6e2315d3e0848b40c77625045a53256ebd359",
                "md5": "3f3c9451af477c9d27c5d5a35d1922a4",
                "sha256": "5cbba16ef0a8091516720ad8f09a99c6438adfae37bf5fc35592cc55cbd4fa01"
            },
            "downloads": -1,
            "filename": "brainweb_dl-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3f3c9451af477c9d27c5d5a35d1922a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15190,
            "upload_time": "2024-02-23T15:19:56",
            "upload_time_iso_8601": "2024-02-23T15:19:56.212901Z",
            "url": "https://files.pythonhosted.org/packages/90/13/7862074d91d5fa5ea38b80e6e2315d3e0848b40c77625045a53256ebd359/brainweb_dl-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06b9132b91f65e682e922daefaca64bafdecf7d5d735b9cde67f66d6c7d24945",
                "md5": "66abc40d107a29bae509c9b853b73206",
                "sha256": "dcdda15c721adcd4630478f6ff54ff9f8fd5ebd777e1eafe39f8dfe5f9f6c641"
            },
            "downloads": -1,
            "filename": "brainweb-dl-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "66abc40d107a29bae509c9b853b73206",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18285,
            "upload_time": "2024-02-23T15:19:57",
            "upload_time_iso_8601": "2024-02-23T15:19:57.761290Z",
            "url": "https://files.pythonhosted.org/packages/06/b9/132b91f65e682e922daefaca64bafdecf7d5d735b9cde67f66d6c7d24945/brainweb-dl-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-23 15:19:57",
    "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: 0.19773s