Installation
YAGIT requires a C++ compiler that supports C++17. It also requires CMake (3.16 or newer). It works on Linux and Windows. It can be downloaded from https://github.com/DataMedSci/yagit.
YAGIT uses these dependencies:
GDCM – used for reading DICOM files.
xsimd – used for vectorization. Used only when
GAMMA_VERSION=SIMD
orGAMMA_VERSION=THREADS_SIMD
.GoogleTest – used for unit tests. Used only when
BUILD_TESTING=ON
.
You can build and install YAGIT using the setup script or by doing it manually.
Setup script installation
To build YAGIT, simply run setup.sh or setup.bat script, depending on your operating system.
On Linux, run:
./setup.sh
On Windows, run:
setup.bat
Note that these scripts will only build the library and not install it by default. To install it, configure the options appropriately in the script file.
For now, the Windows script can install dependencies using only Conan package manager.
Script options
You can freely configure the options that are in the script files. Some of the options are the same as in the CMake YAGIT options section, as they are simply passed to CMake.
Option |
Values |
Default |
Description |
---|---|---|---|
|
|
|
Build type used in the script by CMake for single-target generators (e.g., Makefile Generators) and by a compiler for multi-target generators (e.g., Visual Studio Generators). |
|
|
|
Equivalent to the CMake YAGIT option. |
|
|
|
Method of installing dependencies.
Value |
|
|
|
Equivalent to the CMake YAGIT option. |
|
|
|
Equivalent to the CMake YAGIT option. |
|
|
|
Equivalent to the CMake YAGIT option. |
|
|
|
Equivalent to the CMake YAGIT option. Additionally, it runs examples. |
|
|
|
Equivalent to the CMake YAGIT option. Additionally, it runs unit tests. |
|
|
|
Equivalent to the CMake YAGIT option. Additionally, it runs performance tests. |
|
— |
— |
Path to a reference image used in examples and performance tests. |
|
— |
— |
Path to an evaluated image used in examples and performance tests. |
|
|
|
Build documentation (docs directory). It requires Doxygen, Python, and libraries listed in docs/requirements.txt. |
|
|
|
Install YAGIT library. |
|
— |
./yagit |
Directory where YAGIT will be installed
(only if |
Manual installation
If you prefer to perform the installation manually without the script, then follow the commands below to build and install YAGIT on Linux. Before running them, ensure that you have installed the dependencies (e.g., by using a package manager or by building from source).
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j
sudo cmake --install .
If you don’t have admin privileges or you want to install in a specific directory, then use this command:
cmake --install . --prefix <yagit installation path>
CMake YAGIT options
Option |
Values |
Default |
Description |
---|---|---|---|
|
|
|
Build YAGIT as a shared or static library. |
|
|
|
Build examples (examples directory). |
|
|
|
Build unit tests (tests/unit directory). |
|
|
|
Build performance tests (tests/performance directory). |
|
|
|
Implementation of algorithms calculating the gamma index. |
|
|
|
SIMD instruction set extension.
It works only when |
|
|
|
Enable fused multiply-add (FMA) when building YAGIT library. |
To use these options, pass them to CMake during configuration using -D<option>=<value>
(e.g., cmake .. -DGAMMA_VERSION=THREADS_SIMD -DSIMD_EXTENSION=AVX2
).
CMake YAGIT integration
Here is an example of adding YAGIT to your CMake project.
find_package(yagit REQUIRED)
add_executable(program program.cpp)
target_link_libraries(program PRIVATE yagit::yagit)
If YAGIT has been installed in a custom location, then you need to set the CMAKE_PREFIX_PATH
option
to the path of the installed YAGIT. This is necessary for locating the yagitConfig.cmake file.
Including YAGIT
To include the whole YAGIT library in your code, use the line below.
#include <yagit/yagit.hpp>