Software Setup

From Brain Development & Education Lab Wiki
Revision as of 18:16, 13 July 2016 by Dstrodtman (Talk | contribs)

Jump to: navigation, search

We rely on a number of different software packages to analyze MRI and MEG data. Here is a growing tally of what we use and where to get it. Most of these tools reside on github and you should definitely use git to clone the repositories rather than download a snapshot of the code.

Setting up a user account

To add a new user with sudo privileges (userid should be maintained across all systems).

sudo useradd -m -G bde,sudo -s /bin/bash userid

To set user password.

sudo passwd userid

Have new user enter desired password.

Git

All git directories should be maintained together.

mkdir ~/git

Yeatman Lab Tools

cd ~/git
git clone https://github.com/yeatmanlab/BrainTools.git

Vistasoft

MATLAB based toolbox, from Brian Wandell's lab at Stanford, that contains many functions we rely on for analyzing diffusion MRI and functional MRI data

cd ~/git
git clone https://github.com/vistalab/vistasoft.git

Automated Fiber Quantification

cd ~/git
git clone https://github.com/jyeatman/AFQ.git

Setting up Matlab for AFQ

AFQ requires Matlab r2014a, SPM8, Vistasoft, and AFQ. If you wish to use a different version of Matlab for your core coding, you can set aliases in your ~/.bashrc file

alias matlabr2016="/usr/local/MATLAB/R2016a/bin/matlab"

For Matlab to see all of the necessary code create a file named startup.m and place it in your home directory. The startup file gets executed automatically when Matlab starts up. To add folders of code to your Matlab search path (making it visible to Matlab):

addpath(genpath('~/Documents/MATLAB/spm8/'))
addpath(genpath('~/git/AFQ/'))
addpath(genpath('~/git/BrainTools/'))
addpath(genpath('~/git/vistasoft/'))

Anaconda

Each user should have anaconda set up to manage their Python packages. Do this before installing nibabel and dipy. Anaconda will manage versions and dependencies for each user separately. Each install will be specific to the user that installs it. Do not install as root, as you will deny yourself privileges to your own directory. You must restart your terminal session after install before using Python or the conda command. See instructions here:

https://www.continuum.io/downloads

nibabel and DIPY

Python based toolbox for dealing with nifti images. While nibabel is on github we suggest installing using pip:

pip install nibabel
pip install dipy

pyAFQ

While we are still in the processing of developing a full implementation of AFQ in Python, some of these files are required for running DKI.

cd ~/git
git clone https://github.com/yeatmanlab/pyAFQ
cd pyAFQ
python setup.py develop
pip install boto3

Neurodebian repo

The neurodebian project is an incredible resource making it easy to install most of the widely used nueroimaging software packages.

wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9
sudo apt-get update

FSL, ANTS and other Neurodebian packages

Once you have added the neurodebian repos you can easily install fsl and other packages

sudo apt-get install fsl-5.0-complete
sudo apt-get install fsl-5.0-eddy-nonfree
sudo apt-get install ants

FSL requires an edit to the .bashrc file

gedit ~/.bashrc

Copy the following into the file that open

# FSL setup
. /etc/fsl/5.0/fsl.sh

Freesurfer

The steps and download is here, instructions are repeated below. Download the Linux CentOS 6 x86_64 install file.

cd ~/Downloads
sudo tar -C /usr/local -xzvf freesurfer-Linux-centos6_x86_64-stable-pub-v5.3.0.tar.gz

You'll need to register here. The registration e-mail will tell you which text to copy into a new file, which you can create/edit by

sudo gedit /usr/local/freesurfer/license.txt

We'll be creating a directory for processed subject files on the scratch drive.

mkdir /mnt/scratch/projects/freesurfer

Finally, you'll need to edit your bashrc file.

gedit ~/.bashrc

Copy the following text

export FREESURFER_HOME=/usr/local/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh > /dev/null
export SUBJECTS_DIR=/mnt/scratch/projects/freesurfer

SPM8

Fill out the form located here in order, making sure to select SPM8. Run this script from the terminal to install.

unzip ~/Downloads/spm8.zip -d ~/Documents/MATLAB/


Psychtoolbox for Matlab

Requires Neurodebian repo to install.

sudo apt-get install matlab-psychtoolbox-3

In order to launch Matlab with Psychtoolbox, use terminal command

ptb3-matlab