{"id":34793878,"url":"https://github.com/paquiteau/brainweb-dl","last_synced_at":"2026-03-16T19:32:13.357Z","repository":{"id":169875829,"uuid":"645810752","full_name":"paquiteau/brainweb-dl","owner":"paquiteau","description":"Brainweb Dataset downloader","archived":false,"fork":false,"pushed_at":"2025-08-23T09:45:13.000Z","size":181,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T09:16:43.904Z","etag":null,"topics":["brainweb","dataset","downloader","mri","phantom"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paquiteau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-26T13:41:09.000Z","updated_at":"2025-08-23T09:45:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6f6ad0e-a2b2-4505-a8d5-4f9cb050d0bf","html_url":"https://github.com/paquiteau/brainweb-dl","commit_stats":null,"previous_names":["paquiteau/brainweb-dl"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/paquiteau/brainweb-dl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paquiteau%2Fbrainweb-dl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paquiteau%2Fbrainweb-dl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paquiteau%2Fbrainweb-dl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paquiteau%2Fbrainweb-dl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paquiteau","download_url":"https://codeload.github.com/paquiteau/brainweb-dl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paquiteau%2Fbrainweb-dl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28026682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brainweb","dataset","downloader","mri","phantom"],"created_at":"2025-12-25T10:01:30.729Z","updated_at":"2025-12-25T10:02:12.948Z","avatar_url":"https://github.com/paquiteau.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainweb-DL\n\nWelcome to Brainweb-DL, a powerful Python toolkit for downloading and converting the Brainweb dataset. \n\n\u003cp align=\"center\"\u003e\n\u003ca href=https://github.com/paquiteau/brainweb-dl/blob/master/LICENSE\u003e\u003cimg src=https://img.shields.io/github/license/paquiteau/brainweb-dl\u003e\u003c/a\u003e\n\u003ca href=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl\u003e\u003cimg src=https://www.codefactor.io/repository/github/paquiteau/brainweb-dl/badge\u003e\u003c/a\u003e\n\u003ca href=https://github.com/psf/black\u003e\u003cimg src=https://img.shields.io/badge/style-black-black\u003e\u003c/a\u003e\n\u003ca href=https://pypi.org/project/brainweb-dl\u003e\u003cimg src=https://img.shields.io/pypi/v/brainweb-dl\u003e\u003c/a\u003e\n\u003ca href=https://pypi.org/project/brainweb-dl\u003e\u003cimg src=https://img.shields.io/pypi/pyversions/brainweb-dl\u003e\u003c/a\u003e\n\u003c/p\u003e\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 \u003e Environment Variable \u003e 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\u003cp align=center\u003e :star2: If you like this work, don't forget to star it and share it 🌟 \u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaquiteau%2Fbrainweb-dl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaquiteau%2Fbrainweb-dl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaquiteau%2Fbrainweb-dl/lists"}