Skip to content

SIRF SuperBuild Ubuntu 16.04

Kris Thielemans edited this page May 28, 2019 · 39 revisions

This manual explains how to install the SIRF-SuperBuild and its dependencies on a clean Ubuntu system and run a simple MR and PET image reconstruction using Python.

Currently recommended version is Ubuntu 18.04. This is largely due to requirements by Gadgetron. It is possible to use older Ubuntu versions, but you will need to install gcc 6 or more recent and use that.

Note that these instructions should also work for most recent Ubuntu versions. It should work for other Debian-based systems as well but we have not tested this.

1. Install dependencies for SIRF

 sudo apt-get install build-essential git g++

You probably want Python support

sudo apt install python-dev python-pip python-tk 
python -m pip install --user --upgrade pip wheel setuptools
python -m pip install --user --only-binary=numpy,scipy,matplotlib numpy matplotlib nose coverage docopt

One of the PET Python demos (steepest_ascent.py) requires scipy.

python -m pip install --user scipy

Please check also our pages with specific instructions for SIRF and MATLAB, and SIRF and Python.

2. Install dependencies for Gadgetron

 sudo apt-get install \
    h5utils \ 
    liblapack-dev \
    libace-dev 

With the SIRF SuperBuild also the siemens_to_ismrmrd package can be installed. This package allows for the transformation of Siemens MR raw data to the ISMRMRD raw data format, which is the format used by SIRF for MR raw and image data. Siemens_to_ismrmrd requires the following dependencies:

    libxml2-dev \     
    libxslt-dev 

Installing the following will add extra functionality to Gadgetron which you might want (but are currently not used by SIRF).

    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.

3. Install SIRF-SuperBuild

Follow the SuperBuild README.md to install the SIRF-SuperBuild.

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 as opposed to building them via the SuperBuild as discussed here. You would then install the following first

    sudo apt-get install libfftw3-dev libboost-all-dev libhdf5-serial-dev \
       libarmadillo-dev libgtest-dev swig

4. Install Ismrmrd-python-tools

 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)

5. Open a terminal and start Gadgetron

If you didn't add the PATH statement to your .bashrc, you will have to repeat them in this terminal first

 gadgetron

6. Run Python examples for MR and PET image reconstructions

Run this in your original terminal (assuming you have sourced env_ccppetmr.*sh as suggested above)

  cd  $SIRF_PATH/examples/Python/MR
  python fully_sampled_recon.py 

  cd $SIRF_PATH/examples/Python/PET
  python osem_reconstruction.py

or any of the other demos, or use MATLAB of course.