Skip to content

Mac vistasoft software configuration

Noah C. Benson edited this page Aug 31, 2016 · 8 revisions

Below are some recommendations. You need not follow them exactly. They work well on the Winawer lab machines.

  • Tell your bash profile to read your .bashrc file each time the terminal is launched. This way the bashrc will be read irrespective of how you launch your terminal. See [http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html this page] for explanation of bashrc v bash_profile. The contents of our .bash_profile file are:
[ -a ~/.bashrc ] && source ~/.bashrc
  • Set Freesurfer paths in your .bashrc file. If you do not have a file, create one in your home directory. We do this as a function with the following contents of the .bashrc file:
# Source freesurfer and fsl paths
freesurfer()
{
        export SUBJECTS_DIR=/Volumes/server/Freesurfer_subjects; 
        export FREESURFER_HOME=/Applications/freesurfer; 
        source $FREESURFER_HOME/SetUpFreeSurfer.sh; 
        export FSLDIR=/usr/local/fsl; . ${FSLDIR}/etc/fslconf/fsl.sh;
        PATH=${FSLDIR}/bin:${PATH}; export FSLDIR PATH
}

Check it:

more ~/.bashrc
  • MATLAB command We create a text file called startMatlab.command. You can do this from a terminal like this:
cat > ~/Documents/startMatlab.command <<EOF
#! /usr/bin/env bash -i
# Source freesurfer
#	 'freesurfer' is a function defined in ~/.bashrc
#     This will ensure that freesurfer paths are available to Matlab
freesurfer

# Start matlab 
/Applications/MATLAB.app/bin/matlab
EOF

Note that this assumes that your Matlab installation has been installed in /Applications/MATLAB.app; usually, this directory is not correct, as Matlab appends a version string between the "MATLAB" and the ".app", for example, "/Applications/MATLAB_R2015A.app". To fix this, you can either edit the startMatlab.command script and replace MATLAB.app with your Matlab installation's directory, or you can make symbolic link from your Matlab's installation directory to /Applications/MATLAB.app. To do the latter from the terminal (assuming your installation is MATLAB_R2015A), type ln -s /Applications/MATLAB_R2015A.app /Applications/MATLAB.app.

Make sure this file is executable, for example by typing

chmod +x ~/Documents/startMatlab.command 

Clicking this file will then launch Matlab and preserve freesurfer paths

Clone this wiki locally