This directory contains examples and demos on how to use SIRF.
Please also our Jupyter notebooks in the SIRF Exercises which are more extensive and allow you to learn step-by-step.
Most of the demos use simplistic data for illustration. The images might therefore be not very interesting either. The idea here is to illustrate what you can do with SIRF, not to give you a polished script that you would want to use on a daily basis.
The demos display usually some images. Generally, these might not make too much sense unless you have a look at the code.
The structure of the examples subfolder is as follows:
examples
Matlab
MR
Gadgetron
PET
PETMR
Registration
Python
MR
Gadgetron
PET
PETMR
Registration
SPECT
interactive
The contents of subfolder named Python are described here. The contents of subfolder named Matlab are of similar nature but are not documented as we no longer support Matlab.
The correct setup of SIRF requires defining the environment variables SIRF_PATH
and SIRF_INSTALL_PATH
.
If you built SIRF with the SIRF-Superbuild, these environment variables can be sourced from the env_sirf.*
files, e.g.
on Unix/Linux env_sirf.sh
.
Alternatively, SIRF_PATH
should be set by the user to the full path to the root folder containing the SIRF source,
and SIRF_INSTALL_PATH
to the full path to the folder where the user installed SIRF binaries and other files (i.e.
set by CMAKE_INSTALL_PREFIX
).
Additionally, the user may define the variable SIRF_DATA_PATH
to point to an alternative location. For instance, when the
installation files are in a write-protected location, the user can make a copy elsewhere and point there.
The resolution order for the examples data path is:
- The directory pointed by
${SIRF_DATA_PATH}
if it is set by the user. - The directory
${SIRF_INSTALL_PATH}/share/SIRF-<version_major>.<version_minor>
ifSIRF_INSTALL_PATH
is set. - The directory
${SIRF_PATH}/data/examples
ifSIRF_PATH
is set.