|
Size: 1010
Comment:
|
Size: 5422
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| === Freesurfer install on Ubuntu 18 running in WSL === | === Freesurfer install on Ubuntu Linux in WSL === |
| Line 3: | Line 3: |
| The terminal session below shows how to download, install and setup the freesurfer and X-windows environment using a terminal window launched from Ubuntu 18 running in WSL under Windows 10. The free version of Ubuntu 18 was selected from the Windows store. | Please read the latest MS documentation about how to setup WSL (version2 as of this writing) on your Windows machine, [[https://docs.microsoft.com/en-us/windows/wsl/install-win10|MS WSL Dcoumentation]]. Once you are able to bring up a terminal window in WSL's pre-installed version of Ubuntu linux you can proceed to setting up the Freesurfer environment. As of this writing, WSL should install Ubuntu 22 Linux and so the install of a Freesurfer Ubuntu 22 package is listed below. |
| Line 5: | Line 5: |
| After Ubuntu 18 was installed via the MS WSl instructions, [[https://docs.microsoft.com/en-us/windows/wsl/install-win10|MS Dcoumentation for WSL version 2 setup and install]] then subsequently the repos were updated on Ubuntu 18, the freesurfer installer was downloaded/installed and the shell environment was setup to run X graphics and freesurfer. | The commands below shows how to download and install the freesurfer package. That is followed by notes on setting up a 3rd party X-windows server on the host Windows machine using Xming. If you do not need to view any brain images, e.g., through Freeview, then there is no need to setup the X-Windows server. |
| Line 7: | Line 7: |
| The freesurfer. *.deb package should also work on Ubuntu 20, but as of this writing it has not been tested on newer versions of Ubuntu linux. We do not advise manually trying to install packages in order to get freesurfer to run. Please allow the installer to try and determine what packages are needed on the system and install them. | We do not advise manually trying to install packages in the Ubuntu Linux image in order to get freesurfer to run. Please allow the installer to try and determine what packages are needed on the system and install them. developer@DESKTOP-LD48TB7:~$ '''cd''' <<BR>><<BR>> developer@DESKTOP-LD48TB7:~$ '''wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu22-7.4.1_amd64.deb''' <<BR>> ... download output ... <<BR>><<BR>> developer@DESKTOP-LD48TB7:~$ '''ls freesurfer_ubuntu22-7.4.1_amd64.deb''' <<BR>> freesurfer_ubuntu22-7.4.1_amd64.deb <<BR>><<BR>> ... update the package information in Ubuntu linux ... developer@DESKTOP-LD48TB7:~$ '''sudo apt-get update -y''' <<BR>> [sudo] password for developer: <<BR>> ... output from package updates ... <<BR>> ... install the freesurfer distribution under /usr/local/freesurfer/<release>. Anwer "Y" to any prompts ... developer@DESKTOP-LD48TB7:~$ '''sudo apt-get -y install ./freesurfer_ubuntu22-7.4.1_amd64.deb''' <<BR>> [sudo] password for developer: <<BR>> The following NEW packages will be installed: <<BR>> ... output from package updates followed by install of freesurfer package ... ... check the Freesurfer release was installed under /usr/local/freesurfer/7.4.1 ... <<BR>> ... ls output ... ... setup the FREESURFER_HOME environment variable. The export commands below add the environment variable settings into your bash shell init file, i.e., .bashrc ... developer@DESKTOP-LD48TB7:~$ '''echo "export FREESURFER_HOME=/usr/local/freesurfer/7.4.1" >> $HOME/.bashrc''' <<BR>> ... You will need to download a license file in order to run freesurfer commands and you can put that in your home directory ... <<BR>> ... go to your home directory ... developer@DESKTOP-LD48TB7:~$ '''cd''' <<BR>> ... then download and/or copy in your license file and verify you can see it with the ls command ... developer@DESKTOP-LD48TB7:~$ '''ls license.txt''' <<BR>> license.txt ... set the environment variable FS_LICENSE to point to license.txt ... <<BR>> developer@DESKTOP-LD48TB7:~$ '''echo "export FS_LICENSE=$HOME/license.txt" >> $HOME/.bashrc''' ... set these environment variables for your display ... <<BR>> developer@DESKTOP-LD48TB7:~$ '''echo "export XDG_RUNTIME_DIR=$HOME/.xdg" >> $HOME/.bashrc''' <<BR>> developer@DESKTOP-LD48TB7:~$ '''echo "export DISPLAY=:0" >> $HOME/.bashrc''' ... set the Freesurfer environment to be setup when you open a new Linux terminal window ... <<BR>> developer@DESKTOP-LD48TB7:~$ '''echo "source $FREESURFER_HOME/SetUpFreeSurfer.sh" >> $HOME/.bashrc''' <<BR>> ... start a new Ubuntu linux terminal window and verify you see the following output showing the Freesurfer environment has been set ... <<BR>>- - - - - - - -freesurfer-linux-ubuntu18_x86_64-dev-20210518-60f02e6- - - - - - - - <<BR>>Setting up environment for FreeSurfer/FS-FAST (and FSL) <<BR>>FREESURFER_HOME /usr/local/freesurfer/7-dev/ <<BR>>FSFAST_HOME /usr/local/freesurfer/7-dev//fsfast <<BR>>FSF_OUTPUT_FORMAT nii.gz <<BR>>SUBJECTS_DIR /usr/local/freesurfer/7-dev//subjects <<BR>>INFO: /home/developer/matlab/startup.m does not exist ... creating <<BR>>MNI_DIR /usr/local/freesurfer/7-dev//mni ... you should now be able to start to run freesurfer commands ... ... if you see the following error when trying to run freeview ... <<BR>> developer@DESKTOP-LD48TB7:~$ '''freeview''' <<BR>> QXcbConnection: Could not connect to display :0 <<BR>> Could not connect to any X display. ... then try modifying your DISPLAY variable to contain your IP address before the :0 ... <<BR>> developer@DESKTOP-LD48TB7:~$ '''grep nameserver /etc/resolv.conf''' <<BR>> nameserver 154.132.1.1 <<BR>> developer@DESKTOP-LD48TB7:~$ '''export DISPLAY="154.132.1.1:0"''' ... if you have installed and setup Xming as your X-server on the windows host, then edit the Xming X0.hosts file to contain your machines IP address below the entry for localhost ... <<BR>> <<BR>> ... before edit ... <<BR>>developer@DESKTOP-LD48TB7:~$ '''cat /mnt/c/"Program Files (x86)"/Xming/X0.hosts''' <<BR>>localhost <<BR>>... after edit ... <<BR>>developer@DESKTOP-LD48TB7:~$ '''cat /mnt/c/"Program Files (x86)"/Xming/X0.hosts''' <<BR>>localhost <<BR>>154.132.1.1 <<BR>>... check DISPLAY matches IP address... <<BR>>developer@DESKTOP-LD48TB7:~$ '''echo $DISPLAY''' <<BR>>154.132.1.1:0 ... try running freeview again ... <<BR>>developer@DESKTOP-LD48TB7:~$ '''freeview''' |
Freesurfer install on Ubuntu Linux in WSL
Please read the latest MS documentation about how to setup WSL (version2 as of this writing) on your Windows machine, MS WSL Dcoumentation. Once you are able to bring up a terminal window in WSL's pre-installed version of Ubuntu linux you can proceed to setting up the Freesurfer environment. As of this writing, WSL should install Ubuntu 22 Linux and so the install of a Freesurfer Ubuntu 22 package is listed below.
The commands below shows how to download and install the freesurfer package. That is followed by notes on setting up a 3rd party X-windows server on the host Windows machine using Xming. If you do not need to view any brain images, e.g., through Freeview, then there is no need to setup the X-Windows server.
We do not advise manually trying to install packages in the Ubuntu Linux image in order to get freesurfer to run. Please allow the installer to try and determine what packages are needed on the system and install them.
developer@DESKTOP-LD48TB7:~$ cd
developer@DESKTOP-LD48TB7:~$ wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu22-7.4.1_amd64.deb
... download output ...
developer@DESKTOP-LD48TB7:~$ ls freesurfer_ubuntu22-7.4.1_amd64.deb
freesurfer_ubuntu22-7.4.1_amd64.deb
... update the package information in Ubuntu linux ...
developer@DESKTOP-LD48TB7:~$ sudo apt-get update -y
[sudo] password for developer:
... output from package updates ...
... install the freesurfer distribution under /usr/local/freesurfer/<release>. Anwer "Y" to any prompts ...
developer@DESKTOP-LD48TB7:~$ sudo apt-get -y install ./freesurfer_ubuntu22-7.4.1_amd64.deb
[sudo] password for developer:
The following NEW packages will be installed:
... output from package updates followed by install of freesurfer package ...
... check the Freesurfer release was installed under /usr/local/freesurfer/7.4.1 ...
... ls output ...
... setup the FREESURFER_HOME environment variable. The export commands below add the environment variable settings into your bash shell init file, i.e., .bashrc ...
developer@DESKTOP-LD48TB7:~$ echo "export FREESURFER_HOME=/usr/local/freesurfer/7.4.1" >> $HOME/.bashrc
... You will need to download a license file in order to run freesurfer commands and you can put that in your home directory ...
... go to your home directory ...
developer@DESKTOP-LD48TB7:~$ cd
... then download and/or copy in your license file and verify you can see it with the ls command ...
developer@DESKTOP-LD48TB7:~$ ls license.txt
license.txt
... set the environment variable FS_LICENSE to point to license.txt ...
developer@DESKTOP-LD48TB7:~$ echo "export FS_LICENSE=$HOME/license.txt" >> $HOME/.bashrc
... set these environment variables for your display ...
developer@DESKTOP-LD48TB7:~$ echo "export XDG_RUNTIME_DIR=$HOME/.xdg" >> $HOME/.bashrc
developer@DESKTOP-LD48TB7:~$ echo "export DISPLAY=:0" >> $HOME/.bashrc
... set the Freesurfer environment to be setup when you open a new Linux terminal window ...
developer@DESKTOP-LD48TB7:~$ echo "source $FREESURFER_HOME/SetUpFreeSurfer.sh" >> $HOME/.bashrc
... start a new Ubuntu linux terminal window and verify you see the following output showing the Freesurfer environment has been set ...
- - - - - - - -freesurfer-linux-ubuntu18_x86_64-dev-20210518-60f02e6- - - - - - - -
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer/7-dev/
FSFAST_HOME /usr/local/freesurfer/7-dev//fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /usr/local/freesurfer/7-dev//subjects
INFO: /home/developer/matlab/startup.m does not exist ... creating
MNI_DIR /usr/local/freesurfer/7-dev//mni
... you should now be able to start to run freesurfer commands ...
... if you see the following error when trying to run freeview ...
developer@DESKTOP-LD48TB7:~$ freeview
QXcbConnection: Could not connect to display :0
Could not connect to any X display.
... then try modifying your DISPLAY variable to contain your IP address before the :0 ...
developer@DESKTOP-LD48TB7:~$ grep nameserver /etc/resolv.conf
nameserver 154.132.1.1
developer@DESKTOP-LD48TB7:~$ export DISPLAY="154.132.1.1:0"
... if you have installed and setup Xming as your X-server on the windows host, then edit the Xming X0.hosts file to contain your machines IP address below the entry for localhost ...
... before edit ...
developer@DESKTOP-LD48TB7:~$ cat /mnt/c/"Program Files (x86)"/Xming/X0.hosts
localhost
... after edit ...
developer@DESKTOP-LD48TB7:~$ cat /mnt/c/"Program Files (x86)"/Xming/X0.hosts
localhost
154.132.1.1
... check DISPLAY matches IP address...
developer@DESKTOP-LD48TB7:~$ echo $DISPLAY
154.132.1.1:0
... try running freeview again ...
developer@DESKTOP-LD48TB7:~$ freeview
