Giter Club home page Giter Club logo

neurolearn's Introduction

Build Status

neurolearn

Python toolbox for analyzing neuroimaging data. It is based off of Tor Wager's object oriented matlab canlab core tools and relies heavily on nilearn and scikit learn

Current Tools

  • data.Brain_Data: Class to work with 4D imaging data in Python
  • data.Brain_Data.predict: Multivariate Prediction
  • data.Brain_Data.similarity: Calculate spatial similarity with another image
  • data.Brain_Data.distance: Calculate spatial distance of a group of images
  • data.Brain_Data.regress: Univariate Regression
  • data.Brain_Data.ttest: Univariate One Sample t-test
  • analysis.Roc: perform ROC analysis
  • pipelines.Couple_Preproc_Pipeline: preprocessing pipeline for multiband data
  • simulator.Simulator: Class for simulating multivariate data
  • mask.create_sphere: Create spherical masks

Installation

  1. Method 1

    git clone git+https://github.com/ljchang/neurolearn
    
  2. Method 2

    git clone https://github.com/ljchang/neurolearn
    python setup.py install
    

Documentation

Current Documentation can be found at readthedocs. Please see the ipython notebook examples for walkthroughs of how to use most of the toolbox.

Here is a jupyter notebook with a detailed overview of how to use the main Brain_Data class. We also have a notebook containing other analysis methods such as prediction and ROI curves (note it is now recommended to use the prediction Brain_Data method).

Preprocessing

Here is an example preprocessing pipeline for multiband data. It uses nipype and tools from SPM12 and FSL. Make sure that fsl, matlab, dcm2nii are on your unix environment path. It might be helpful to create a symbolic link somewhere common like /usr/local/bin. This pipeline can be run on a cluster see nipype workflow documentaiton. The nipype folder is quite large due to matlab's need for unzipped .nii files. It can be deleted if space is an issue.

  • Uses Chris Rorden's dcm2nii to convert dcm to nii
  • Uses Nipy's Trim to remove the first 10 volumes (i.e., disdaqs)
  • Uses FSL's topup to perform distortion correction. Default is AP (need to switch order of concatentation if PA is needed)
  • Uses SPM12 realignment to mean
  • Uses SPM12 to coregister functional to structural
  • Uses SPM12 new nonlinear normalization routine
  • Uses SPM12 smoothing with 6mm fwhm as default
  • Uses Artifact Detection Toolbox to detect scanner spikes.
  • Uses Nipype Datasink to write out key files to new output directory under subject name
  • Will create a quick montage to check normalization
  • Will output a plot of realignment parameters
  • Will output a covariate csv file with 24 parameter centered motion parameters, their squares, and the 12 derivatives (6 motion + 6 squared motion).

Here is an example script.

from nltools.pipelines import Couple_Preproc_Pipeline
import os

base_dir = '/Users/lukechang/Dropbox/Couple_Conflict/Data/Scanner'
spm_path = '/Users/lukechang/Resources/spm12/'
output_dir = '/Users/lukechang/Dropbox/Couple_Conflict/Data/Imaging'

# Get Subject ID
subject_list = os.listdir(os.path.join(base_dir))
subject_id = subject_list[1]

#Run Pipeline
wf = Couple_Preproc_Pipeline(base_dir=base_dir, output_dir=output_dir, subject_id=subject_id, spm_path=spm_path)
# wf.run('MultiProc', plugin_args={'n_procs': 8}) # This command runs the pipeline in parallel (using 8 cores)
wf.write_graph(dotfilename=os.path.join(output_dir,'Workflow_Pipeline.dot'),format='png')
wf.run()

pipeline

neurolearn's People

Contributors

burnash avatar ejolly avatar greydanus avatar ljchang avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

devhliu

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.