Skip to content

SIRF SuperBuild Ubuntu

Kris Thielemans edited this page Mar 14, 2024 · 8 revisions

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

Currently recommended version is Ubuntu 22.04. Older versions will require manual installation of gcc-9 or more recent.

Note that these instructions should also work for other Debian-based systems. See our page when you use conda for an alternative.

1. Install dependencies via APT

Step-by-step instructions are here. However, we recommend using our installation scripts (used on docker, the VM and GitHub Actions). You might want to check them first of they don't do anything unexpected. This would go as follows:

git clone https://github.com/SyneRBI/SIRF-SuperBuild
cd SIRF-SuperBuild/docker

then copy-paste lines from here

If you have an NVidia GPU, optionally do

sudo apt install nvidia-cuda-toolkit

2. 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.

3. Optionally install ismrmrd-python-tools

pip install --user 'git+https://github.com/ismrmrd/ismrmrd-python-tools.git@master#egg=ismrmrd-python-tools'

4. Open a terminal and start Gadgetron

(assuming you have sourced env_sirf.*sh as suggested on the install instructions)

gadgetron

5. Run Python examples for MR and PET image reconstructions

Run this in your original terminal (assuming you have sourced env_sirf.*sh as suggested on the install instructions)

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

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

or any of the other demos.