{"id":20075661,"url":"https://github.com/catalyst-team/neuro","last_synced_at":"2025-07-14T13:09:12.820Z","repository":{"id":51282629,"uuid":"240556282","full_name":"catalyst-team/neuro","owner":"catalyst-team","description":"Catalyst.Neuro","archived":false,"fork":false,"pushed_at":"2023-10-03T11:24:22.000Z","size":1389,"stargazers_count":20,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-05T04:03:35.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catalyst-team.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}},"created_at":"2020-02-14T16:51:13.000Z","updated_at":"2025-07-02T11:34:56.000Z","dependencies_parsed_at":"2023-12-18T02:13:15.852Z","dependency_job_id":null,"html_url":"https://github.com/catalyst-team/neuro","commit_stats":{"total_commits":53,"total_committers":6,"mean_commits":8.833333333333334,"dds":0.6415094339622642,"last_synced_commit":"1a7edb66ac6805e6440b5d374e1f61d2a1c40990"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/catalyst-team/neuro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst-team%2Fneuro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst-team%2Fneuro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst-team%2Fneuro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst-team%2Fneuro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catalyst-team","download_url":"https://codeload.github.com/catalyst-team/neuro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst-team%2Fneuro/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264476061,"owners_count":23614434,"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","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":[],"created_at":"2024-11-13T15:00:22.170Z","updated_at":"2025-07-14T13:09:12.794Z","avatar_url":"https://github.com/catalyst-team.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Catalyst.Neuro [![Slack](https://img.shields.io/badge/Catalyst-slack-success)](https://join.slack.com/t/catalyst-team-core/shared_invite/zt-d9miirnn-z86oKDzFMKlMG4fgFdZafw) [![Github contributors](https://img.shields.io/github/contributors/catalyst-team/neuro.svg?logo=github\u0026logoColor=white)](https://github.com/catalyst-team/neuro/graphs/contributors)\n\nThis repository provides a 3D Brain Segmentation Pipeline for a structural\nmagnetic resonance imaging (MRI) scan using the Catalyst\nframework using the Mindboggle Dataset as an example.  It also provides\npre-trained models for Gray Matter White Matter (GMWM) segmentation, 104 class\nbrain atlas segmentation, and 31 class brain atlas segmentation and with usage\nshown in example\n[notebooks](https://github.com/catalyst-team/neuro#example-segmentation-notebooks).\nSegmenting a structural MRI is an important processing step that enables\nsubsequent inferences about tissue changes in development, aging, and disease.\nThis work is based on the following papers: [An (almost) instant brain atlas\nsegmentation for large-scale studies](https://arxiv.org/pdf/1711.00457.pdf) and\n[End-to-end learning of brain tissue segmentation from imperfect\nlabeling](https://arxiv.org/pdf/1612.00940.pdf).\n\nDeveloped in a partnership with\n\n\u003cdiv align=\"center\"\u003e\n\n[![Catalyst logo](https://raw.githubusercontent.com/catalyst-team/catalyst-pics/master/third_party_pics/TReNDS_logo.png)](https://trendscenter.org)\n\n**Brain image analysis**\n\n\u003c/div\u003e\n\n## Pretrained Model Statistics\n\n| Model      | Classes | # of Brains (Training) | # of Brains (Validation) | # of Brains Test | Macro DICE |\n| -----------| ------- | ----------- | ----------- | ----------- | ---------- |\n| MeshNet GMWM | 3 | 20 | 4 | 4 | .9565 |\n| MeshNet Dropout GMWM | 3 | 20 | 4 | 4 | .8748 |\n| MeshNet Large GMWM | 3 | 20 | 4 | 4 | .9652 |\n| MeshNet Large GMWM | 3 | 20 | 4 | 4 | .9624  |\n| UNet GMWM | 3 | 20 | 4 | 4 | .9624 |\n| MeshNet Large Mindboggle | 31 | 70 | 10 | 20 | .6742 |\n| UNet Mindboggle | 31 | 70 | 10 | 20 | .6771 |\n| MeshNet Large HCP Atlas | 104 | 770 | 27 | 100 | ~.85 |\n\n| Model      | Inference Speed | Model Size |\n| -----------| --------------- |----------- |\n| MeshNet GMWM | 116 subvolumes/sec | .89 mb |\n| MeshNet Dropout GMWM | 115 subvolumes/sec | .89 mb |\n| MeshNet Large GMWM | 19 subvolumes/sec | 9mb |\n| MeshNet Large Dropout GMWM | 19 subvolumes/sec | 9mb |\n| UNet GMWM | 13 subvolumes/sec |  288 mb |\n| MeshNet Large Mindboggle | 19 subvolumes/sec |  9 mb |\n| UNet Mindboggle | 13 subvolumes/sec |  288 mb |\n| MeshNet Large HCP Atlas | 18 subvolumes/sec |  10 mb |\n\n\nDownload links are in the Example Segmentation Notebooks\n\n## Example Segmentation Notebooks\n* [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/catalyst-team/neuro/blob/master/examples/GMWM_Prediction_and_Visualization.ipynb) [Gray White Matter Prediction and Visualization](./examples/GMWM_Prediction_and_Visualization.ipynb)\n* [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/catalyst-team/neuro/blob/master/examples/Mindboggle_Prediction_and_Visualization.ipynb) [Mindboggle Prediction and Visualization](./examples/Mindboggle_Prediction_and_Visualization.ipynb)\n* [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/catalyst-team/neuro/blob/master/examples/Neuro_Demo.ipynb) [Neuro UNet/Meshnet training tutorial](./examples/Neuro_Demo.ipynb)\n\n## Training MeshNet on Mindboggle\n\nYou can reproduce MeshNet for Mindboggle with 5 simple steps\n- Install requirements\n    ```bash\n    conda env create -f neuro_conda.yml\n    conda activate neuro\n    pip install -r ./requirements/requirements.txt\n    ```\n- Download data. You need to have an account on the open science framework.\n    ```bash\n    mkdir Mindboggle_data\n    osf -p 9ahyp clone Mindboggle_data\n    cp -r Mindboggle_data/osfstorage/Mindboggle101_volumes/ data/Mindboggle_data/\n\n    If you don't want to make an OSF account the files can also be downloaded\n    the correct folder using these commands:\n\n    download-gdrive 1l3YCRW7ezV9pw0e3aeYDFi4VsAm_DO7l data/Mindboggle_data/\n    download-gdrive 1fxvqrs98F1Gnozg-HsxCjfTrw5zJbQxm data/Mindboggle_data/\n    download-gdrive 1w0VXG7mLkE9tULPIxhnNK0qyguuQ7Zx8 data/Mindboggle_data/\n    download-gdrive 1soDBWB0iXb3Dc1XarSKgfgwiKDInSLQw data/Mindboggle_data/\n    download-gdrive 1jmwE69imokKJJaPKdCNK0Qlxb_r1bGN4 data/Mindboggle_data/\n\n- Unzip data and remove archive files\n    ```bash\n    find data/Mindboggle_101 -name '*.tar.gz'| xargs -i tar zxvf {} -C data/Mindboggle_101\n    find data/Mindboggle_101 -name '*.tar.gz'| xargs -i rm {}\n    ```\n- Prepare data (31 is the number of classes in the example. 102 is the full\n  number of classes in Mindboggle)\n    ```bash\n    python neuro/scripts/prepare_data.py ./data/Mindboggle_101 31\n    ```\n- Start training\n    ```bash\n    python neuro/minimal_example.py\n    ```\n\n## MRI Segmentation Datasets\nMindboggle [dataset](https://mindboggle.readthedocs.io/en/latest/labels.html)\nuses manual annotations which are considered the gold standard. Manually labeling a\nsingle MRI can take a week of expert labeling.  The labeling is done\nusing a 2D display, one slice at a time which can lead to accuracy/ consistency\nissues.  For our pre-trained models, we use automated labels from the Human\nConnectome Project (HCP), which can be downloaded\n[here](https://cran.r-project.org/web/packages/neurohcp/vignettes/hcp.html).\nThe automated labeling tool used (FreeSurfer) employs probabilistic methods\nwith priors to perform segmentation and is the current SOTA.  While running\nFreeSurfer involves more than segmentation, it can take hours to segment a\nsingle MRI from FreeSurfer vs. minutes for a MeshNet model.\n\n\n## HCP Data preparation\n- Prepare **T1 or T2 input** with mri_convert from [FreeSurfer](https://surfer.nmr.mgh.harvard.edu/)\nto conform T1 to 1mm voxel size in coronal slice direction with side length 256.\n**You can skip this step if your T1 image is already with slice thickness 1mm x 1mm x 1mm and 256 x 256 x 256.**\n```\nmri_convert *brainDir*/t1.nii *brainDir*/T1.nii.gz -c\n```\n- Prepare **104 atlas labels** from aparc+aseg.nii.gz for HCP atlas\n  segmentation using:\n```\npython neuro/scripts/prepare_atlas_data.py --brains_list *brains_list.txt*\n```\n- Or Prepare **GMWM labels** from aparc+aseg.mgz using:\n```\n./bin/mk_gwmwm_labels.sh [input_directory] [output_directory]\n```\n\n----\n\n\u003cdiv align=\"center\"\u003e\n\n\n[![Catalyst logo](https://raw.githubusercontent.com/catalyst-team/catalyst-pics/master/pics/catalyst_logo.png)](https://github.com/catalyst-team/catalyst)\n\n**Accelerated Deep Learning R\u0026D**\n\n[![Pipi version](https://img.shields.io/pypi/v/catalyst.svg)](https://pypi.org/project/catalyst/)\n[![Docs](https://img.shields.io/badge/dynamic/json.svg?label=docs\u0026url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcatalyst%2Fjson\u0026query=%24.info.version\u0026colorB=brightgreen\u0026prefix=v)](https://catalyst-team.github.io/catalyst/index.html)\n[![PyPI Status](https://pepy.tech/badge/catalyst)](https://pepy.tech/project/catalyst)\n\n[![Twitter](https://img.shields.io/badge/news-twitter-499feb)](https://twitter.com/CatalystTeam)\n[![Telegram](https://img.shields.io/badge/channel-telegram-blue)](https://t.me/catalyst_team)\n[![Slack](https://img.shields.io/badge/Catalyst-slack-success)](https://join.slack.com/t/catalyst-team-devs/shared_invite/zt-d9miirnn-z86oKDzFMKlMG4fgFdZafw)\n[![Github contributors](https://img.shields.io/github/contributors/catalyst-team/catalyst.svg?logo=github\u0026logoColor=white)](https://github.com/catalyst-team/catalyst/graphs/contributors)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst-team%2Fneuro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalyst-team%2Fneuro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst-team%2Fneuro/lists"}