Differences between revisions 58 and 59
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:

==== Xquartz Prerequisite ====
Line 24: Line 26:
With xlock running, the Mac should show '''Xquartz''' in the upper left hand corner of the screen next to the Apple logo. Click on "Xquartz" and then select "About X11". It should report that version 2.7.11 is running. If the Mac reports "xclock: Command not found" or you are not running this latest version, then download and install Xquartz from [[https://www.xquartz.org|Xquartz]]. {{attachment:xquartz_run_xclock.png}}
Line 26: Line 28:
The examples below show how to unpack/install the Freesurfer 7.1.1 MacOS tar archive, '''freesurfer-darwin-macOS-7.1.1.tar.gz''', or pkg file, '''freesurfer-darwin-macOS-7.1.1.pkg'''. While the code was built and packaged on Mac OS 10.14 (Mojave), you should follow the same instructions if you are running MacOS 10.12 (Sierra), 10.13 (High Sierra) or 10.15 (Catalina). ==== Remove an Existing Freesurfer Installation ====
Line 28: Line 30:
On Mac systems, the tar archive file (.tar.gz) can be expanded under any convenient path/subdirectory on your machine you have permission to write to. For example, you can expand the tar archive under your $HOME directory. To install freesurfer under a recommended shared system location, e.g., '''/Applications''', you may need sudo or root privileges. Please note that if you have sudo/root privileges, then you should use the package file (.pkg) to install the freesurfer 7.1.1 release as described below in '''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, [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/8.1.0/freesurfer-macOS-darwin_arm64-8.1.0.pkg|freesurfer-macOS-darwin_arm64-8.1.0.pkg]]
Line 30: Line 32:
''Example of placing the Mac tar archive under the $HOME directory belonging to user "tester" '''without using sudo/root privileges'''. Setup commands follow. Shell is bash or Bourne shell.'' 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 [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/8.1.0/freesurfer-macOS-darwin_x86_64-8.1.0.pkg|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.
Line 33: Line 39:
$ cd $HOME
$ pwd
/home/tester
$ tar -zxvpf freesurfer-darwin-macOS-7.1.1.tar.gz
x freesurfer/
x freesurfer/ASegStatsLUT.txt
x freesurfer/average/
x freesurfer/bin/
x freesurfer/build-stamp.txt
x freesurfer/DefectLUT.txt
...
..
<rest of output deleted>

$ cd freesurfer
$ pwd
/home/tester/freesurfer
$ export FREESURFER_HOME=$HOME/freesurfer
$ export SUBJECTS_DIR=$FREESURFER_HOME/subjects
$ source $FREESURFER_HOME/SetUpFreeSurfer.sh
-------- freesurfer-darwin-macOS-7.1.1 ---------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /home/tester/freesurfer
FSFAST_HOME /home/tester/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /home/tester/freesurfer/subjects
MNI_DIR /home/tester/freesurfer/mni

$ which freeview
/home/tester/freesurfer/bin/freeview
$ 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
Line 65: Line 50:
''Example of placing the Mac tar archive under the system location /Applications by user "tester" '''using sudo/root privileges'''. Setup commands follow. Shell is bash or Bourne shell.''

{{{
$ cd $HOME
$ pwd
/home/tester
$ sudo tar -C /Applications -zxvpf freesurfer-darwin-macOS-7.1.1.tar.gz
x freesurfer/
x freesurfer/ASegStatsLUT.txt
x freesurfer/average/
x freesurfer/bin/
x freesurfer/build-stamp.txt
x freesurfer/DefectLUT.txt
...
..
<rest of output deleted>

$ export FREESURFER_HOME=/Applications/freesurfer
$ export SUBJECTS_DIR=$FREESURFER_HOME/subjects
$ source $FREESURFER_HOME/SetUpFreeSurfer.sh
-------- freesurfer-darwin-macOS-7.1.1 --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /Applications/freesurfer
FSFAST_HOME /Applications/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /Applications/freesurfer/subjects
MNI_DIR /home/tester/freesurfer/mni

$ which freeview
/Applications/freeview/bin/freeview
}}}
Line 99: Line 53:
''Please note - if you already have freesurfer installed as '''/Applications/freesurfer''', e.g., per the example above, then it is strongly advised that you remove the installation or rename the directory to be something other than freesurfer under /Applications. This is because the Mac pkg installer will install freesurfer under the path '''/Applications/freesurfer/7.1.1'''''. 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, [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/8.1.0/freesurfer-macOS-darwin_arm64-8.1.0.pkg|freesurfer-macOS-darwin_arm64-8.1.0.pkg]]
Line 101: Line 55:
The package installer will also save package receipts on the system and provides an uninstaller script as /Applications/freesurfer/7.1.1/uninstall.sh 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 [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/8.1.0/freesurfer-macOS-darwin_x86_64-8.1.0.pkg|freesurfer-macOS-darwin_x86_64-8.1.0.pkg]]. The screenshots and terminal output should be similar for the Intel Mac.
Line 103: Line 57:
==== Performing the install ==== ==== Using the Mac Package Installer ====
Line 105: Line 59:
We hope to offer a signed installer package in the future, but in the meantime security exceptions need to be made in order to run the freesurfer package installer. Older versions of MacOS may not display all the security opt-out dialogue messages pictured below (run on MacOS 10.15, Catalina). Please note that while some Mac users disable SIP (system integrity protection) to simplify unsigned installs, as of this writing it should not be necessary to disable SIP to install files under /Applications. Also the IT policy of your company or institution pay prohibit disabling SIP for security reasons.
Line 107: Line 60:
==== Verify and Enable the Installer ====

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

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

FS7_mac (last edited 2025-08-27 15:15:12 by buildqa)