Giter Club home page Giter Club logo

brainprep's Introduction

Preprocessing on Brain MRI Sequence

This is a pipeline to do preprocessing on brain MR images of ADNI dataset
by using FMRIB Software Library (FSL) and Advanced Normalization Tools (ANTs).

1. Install FSL & ANTs

Download and install FSL as instructions here.
Compile ANTs from source code in Linux and macOS, or in Windows 10.

2. Install Python Packages

All required libraries are listed as below:

  • tqdm
  • numpy
  • scipy
  • nipype
  • nibabel
  • matplotlib
  • sciKit-fuzzy (optional)
  • scikit-learn (optional)

3. Download Dataset

The dataset used in this repo is AD and NC screening images of ADNI1 and ADNI2.
See README.md in data.

Here is one sample of original image.

original image

4. Reorgnization Files

Switch the working directory to src. Run reorgnize.py, which merge ADNI1 and ADNI2 into one folder.

python reorgnize.py

5. Registration

Run registraion.py to transform images into the coordinate system of template by FSL FLIRT.

python registraion.py

The output of the above image from this step looks like:

registration

6. Skull-Strpping

Run skull_stripping.py to remove skull from registrated images by FSL BET.

python skull_stripping.py

Output:

skull stripping

7. Bias Field Correction

Run bias_correction.py to remove bias-field signal from images by ANTs.

python bias_correction.py

Output:

bias field correction

8. Enhancement (optional)

Based on outputs from step 7, run enhancement.py to enhance images by histogram equalization.

python enahncement.py

9. Tissue Segmentation (optional)

Based on outputs from step 7, run segment.py to segment brain into GM, WM and CSF
by KMeans or Fuzzy-CMeans (you should change settings in script).

python segment.py

Or run fast_segment.py to do segmentation by FSL FAST.

python fast_segment.py

brainprep's People

Contributors

quqixun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

brainprep's Issues

Can't Find the dataset used

I registered on the site you gave for the dataset but I can't find your dataset inside the website. Can you give any further indications, please?

scripts shouldn't have code that will run if imported

In general scripts shouldn't run functions when imported, which is what would happen with the scripts located in src/.

To only run code when being called as a script (and not from the import function) use:

if __name__ == '__main__':
    # run functions here

This will prevent code being run if the user wishes to import the functions defined within the modules.

scns are in one file

GM,WM, and CSF all three are in one file. can you please tell how you separate all three and save in separate Dicom or nifti files

hi

hi there are some code cant use

N4BiasFieldCorrection issues

I encountered the following problem when running bias_correction.py
OSError: No command "N4BiasFieldCorrection" found on host ubuntu. Please check that the corresponding package is installed.

But I have successfully installed ANTs, and when I try to run which antsRegistration* in the terminal, it returns the Ant installation directory /opt/ANTs/bin//antsRegistration

So how to solve the problem? Looking forward to your reply,thx!

Qustions about application in general brain preprocessing

Hi, I want to apply the pipeline to process nomral mri with 1 nii file for each subject. But I currently has no access to test dataset used in the profile, I am not clear about the reorganize and registration part, wether they work the same or just to skip the steps. A little bit explaination about relationship between NC1/2 and AD1/2 can help a lot, like whether they are from the same subject at diffrent stage and whether they are different modalities. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.