Easy fMRI is an open source toolbox for the Human Brain Mapping and Decoding. This project is developing by Muhammad Yousefnezhad, iBRAIN Group, Nanjing University of Aeronautics and Astronautics, China.
The project websites:
https://easyfmri.gitlab.io/ [preferred]
Data repositories:
https://easydata.gitlab.io [preferred]
https://easyfmridata.github.io
Easy fMRI needs following software:
-Platform: Linux (recommended), Mac, Windows (via Linux Virtual Machine, or Bash for Windows 10 or above)
-Python3 (version=3.7.x)
-FSL (version=5.0.1x or 6.0.0) for preprocessing steps
-AFNI & SUMA (version=17.3.06 or above) for 3D visualization
-CUDA for GPU-based algorithms
-cuDNN for GPU-based algorithms
-PyTorch for Gradient-based Optimization and Learning
-- Install Windows Subsystem for Linux https://docs.microsoft.com/en-us/windows/wsl/install-win10
NOTE: You have to install UBUNTU Linux from Windows Store.
-- Install Xming X Server for Windows: https://sourceforge.net/projects/xming/files/latest/download
-- Open command prompt (press Windows key + R, then in run window type cmd
and press enter)
-- Open bash via cmd:
bash
-- Set Display:
echo "export DISPLAY=:0.0" >> ~/.profile
source ~/.profile
Now you can install easy fMRI same as a linux system
-- Download easy fMRI files:
From GitLab:
git clone https://gitlab.com/easyfmri/easyfmri.git ~/.easyfmri
From GitHub:
git clone https://github.com/easyfmri/easyfmri.git ~/.easyfmri
-- Apply easy fMRI environment:
- Copy
ezfmri_scaled
andezfmri_scaled
to/usr/local/bin
:
cd ~/.easyfmri/Script
./cp_script
- Set environment variables:
cd ~/.easyfmri/Script
./install_script_bashrc
source ~/.startupscript
or
cd ~/.easyfmri/Script
./install_script_profile
source ~/.startupscript
-
Note 1: Since you did not install FSL and other related software, you may see some error on this stage such as
-bash: /usr/local/fsl/etc/fslconf/fsl.sh: No such file or directory
. Just skip them. -
Note 2: You must edit
~/.startupscript
and enable/disable different parameters based on your computer setting:
gedit ~/.startupscript
or
nano ~/.startupscript
or
vi ~/.startupscript
B.1) Installing FSL via NeuroDebian (For Debian or Ubuntu)
In Get NeuroDebian
section, you must select Linux version and the closest resource location and then run the generated script. In Select desired components
, you also must select all software
.
For instance, this script for Ubuntu 16.0.4
and The University of Science and Technology of China (USTC)
is:
wget -O- http://neuro.debian.net/lists/xenial.cn-bj2.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
sudo apt-get update
sudo apt install fsl-complete
and for Ubuntu 18.0.4
and The University of Science and Technology of China (USTC)
is:
wget -O- http://neuro.debian.net/lists/bionic.cn-bj2.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
sudo apt-get update
sudo apt install fsl-complete
B.2) Installing FSL based on the main source
-- Register on FSL website
-- Download fslinstaller.py
-- Run following for downloading installation file (e.g. In version 6.0.0, the file name is fsl-6.0.0-macOS_64.tar.gz
for Mac or fsl-6.0.0-centos7_64.tar.gz
for all Linux distribution)
For Linux:
python2 fslinstaller.py -o
md5sum fsl-6.0.0-centos7_64.tar.gz
For Mac:
python2 fslinstaller.py -o
md5sum fsl-6.0.0-macOS_64.tar.gz
-- Install the downloaded file:
For Linux:
python2 fslinstaller.py -f fsl-6.0.0-centos7_64.tar.gz -M
export FSLDIR="/usr/local/fsl"
cd $FSLDIR/etc/fslconf
source fsl.sh
sudo ./install_fsleyes.sh
sudo ./make_applications_links.sh
sudo ./post_install.sh
For Mac:
python2 fslinstaller.py -f fsl-6.0.0-macOS_64.tar.gz -M
-- Download AFNI:
-- Extract AFNI to ~/abin
Install linux packages for AFNI
-- Linux, Ubuntu 15.10 and earlier: The essential system setup
sudo apt-get install -y tcsh libxp6 xfonts-base python-qt4 \
libmotif4 libmotif-dev motif-clients \
gsl-bin netpbm xvfb gnome-tweak-tool \
libjpeg62 xterm gedit evince git
sudo apt-get install -y tcsh xfonts-base python-qt4 gedit evince \
libmotif4 libmotif-dev motif-clients \
gsl-bin netpbm xvfb gnome-tweak-tool libjpeg62
-- Linux, Ubuntu 16.04 - 17.10: The essential system setup
sudo apt-get install -y tcsh xfonts-base python-qt4 \
gsl-bin netpbm gnome-tweak-tool \
libjpeg62 xvfb xterm vim curl \
gedit evince \
libglu1-mesa-dev libglw1-mesa \
libxm4 build-essential git
sudo apt-get install -y gnome-terminal nautilus \
gnome-icon-theme-symbolic
-- Linux, Ubuntu 18.04: The essential system setup
sudo apt-get install -y tcsh xfonts-base python-qt4 \
gsl-bin netpbm gnome-tweak-tool \
libjpeg62 xvfb xterm vim curl \
gedit evince \
libglu1-mesa-dev libglw1-mesa \
libxm4 build-essential \
libcurl4-openssl-dev libxml2-dev \
libssl-dev libgfortran3 git
sudo apt-get install -y gnome-terminal nautilus \
gnome-icon-theme-symbolic
-- Fedora 21 (and higher): The essential system setup
sudo yum install -y tcsh libXp openmotif gsl xorg-x11-fonts-misc \
PyQt4 R-devel netpbm-progs gnome-tweak-tool ed \
xorg-x11-server-Xvfb git
sudo yum update -y
-- CentOS/RHEL 7: The essential system setup
sudo yum install -y epel-release
sudo yum install -y tcsh libXp openmotif gsl xorg-x11-fonts-misc \
PyQt4 R-devel netpbm-progs gnome-tweak-tool ed \
libpng12 xorg-x11-server-Xvfb git
sudo yum update -y
-- Download Anaconda3 for Python 3.7
Note: In Windows 10, you must install the linux version of Anaconda 3
-- Install Python 3.7
For Linux:
sh Anaconda3-<version>-Linux<platform>.sh
For Mac: click PKG file and continue installation.
Note 1: If you need to change the main repository of pip
, then:
- Creating the
~/.pip
directory by usingmkdir ~/.pip
- Then generate the setting file
~/.pip/pip.conf
. For instance, following setting can change the main repository toThe University of Science and Technology of China
:
[global]
timeout = 60
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple/
[install]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple/
Note 2: If you need to change the main repository of conda
, then create setting file ~/.condarc
. For instance, following setting can change the main repository to The University of Science and Technology of China
:
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
- defaults
ssl_verify: true
show_channel_urls: true
-- Load environment variables:
source ~/.startupscript
-- Update Conda Components:
conda update --all
-- Update pip
:
pip install -U pip
-- Install mpi4py
:
conda install -c conda-forge mpi4py
-- Install easy fMRI required python packages by using:
pip install -U future nibabel pyqode.core pyqode.qt
-- Install PyTorch package:
For CPU version:
In Mac OS:
conda install pytorch torchvision -c pytorch
In Linux:
conda install pytorch-cpu torchvision-cpu -c pytorch
For GPU Vesion: You must install CUDA 10 and cuDNN 7.4.1. Then, you can install PyTorch
conda install pytorch torchvision cuda100 -c pytorch
After restarting your computer, open a terminal and run easyfmri:
ezfmri
For computers with HiDPI display run following or just enable option in ~/.startupscript
.
ezfmri_scaled
For updating a new version, just replace the old files with the new files.
Note: default directory for easy fMRI is a hidden folder in ~/.easyfmri
rm -rf ~/.easyfmri
git clone https://gitlab.com/easyfmri/easyfmri.git ~/.easyfmri
rm -rf ~/.easyfmri