|
Size: 3617
Comment:
|
← Revision 25 as of 2021-03-06 11:56:05 ⇥
Size: 2407
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| The [[https://surfer.nmr.mgh.harvard.edu/fswiki/BrainstemSubstructures|brainstem]] and [[https://surfer.nmr.mgh.harvard.edu/fswiki/HippocampalSubfields|hippocampal subfield]] modules in FreeSurfer 6.0 require the Matlab R2012 runtime. This runtime is free, and therefore '''NO MATLAB LICENSES ARE REQUIRED TO USE THESE PACKAGES'''. The runtime is installed as follows: | A few freesurfer modules, like fsfast and the subfield/nuclei segmentation tools, require the matlab runtime package (MCR). The MCR allows users to run distributed matlab-compiled programs '''without paying for a matlab license'''. The freesurfer command `fs_install_mcr` can be used to install this package. MCR version requirements are as follows. |
| Line 5: | Line 5: |
| == Linux == | '''To download the runtime for FS version 7''', please install MCR 8.4 (R2014b) by running: |
| Line 7: | Line 7: |
| First, we will define the environment variable FREESURFER_HOME, which points at the FreeSurfer 6.0 directory. For example, in tcsh or csh: | |
| Line 9: | Line 8: |
| setenv FREESURFER_HOME /usr/local/freesurfer }}} Or, in bash: {{{ export FREESURFER_HOME=/usr/local/freesurfer |
fs_install_mcr R2014b |
| Line 16: | Line 11: |
| Second, cd into your FreeSurfer 6.0 directory: | '''To download the runtime for FS version 6''', please install MCR 8.0 (R2012b) by running: |
| Line 18: | Line 14: |
| cd $FREESURFER_HOME | fs_install_mcr R2012b |
| Line 21: | Line 17: |
| Next, download the runtime as follows: | '''NOTE:''' If the `fs_install_mcr` script is not available in your freesurfer distribution, it can be downloaded by running the following command: |
| Line 23: | Line 20: |
| wget | cd $FREESURFER_HOME/bin && curl https://raw.githubusercontent.com/freesurfer/freesurfer/dev/scripts/fs_install_mcr -o fs_install_mcr && chmod +x fs_install_mcr |
| Line 26: | Line 23: |
| Finally, unpack it with: | === If the programs produce missing library errors... === If any of the matlab binaries error due to missing system libraries, try ensuring that the following are installed on your system. * on ubuntu: {{{apt-get -y install libxt-dev libxext-dev libncurses5}}} * on centos: {{{yum -y install libXt libXext ncurses-compat-libs}}} Or, if you receive subfield errors (in freesurfer 7) indicating `GLIBC_PRIVATE not defined`, try updating a few files with the following command. This will be fixed in the 7.1.1 patch release. |
| Line 28: | Line 33: |
| bash <(curl -s https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/patches/fs_update_7.1_subfield_scripts.sh) | |
| Line 31: | Line 36: |
| If the brainstem and/or hippocampal subfield modules are working fine, you can delete the packed runtime file with: {{{ rm $FREESURFER_HOME/runtime2012bLinux.tar.gz }}} |
=== If you already have matlab installed... === |
| Line 36: | Line 38: |
| setenv MCR_INSTALL_DIR /usr/local/MCR_runtime Or, in bash: {{{ export FREESURFER_HOME=/usr/local/freesurfer export MCR_INSTALL_DIR=/usr/local/MCR_runtime }}} Then, from an empty directory with enough space, download the runtime installation files with wget and then unzip them: |
If you already have matlab 2012b/2014b installed on your system, you do not need to install the runtime. Keep in mind that the matlab version must match the freesurfer requirement defined above. All you need to do is create a symbolic link named MCRv80/MCRv84 in your FreeSurfer directory that points to the main matlab install directory. The matlab root directory can be easily obtained by executing the matlab command {{{matlabroot}}}. It typically looks like {{{/Applications/MATLAB_R2014b.app}}} in OSX and {{{/usr/local/matlab/8.4}}} in Linux. For example, if you already have matlab 2014b, just run the following to make it visible to freesurfer: |
| Line 49: | Line 41: |
| wget http://www.mathworks.com/supportfiles/MCR_Runtime/R2012b/MCR_R2012b_glnxa64_installer.zip unzip MCR_R2012b_glnxa64_installer.zip |
cd <FreeSurferRootDirectory> && ln -s <MatlabRootDirectory> MCRv84 |
| Line 53: | Line 43: |
Next, execute the installer: {{{ ./install }}} and MCR_INSTALL_DIR, which points at the directory where we want to install the Matlab runtime. This can be any directory of your choice, but you will need root permissions if you want to install the runtime under a system directory (e.g., /usr/local). This will open a graphical interaface that will guide you through the installation process. When you are prompted to specify the installation folder, simply type: $MCR_INSTALL_DIR a window that ask you in which directory you want to install the runtime. This can be any directory of your choice, but you will need root permissions if you want to install the runtime under a system directory (e.g., /usr/local). Let's call this directory <RUNTIME_INSTALL_DIR>. Once you have installed the runtime, define your environment variable FREESURFER_HOME pointing at your FreeSurfer 6 directory. For example, in tcsh or csh: {{{ setenv FREESURFER_HOME /usr/local/freesurfer }}} Or, in bash: {{{ export FREESURFER_HOME=/usr/local/freesurfer }}} Finally, create a symbolic link named MCRv80 in your FreeSurfer directory pointing to the installation directory of the runtime as follows: {{{ sudo ln -s <RUNTIME_INSTALL_DIR>/v80 $FREESURFER_HOME/MCRv80 }}} == MAC == http://www.mathworks.com/supportfiles/MCR_Runtime/R2012b/MCR_R2012b_maci64_installer.zip Once you have installed the runtime, define your environment variable FREESURFER_HOME pointing at your FreeSurfer 6 directory. For example, in tcsh or csh: {{{ setenv FREESURFER_HOME /usr/local/freesurfer }}} Or, in bash: {{{ export FREESURFER_HOME=/usr/local/freesurfer }}} Finally, create a symbolic link named MCRv80 in your FreeSurfer directory pointing to the installation directory of the runtime as follows: {{{ sudo ln -s <RUNTIME_INSTALL_DIR>/ $FREESURFER_HOME/MCRv80 }}} The installation directory of the runtime should contain the following subdirectories (independently of whether it is a linux or mac installation): appdata , bin , etc , extern , java , resources , rtw , runtime , simulink , sys , toolbox , X11 |
Matlab Runtime
A few freesurfer modules, like fsfast and the subfield/nuclei segmentation tools, require the matlab runtime package (MCR). The MCR allows users to run distributed matlab-compiled programs without paying for a matlab license. The freesurfer command fs_install_mcr can be used to install this package. MCR version requirements are as follows.
To download the runtime for FS version 7, please install MCR 8.4 (R2014b) by running:
fs_install_mcr R2014b
To download the runtime for FS version 6, please install MCR 8.0 (R2012b) by running:
fs_install_mcr R2012b
NOTE: If the fs_install_mcr script is not available in your freesurfer distribution, it can be downloaded by running the following command:
cd $FREESURFER_HOME/bin && curl https://raw.githubusercontent.com/freesurfer/freesurfer/dev/scripts/fs_install_mcr -o fs_install_mcr && chmod +x fs_install_mcr
If the programs produce missing library errors...
If any of the matlab binaries error due to missing system libraries, try ensuring that the following are installed on your system.
on ubuntu: apt-get -y install libxt-dev libxext-dev libncurses5
on centos: yum -y install libXt libXext ncurses-compat-libs
Or, if you receive subfield errors (in freesurfer 7) indicating GLIBC_PRIVATE not defined, try updating a few files with the following command. This will be fixed in the 7.1.1 patch release.
bash <(curl -s https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/patches/fs_update_7.1_subfield_scripts.sh)
If you already have matlab installed...
If you already have matlab 2012b/2014b installed on your system, you do not need to install the runtime. Keep in mind that the matlab version must match the freesurfer requirement defined above. All you need to do is create a symbolic link named MCRv80/MCRv84 in your FreeSurfer directory that points to the main matlab install directory. The matlab root directory can be easily obtained by executing the matlab command matlabroot. It typically looks like /Applications/MATLAB_R2014b.app in OSX and /usr/local/matlab/8.4 in Linux. For example, if you already have matlab 2014b, just run the following to make it visible to freesurfer:
cd <FreeSurferRootDirectory> && ln -s <MatlabRootDirectory> MCRv84
