{"id":21250924,"url":"https://github.com/natlee/nipype-preprocess-on-brain-mr","last_synced_at":"2025-07-11T01:31:42.756Z","repository":{"id":41555981,"uuid":"232017353","full_name":"NatLee/nipype-preprocess-on-brain-MR","owner":"NatLee","description":"The project is used to do preprocessing on brain MR images by using Nipype.","archived":false,"fork":false,"pushed_at":"2024-06-18T01:03:49.000Z","size":3803,"stargazers_count":36,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T19:04:32.731Z","etag":null,"topics":["acpc","ants","bias-field-correction","brain","brain-imaging","brain-mri","brain-segmentation","dockerfile","enhancement","fsl","medical-image-processing","mr","mri","nipype","pipeline","python","registration","segmentation","skull-stripping"],"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/NatLee.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}},"created_at":"2020-01-06T03:32:05.000Z","updated_at":"2025-02-28T20:37:38.000Z","dependencies_parsed_at":"2024-11-21T04:02:08.833Z","dependency_job_id":null,"html_url":"https://github.com/NatLee/nipype-preprocess-on-brain-MR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NatLee/nipype-preprocess-on-brain-MR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Fnipype-preprocess-on-brain-MR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Fnipype-preprocess-on-brain-MR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Fnipype-preprocess-on-brain-MR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Fnipype-preprocess-on-brain-MR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NatLee","download_url":"https://codeload.github.com/NatLee/nipype-preprocess-on-brain-MR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLee%2Fnipype-preprocess-on-brain-MR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264705088,"owners_count":23652153,"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":["acpc","ants","bias-field-correction","brain","brain-imaging","brain-mri","brain-segmentation","dockerfile","enhancement","fsl","medical-image-processing","mr","mri","nipype","pipeline","python","registration","segmentation","skull-stripping"],"created_at":"2024-11-21T03:39:37.208Z","updated_at":"2025-07-11T01:31:41.532Z","avatar_url":"https://github.com/NatLee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n\n# **Nipype: Preprocessing Pipeline on Brain MR Images**\n\n\u003cp style=\"text-align: center\"\u003e\n  \u003cimg align=\"center\" src=\"./docs/GM@map.png\" alt=\"GM\" width=\"70%\" height=\"100%\"\u003e\n  \u003cimg align=\"center\" src=\"./docs/WM@map.png\" alt=\"WM\" width=\"70%\" height=\"100%\"\u003e\n  \u003cimg align=\"center\" src=\"./docs/CSF@map.png\" alt=\"CSF\" width=\"70%\" height=\"100%\"\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003e Tested on x86/64 Linux-based system.\n\nThe project is used to do preprocessing on brain MR images (`.nii` files).\n\nThere is a pipeline include those features:\n\n- Dockerize the environment\n- Auto AC-PC detection \u0026 alignment\n- Registration\n- Skull Stripping\n- Segmentation (using `K-means` to split GM, WM and CSF)\n- Visualize the results (using `nilearn`)\n\nAll the features implemented as `nipype`'s interface are connected in a workflow.\n\n## Prerequisites\n\nIn this repo, the dataset is downloaded from [LONI Image Data Archive (IDA)](https://ida.loni.usc.edu/login.jsp).\nCollect and download AD and NC screening sample of ADNI1 and ADNI2, and extract them into this folder.  \n\nYou can just place the `.nii` samples in `./data`.\n\n\u003e If you only have DICOM files, you can use [DICOM to NIfTI Online Converter](https://www.onlineconverter.com/dicom-to-nifti) to convert them into NIfTI format.\n\nFor example, folder `./data` structure is like this:\n\n```\n./data\n├── 099_S_4206.nii\n└── 099_S_4205.nii\n\n0 directories, 2 files\n```\n\n## Usage\n\n1. Build Neuro Docker image\n\n```bash\ndocker build --tag neuro:latest --file Dockerfile.neuro .\n```\n\n2. Build custom Docker image\n\n\u003e We need to install custom tools in the Docker image.\n\n```bash\ndocker build --tag neuro_custom:latest --file Dockerfile .\n```\n\n3. Run the workflow\n\n```bash\ndocker run --rm -it \\\n    --workdir /src \\\n    --volume ./src:/src \\\n    --volume ./utils:/utils \\\n    --volume ./data:/data \\\n    --volume ./output:/output \\\n    --name neuro_workflow \\\n    neuro_custom python workflow.py\n```\n\n### Results\n\nSegmentation results are shown as cover.\n\nWhen the workflow ran successfully, all the results of each step will be saved in `./output`.\n\nAnd the workflow graph will be saved in `./src/graph_detailed.png`.\n\n![workflow](./docs/graph_detailed.png)\n\n## Utilities\n\nThe useful `Automatic Registration Toolbox` we used are listed below:\n\n- acpcdetect v2.1 Linux\n- ATRA v1.0 Linux\n\nThey are downloaded from [NITRC](https://www.nitrc.org/projects/art) and put in `./utils`.\n\n## Reference\n\n- [quqixun/BrainPrep](https://github.com/quqixun/BrainPrep)\n- [nipype](https://nipype.readthedocs.io/en/latest/)\n- [nilearn](https://nilearn.github.io/)\n- [neurodocker](https://github.com/ReproNim/neurodocker)\n\n## Misc\n\n### Generate Neuro Dockerfile and Build Docker Image\n\n1. Install `neurodocker`\n    ```bash\n    pip install neurodocker\n    ```\n\n2. Generate Dockerfile using `neurodocker`\n    ```bash\n    neurodocker generate docker \\\n        --pkg-manager apt \\\n        --base-image neurodebian:bullseye \\\n        --fsl version=6.0.5.1 \\\n        --ants version=2.4.1 \\\n        --miniconda version=latest conda_install=\"nipype\" \\\n    \u003e Dockerfile.neuro\n    ```\n\n3. Build the docker image with the generated Dockerfile\n    ```bash\n    docker build --tag neuro:latest --file Dockerfile.neuro .\n    ```\n\n## Contributor\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/NatLee\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/10178964?v=3?s=100\" width=\"100px;\" alt=\"Nat Lee\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNat Lee\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlee%2Fnipype-preprocess-on-brain-mr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatlee%2Fnipype-preprocess-on-brain-mr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlee%2Fnipype-preprocess-on-brain-mr/lists"}