MacOS Install & Setup

Xquartz Prerequisite

The most recent version of the Xquartz (X-windows) framework should be installed on your system in order for the Freeview program (included in the Freesurfer distribution) to correctly display images. Locate the Xquartz application in the Utilities folder inside the Applications folder.

xquartz_in_utilities.png

Right click on the Xquartz application, select "Get info" and note the version number reported in the pop-up "Get info" window. In the screenshot below Xquartz reports version 2.8.5 is installed on the system.

xquartz_get_info_and_output.png

Route to the Xquartz web site in your browser and check the latest version listed there, Xquartz

xquartz_web_site.png

In the above screenshot, the latest version listed on the web site matches the version installed on the machine. If the version listed on the web site is however greater (or newer) than the version installed on your machine, then click on the link to download the latest Xquartz package and install it on your machine.

Once the latest Xquartz version is installed, check in a terminal window that it works to run a simple X-Windows program like x-clock.

$ xclock

xquartz_run_xclock.png

Remove an Existing Freesurfer Installation

The screenshots and terminal commands listed below show how to install the pkg file and setup the Freesurfer environment on a a Silicon (darwin_arm64) Mac using the freesurfer 8.1.0 installer, freesurfer-macOS-darwin_arm64-8.1.0.pkg

If however, you are still using an older Mac with an Intel processor, you should instead download and install the Intel (darwin_x86_54) installer freesurfer-macOS-darwin_x86_64-8.1.0.pkg. The screenshots and terminal output should be similar for the Intel Mac.

Please note - if you already have a freesurfer distribution installed under /Applications/freesurfer, then it is strongly advised you rename or uninstall the existing freesurfer directory to be something other than freesurfer under /Applications. This is because the Mac pkg installer may complain about and/or clobber any existing freesurfer installation.

if you have been running an existing freesurfer 7.X or 8.X release, then chances are an uninstall script is available to run under $FREESURFER_HOME. In the example below the uninstall.sh script provided with the 7.1.0 release is used to uninstall it.

$ cd $FREESURFER_HOME
$ sudo ./uninstall.sh
Password:
The following packages will be REMOVED:
   freesurfer-7.1.0
Do you wish to continue [Y/n]? Y
[1/2] [DONE} Successfully deleted freesurfer information
[2/2] [DONE} Successfully deleted freesurfer
freesurfer 7.1.0 uninstalled

Using the Mac Package Installer

The screenshots and terminal commands listed below show how to install the pkg file and setup the Freesurfer environment on a a Silicon (darwin_arm64) Mac using the freesurfer 8.1.0 installer, freesurfer-macOS-darwin_arm64-8.1.0.pkg

if however, you are still using an older Mac with an Intel processor, you should instead download and install the Intel (darwin_x86_54) installer freesurfer-macOS-darwin_x86_64-8.1.0.pkg. The screenshots and terminal output should be similar for the Intel Mac.

Using the Mac Package Installer

You can download the Mac pkg installer file for the latest freesurfer release from the web page, freesurfer-macOS-darwin_x86_64-8.1.0.pkg|freesurfer releases]]. In the screenshot below, the latest (8.1.0) release is downloaded thru a web browser by right clicking on the link, and then selecting "Download Linked File"

810_pkg_download_1.png

The screen shots below show the steps to allow the freesurfer unsigned installer to run. This includes opening the System Preferences panel found under the Apple logo pull down menu in the uppermost left hand corner of the Mac display. Once in the System Preferences panel, click on the Network and Security icon to bring up the panel that will allow you to click on OK to run the installer. If your Mac user account has sudo privileges (the default for the account created on a brand new machine setup out of the box), then you should not need to use an administrators password to unlock the padlock in the Network and Security panel.

Double click on the installer icon to start the install process.

MacOS_install_info.png

... the installer will start to verify, and not find a signature...

MacOS_verify_1.png

... allow the security exception ...

MacOS_verify_2.png

... from the Apple logo pull down menu (upper left hand screen corner) select System Preferences ...

... click on Security & Privacy icon ...

MacOS_verify_3.png

... allow the security exception ...

MacOS_verify_4.png

... with the override, the installer should finish verifying ...

MacOS_verify_5.png

... allow the security exception ...

MacOS_verify_6.png

Allow Installer to Write Files

You should now see the first or "Introduction" splash screen of the installer. The screen shots below show the steps for running the package installer; these include agreeing to the license, selecting the install destination, and allowing the installer to transfer files.

MacOS_install_1_8.png

MacOS_install_2_8.png

MacOS_install_3_8.png

MacOS_install_3_8_1.png

MacOS_install_4_8.png

... enter userid and password for a user with admin privileges ...

MacOS_install_EnterPasswd.png

MacOS_install_5_8.png

MacOS_install_6_8.png

MacOS_install_8_8.png

After the installer program exits, use the terminal window to setup the environment with the same commands listed above except that the path for FREESURFER_HOME is now /Applications/freesurfer/7.1.1.

$ export FREESURFER_HOME=/Applications/freesurfer/7.1.1
$ export SUBJECTS_DIR=$FREESURFER_HOME/subjects
$ source $FREESURFER_HOME/SetUpFreeSurfer.sh
-------- freesurfer-darwin-macOS-7.1.1-20200429-3a03ebd --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
WARNING: /Users/synpro/freesurfer/fsfast does not exist
FREESURFER_HOME   /Applications/freesurfer/7.1.1
FSFAST_HOME       /Users/synpro/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /Applications/freesurfer/7.1.1/subjects
MNI_DIR           /Users/synpro/freesurfer/mni

$ which freeview
/Applications/freesurfer/7.1.1/bin/freeview

Screenshot of loading a volume in freeview (using the same environment above).

MacOS_run_freeview.png