项目作者: NatLee

项目描述 :
The project is used to do preprocessing on brain MR images.
高级语言: Python
项目地址: git://github.com/NatLee/Preprocessing-Pipeline-on-Brain-MR-Images.git
创建时间: 2020-01-06T03:32:05Z
项目社区:https://github.com/NatLee/Preprocessing-Pipeline-on-Brain-MR-Images

开源协议:MIT License

下载




# Nipype: Preprocessing Pipeline on Brain MR Images


GM
WM
CSF


Tested on x86/64 Linux-based system.

The project is used to do preprocessing on brain MR images (.nii files).

There is a pipeline include those features:

  • Dockerize the environment
  • Auto AC-PC detection & alignment
  • Registration
  • Skull Stripping
  • Segmentation (using K-means to split GM, WM and CSF)
  • Visualize the results (using nilearn)

All the features implemented as nipype‘s interface are connected in a workflow.

Prerequisites

In this repo, the dataset is downloaded from LONI Image Data Archive (IDA).
Collect and download AD and NC screening sample of ADNI1 and ADNI2, and extract them into this folder.

You can just place the .nii samples in ./data.

If you only have DICOM files, you can use DICOM to NIfTI Online Converter to convert them into NIfTI format.

For example, folder ./data structure is like this:

  1. ./data
  2. ├── 099_S_4206.nii
  3. └── 099_S_4205.nii
  4. 0 directories, 2 files

Usage

  1. Build Neuro Docker image
  1. docker build --tag neuro:latest --file Dockerfile.neuro .
  1. Build custom Docker image

We need to install custom tools in the Docker image.

  1. docker build --tag neuro_custom:latest --file Dockerfile .
  1. Run the workflow
  1. docker run --rm -it \
  2. --workdir /src \
  3. --volume ./src:/src \
  4. --volume ./utils:/utils \
  5. --volume ./data:/data \
  6. --volume ./output:/output \
  7. --name neuro_workflow \
  8. neuro_custom python workflow.py

Results

Segmentation results are shown as cover.

When the workflow ran successfully, all the results of each step will be saved in ./output.

And the workflow graph will be saved in ./src/graph_detailed.png.

workflow

Utilities

The useful Automatic Registration Toolbox we used are listed below:

  • acpcdetect v2.1 Linux
  • ATRA v1.0 Linux

They are downloaded from NITRC and put in ./utils.

Reference

Misc

Generate Neuro Dockerfile and Build Docker Image

  1. Install neurodocker

    1. pip install neurodocker
  2. Generate Dockerfile using neurodocker

    1. neurodocker generate docker \
    2. --pkg-manager apt \
    3. --base-image neurodebian:bullseye \
    4. --fsl version=6.0.5.1 \
    5. --ants version=2.4.1 \
    6. --miniconda version=latest conda_install="nipype" \
    7. > Dockerfile.neuro
  3. Build the docker image with the generated Dockerfile

    1. docker build --tag neuro:latest --file Dockerfile.neuro .

Contributor







Nat Lee
Nat Lee