FreeSurfer
FreeSurfer is an open-source neuroimaging toolkit available as a Lmod module on Klone.
Currently, FreeSurfer must run from a container with sufficient library dependencies. We recommend using FreeSurfer from a VNC session with hyakvnc.
Checking available versions
module avail freesurfer
Using FreeSurfer (from escience)
Load the default version with module load escience/freesurfer
,
or load a specific version with module load escience/freesurfer/<version>
.
After loading the module, FreeSurfer should have its environment set up for normal use.
Installing a different version
This is tested from a VNC Apptainer environment with sufficient dependencies.
Go to https://surfer.nmr.mgh.harvard.edu/fswiki/DownloadAndInstall and download the latest FreeSurfer tar archive for CentOS 8
Extract the .tar.gz archive to
/sw/contrib/labname-src/freesurfer/<version>/
.
For example, if installing version 7.3.2 of FreeSurfer, then run the following:
LABNAME=escience
VERSION=7.3.2
mkdir -p "/sw/contrib/$LABNAME-src/freesurfer/$VERSION"
tar -xzf freesurfer-linux-centos8_x86_64-$VERSION.tar.gz \
--strip-components=1 \
-C "/sw/contrib/$LABNAME-src/freesurfer/$VERSION"
- Create an Lmod .lua module file for the new release with a text editor:
/sw/contrib/modulefiles/mylabname/freesurfer/7.3.2.lua
(myModuleName())
helplocal base = pathJoin(
"/sw/contrib",
string.gsub(myModuleName(), "/.*$", "-src"),
string.gsub(myModuleName(), "^.*/", ""),
()
myModuleVersion)
--FreeSurfer 7.x requires MATLAB R2014b
("forsyth/matlab/r2014b")
depends_on
("FREESURFER_HOME", base)
setenv("PATH", pathJoin(base, "bin"))
prepend_path("bash", pathJoin(base, "SetUpFreeSurfer.sh"))
source_sh
("Name: " .. string.gsub(myModuleName(), "^.*/", ""))
whatis("Version: " .. myModuleVersion()) whatis
Check that the module is available and load it:
module -I spider mylabname/freesurfer module load mylabname/freesurfer/7.3.2
- 1
-
Lmod takes some time to cache available modules. You can use the
-I
option to force Lmod to check for new modules.
Request a free license from https://surfer.nmr.mgh.harvard.edu/registration.html if not already.
This license is not tied to a specific version of FreeSurfer and can be copied from a previous installation.
Download
license.txt
from the registration email and copy it to/sw/contrib/labname-src/freesurfer/<version>/license.txt
.For FS-FAST support, create a link to a supported MATLAB release (R2014b for FreeSurfer 7.x):
module -I load labname/freesurfer/<version>
cd "$FREESURFER_HOME"
ln -s /gscratch/psych-src/matlab/R2014b MCRv84