-
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
sudo apt-get install build-essential python-matplotlib g++ python-dev python-docopt git
sudo apt-get install \
libfftw3-dev \
h5utils \
python-dev python-numpy \
liblapack-dev \
libxml2-dev \
libxslt-dev \
libarmadillo-dev \
libace-dev \
python-h5py \
python-libxml2 \
python-psutil \
libgtest-dev \
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/bin:$PATH
Get the actual super-build.
git clone https://github.com/CCPPETMR/SIRF-SuperBuild
cd SIRF-SuperBuild/
And install it
cmake .
make
Note that if you want to use MATLAB, you need to specify a compiler supported by MATLAB. You need to do this the very first time you run CMake. For instance:
sudo apt-get install g++-4.7
CC=gcc-4.7 CXX=g++-4.7 cmake .
make
As opposed to running CMake with default options, you could run cmake-gui
or ccmake
to select some
options, but 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/
sudo python setup.py install
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