-
Notifications
You must be signed in to change notification settings - Fork 29
SIRF SuperBuild Ubuntu 16.04
This manual explains how to install the SIRF-SuperBuild and its dependencies on a clean Ubuntu 16.04 system and run a simple MR and PET image reconstruction using Python. The installation is done in a new folder devel in ~/Documents
cd ~/Documents
mkdir devel
cd devel
Note that this might work for other Debian-based systems as well but we have not tested this.
sudo apt-get install build-essential git g++
You probably want Python support
sudo apt-get install python-matplotlib python-dev python-docopt
One of the PET Python demos (steepest_ascent.py) requires scipy. If you want to run it, you need to install python-scipy
sudo apt-get install python-scipy
Please check also our pages with specific instructions for SIRF and MATLAB, and SIRF and Python.
sudo apt-get install \
h5utils \
liblapack-dev \
libace-dev
Installing the following will add extra functionality to Gadgetron which you might want (but are currently not used by SIRF).
libxml2-dev \
libxslt-dev \
python-h5py \
python-libxml2 \
python-psutil \
libplplot-dev
Optionally install CUDA suport if you have a NVidia GPU
sudo apt-get install nvidia-cuda-toolkit
Optionally install MKL, see our separate page including some info on harmless warnings you will get if you don't install MKL.
Ensure the correct cmake version is installed (we need at least 3.7.2)
wget https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh
sudo mkdir /opt/cmake
sudo bash cmake-3.7.2-Linux-x86_64.sh --prefix=/opt/cmake
export PATH=/opt/cmake/cmake-3.7.2-Linux-x86_64/bin:$PATH
Note that if you want to use MATLAB, you need to specify a compiler supported by MATLAB. Please
check our SIRF and MATLAB page. We recommend that you create a MATLAB_ROOT
environment variable pointing to your favorite matlab version.
export MATLAB_ROOT=/usr/local/mymatlab/
Get the actual super-build.
git clone https://github.com/CCPPETMR/SIRF-SuperBuild
cd SIRF-SuperBuild/
And install it
cmake .
make
This should run smoothly but will take a while.
If you have a multi-core system you can speed-up the compilation by using parallel builds. For instance, on a 4 core system you could try to use make -j -l3
as opposed to make
.
As opposed to running CMake with default options, you could run cmake-gui
or ccmake
to select some
options. You could for instance decide to use Ubuntu packages for some of the dependencies after installing
sudo apt-get install libfftw3-dev libboost-all-dev libhdf5-serial-dev \
libarmadillo-dev libgtest-dev swig
More detail on this is out-of-scope for this page.
mv INSTALL/share/gadgetron/config/gadgetron.xml.example INSTALL/share/gadgetron/config/gadgetron.xml
(you want to add this to your .bashrc)
source ~/Documents/devel/SIRF-SuperBuild/INSTALL/bin/env_ccppetmr.sh
git clone https://github.com/ismrmrd/ismrmrd-python-tools.git
cd ismrmrd-python-tools/
python setup.py install --user
(or use python3
of course if that's your version)
If you didn't add the PATH statement to your .bashrc, you will have to repeat them in this terminal first
gadgetron
Run this in your original terminal
cd ~/Documents/devel/SIRF-SuperBuild/SIRF/examples/Python/MR
python fully_sampled_recon.py
cd ~/Documents/devel/SIRF-SuperBuild/SIRF/examples/Python/PET
python osem_reconstruction.py