-
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
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
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.
Get the actual super-build.
git clone https://github.com/CCPPETMR/SIRF-SuperBuild
cd SIRF-SuperBuild/
And install it
cmake .
make
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)
export PYTHONPATH=$PYTHONPATH:~/Documents/devel/SIRF-SuperBuild/INSTALL/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/Documents/devel/SIRF-SuperBuild/INSTALL/lib
export SIRF_PATH=~/Documents/devel/SIRF-SuperBuild/SIRF
PATH=~/Documents/devel/SIRF-SuperBuild/INSTALL/bin:$PATH
git clone https://github.com/ismrmrd/ismrmrd-python-tools.git
cd ismrmrd-python-tools/
python setup.py --user install
(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