All of my scripts and documentation assume that these neuroimaging resources have been installed. For each package I cover the three computing environments I currently use:
- OS X Mountain Lion + MacPorts
- Neurodebian on Ubuntu 12.04 on 64-bit processors
- Neurodebian VM, running Debian 7.0 wheezy 32-bit on VirtualBox
Software covered:
- neurodebian virtual machine
- itksnap
- mricron
- mricrogl
- imagej/fiji
- fsl
- afni
- BXH/XCEDE tools (from FBIRN)
- freesurfer
- spm
[email protected] updated: 20130523
- Download the neurodebian VM .ova/.ovf:
- click "Get Neurodebian"
- Select operating system: Mac or Windows
- Download the Debian 7.0 .ova or zip/ovf file (I prefer the 32-bit version. Easier to distribute to heterogeneous hardware).
-
Download and install the latest VirtualBox binaries.
-
Follow the neurodebian install instructions, which they support with a youtube video.
-
Boot up the new virtual machine. Don't bother to select any new packages from the point-and-click wizard that autoruns.
Download latest version from the ITK-SNAP Downloads page.
- Choose "MacOS Binary (Intel, 64 bit, OSX 10.5+)"
- Drag the resulting ITK-SNAP.app to /Applications folder
I'm currently happy with the version in the neurodebian repos:
sudo apt-get install itksnap
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Download latest from http://www.nitrc.org/projects/mricron
cd ~/Downloads/osx/ mv mricron.app dcm2niigui.app npm.app /Applications/
echo ${PATH} # does this contain /usr/local/bin ? ls /usr/local # is there a folder called bin inside of /usr/local ? If not: sudo mkdir /usr/local/bin sudo mv ~/Downloads/osx/dcm2nii /usr/local/bin/
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install mricron mricron-data mricron-doc
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Download from http://www.mccauslandcenter.sc.edu/mricrogl/
cd ~/Downloads mkdir mricrogl cd mricrogl unzip ~/Downloads/osx.zip sudo mv mricrogl.app /Applications/ mv *.nii.gz /Users/Shared/sampleBrainVolumes/mricrogl # or other parent of sample data
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
download dmg file from http://fiji.sc/Downloads, then do this:
cd ~/Downloads open fiji-macosx.dmg cp -R /Volumes/Fiji/Fiji.app /Applications/ hdiutil unmount /Volumes/Fiji open /Applications/Fiji.app
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install fiji
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Download and install the plugin from http://rsb.info.nih.gov/ij/plugins/nifti.html :
cd ~/Downloads curl -O http://rsb.info.nih.gov/ij/plugins/download/jars/nifti_io.jar cp nifti_io.jar /Applications/Fiji.app/plugins/ # ...for OS X . Adapt for linux.
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
and logout and then back in: (http://xquartz.macosforge.org)
http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/MacOsX#Downloading_the_install_file_without_installing_the_software
There are multiple ways to install (as of May 2013). I get mixed results with the recommended fslinstaller.py, but I typically use it and then just fix whatever didn't work.
cd ~/Downloads python fslinstaller.py -o
fslDownload=fsl-5.0.2.2-macosx.tar.gz
fslDestDir="/usr/local"
fslMD5=md5 ${fslDownload} | awk '{ print $NF}'
python fslinstaller.py -d ${fslDestDir} -f ${fslDownload} -C ${fslMD5}
After the install completes, confirm that the file /etc/bashrc received a block of FSL environmental variables (below).
If not, the install program may have added it to your personal ~/.profile or ~/.bash_profile instead.
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bashrc >/dev/null <<EOF
#------------------------------------------
FSLDIR=/usr/local/fsl PATH=${FSLDIR}/bin:${PATH} export FSLDIR PATH . ${FSLDIR}/etc/fslconf/fsl.sh #------------------------------------------ EOF
cat /etc/bashrc
. /etc/bashrc
echo $FSLDIR
ls /Applications
sudo ln -s /usr/local/fsl/bin/fslview.app /Applications/fslview.app
open /Applications/fslview.app
fslview ${FSLDIR}/data/standard/MNI152_T1_2mm_LR-masked.nii.gz
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install fsl-complete fsl-feeds
...but previous to fsl-completed, you needed to apt-get instal fsl-atlases fsl-feeds fsl-first-data fslview and fsl-feeds?
then get instructions for environmental variables (e.g., may need to source AFNI/FSL script from /etc/bash.bashrc)
man fsl
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install fsl-complete fsl-feeds
...but previous to fsl-completed, you needed to apt-get instal fsl-atlases fsl-feeds fsl-first-data fslview and fsl-feeds?
then get instructions for environmental variables (e.g., may need to source AFNI/FSL script from /etc/bash.bashrc)
man fsl
After the install completes, confirm that the file /etc/bash.bashrc received a block of FSL environmental variables (below).
If not, the install program may have added it to your personal ~/.profile or ~/.bash_profile instead.
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bash.bashrc >/dev/null <<EOF
#------------------------------------------
. /etc/fsl/5.0/fsl.sh #------------------------------------------ EOF
cat /etc/bashrc
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Download FEEDS from FSL (> 270 MB): http://fsl.fmrib.ox.ac.uk/fsldownloads/
Run FEEDS (http://fsl.fmrib.ox.ac.uk/fsl/feeds/doc/):
cd ~/Downloads (or where ever you saved your download) tar -zxvf fsl-*-feeds.tar.gz cd feeds /usr/bin/time ./RUN all
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
and logout and then back in: (http://xquartz.macosforge.org)
cd ~/Downloads curl -O http://afni.nimh.nih.gov/pub/dist/tgz/macosx_10.7_Intel_64.tgz tar -zxvf macosx_10.7_Intel_64.tgz sudo mv macosx_10.7_Intel_64 /usr/local/abin
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bashrc >/dev/null <<EOF
#------------------------------------------
export PATH=/usr/local/abin:${PATH} export AFNI_ENFORCE_ASPECT=YES #------------------------------------------ EOF
cat /etc/bashrc
. /etc/bashrc
TEST: Open a new terminal window and test your afni install by issuing the command "afni" (no quotes) to open GUI
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install afni afni-atlases
curl -O http://afni.nimh.nih.gov/pub/dist/tgz/linux_xorg7_64.tgz # (> 600 MB) tar -zxvf linux_xorg7_64.tgz mv linux_xorg7_64 ~/abin
#-----------------------------------------------------------------
#-----------------------------------------------------------------
sudo apt-get install afni afni-atlases
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bash.bashrc >/dev/null <<EOF
#------------------------------------------
. /etc/afni/afni.sh #------------------------------------------ EOF
cat /etc/bashrc
#-----------------------------------------------------------------
#-----------------------------------------------------------------
afni -help | grep Vname afni -help | grep Dname
afni -VAFNI_ENFORCE_ASPECT=
afni -DAFNI_ENFORCE_ASPECT=YES
#-----------------------------------------------------------------
#-----------------------------------------------------------------
if Neurodebian is installed but you need to temporarily use AFNI installed in a user-space directory:
unset env | awk -F= '/AFNI/ ${print $1}' | xargs
export PATH=~/abin:${PATH}
which afni which 3dinfo
###########################
###########################
#-----------------------------------------------------------------
#-----------------------------------------------------------------
cat /etc/bashrc
. /etc/bashrc
ls $BXHDIR
#-----------------------------------------------------------------
#-----------------------------------------------------------------
manualy download most recent bxh/xcede release from nitrc: http://www.nitrc.org/projects/bxh_xcede_tools
bxh_xcede_tools-1.10.7-lsb31.i386.tgz
bxhVersion=1.10.7
cd ~/Downloads tar -zxvf bxh_xcede_tools-${bxhVersion}-lsb31.i386.tgz sudo mv bxh_xcede_tools-${bxhVersion}-lsb31.i386 /opt/ sudo ln -s /opt/bxh_xcede_tools-${bxhVersion}-lsb31.i386 /opt/bxh
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bash.bashrc >/dev/null <<EOF
#------------------------------------------
BXHDIR=/opt/bxh PATH=${BXHDIR}/bin:${PATH} export BXHDIR PATH #------------------------------------------ EOF
###########################
###########################
$FREESURFER_HOME directory per https://surfer.nmr.mgh.harvard.edu/registration.html
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Before installing freesurfer on Mountain/Lion be sure to install XQuartz (http://xquartz.macosforge.org)
fsFtpDir="ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.2.0" fsFtpFilename="freesurfer-Darwin-lion-stable-pub-v5.2.0.dmg" cd ~/Downloads curl -O ${fsFtpDir}/${fsFtpFilename}
curl -C - -o ${fsFtpFilename} ${fsFtpDir}/${fsFtpFilename}
sh <<EOF
curl -s -o freesurfer_md5sums.txt http://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/md5sum.txt
echo ""
echo "expected md5 sum:"
grep
Detailed instructions at http://surfer.nmr.mgh.harvard.edu/fswiki/Installation
(Note the folder that this installs to, likely /Applications/freesurfer, which you will assign to $FREESURFER_HOME below.)
are escaped for heredoc (http://goo.gl/j3HMJ).
editDate=/bin/date +%Y%m%d
editTime=$(date +%k%M)
sudo tee -a /etc/bashrc >/dev/null <<EOF
#------------------------------------------
export FREESURFER_HOME=/Applications/freesurfer . ${FREESURFER_HOME}/SetUpFreeSurfer.sh #------------------------------------------ EOF
cat /etc/bashrc
cp -a $SUBJECTS_DIR /Users/Shared/fs_sampleSubjects
. /etc/bashrc
TESTS: Test your installation by issuing the test commands detailed on the Testing Freesurfer webpage
(as of January 2013: http://surfer.nmr.mgh.harvard.edu/fswiki/TestingFreeSurfer )
freeview
-v $SUBJECTS_DIR/bert/mri/norm.mgz
-v $SUBJECTS_DIR/bert/mri/aseg.mgz:colormap=lut:opacity=0.2
-f $SUBJECTS_DIR/bert/surf/lh.white:edgecolor=yellow
-f $SUBJECTS_DIR/bert/surf/rh.white:edgecolor=yellow
-f $SUBJECTS_DIR/bert/surf/lh.pial:annot=aparc:edgecolor=red
-f $SUBJECTS_DIR/bert/surf/rh.pial:annot=aparc:edgecolor=red
tkmedit bert orig.mgz tkmedit bert norm.mgz -segmentation aseg.mgz $FREESURFER_HOME/FreeSurferColorLUT.txt
tksurfer bert rh pial
recon-all -s bert -autorecon1
recon-all -s bert -all
#-----------------------------------------------------------------
#-----------------------------------------------------------------
fsFtpDir="ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/5.2.0" fsFtpFilename="freesurfer-Linux-centos4_x86_64-stable-pub-v5.2.0.tar.gz" cd ~/Downloads wget ${fsFtpDir}/${fsFtpFilename}
curl -C - -o ${fsFtpFilename} ${fsFtpDir}/${fsFtpFilename}
sh <<EOF
curl -s -o freesurfer_md5sums.txt http://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/md5sum.txt
echo ""
echo "expected md5 sum:"
grep
###########################
###########################