Installation and Use - mwgeurts/gamma GitHub Wiki
The following sections provide instructions on installing, configuring, and executing CalcGamma()
.
Contents
Installation
To install CalcGamma()
, copy the CalcGamma.m MATLAB file from this repository into your MATLAB path. If installing as a submodule into another git repository, execute git submodule add https://github.com/mwgeurts/gamma
.
Compatibility
See Unit Testing for system configuration details on which this function was validated.
Requirements
The Parallel Computing toolbox and a CUDA-compatible GPU are required to run GPU based interpolation. CPU interpolation is automatically supported if not present. Parallel execution of 1-D interpolation using GPU was introduced in MATLAB R2013a, 2-D interpolation in R2013b, and 3-D interpolation in R2014a.
To test whether the Parallel Computing toolbox is installed and your GPU device is compatible, execute gpuDevice(1)
in MATLAB. If successful, the response should be a CUDADevice object.
Syntax
To compute Gamma, execute CalcGamma()
with one of the following syntaxes:
gamma = CalcGamma(reference, target, percent, dta);
gamma = CalcGamma(..., 'OptionName', OptionValue);
Example
reference.start = [-10 -10]; % mm
reference.width = [0.1 0.1]; % mm
reference.data = rand(200);
target.start = [-10 -10]; % mm
target.width = [0.1 0.1]; % mm
target.data = rand(200);
percent = 3;
dta = 0.5; % mm
local = 0; % Perform global gamma
gamma = CalcGamma(reference, target, percent, dta, 'local', local);
Input Arguments
Variable | Type | Description |
---|---|---|
reference | structure | Reference data containing the fields start , width , and data . The field start is an array containing the coordinates along each dimension of the first voxel, width is an array containing the width of each voxel along each dimension, and data is an n-dimensional array |
target | structure | Target data containing the fields start , width , and data . The field start is an array containing the coordinates along each dimension of the first voxel, width is an array containing the width of each voxel along each dimension, and data is an n-dimensional array |
percent | double | Gamma absolute criterion percentage |
dta | double | Gamma Distance To Agreement (DTA) criterion, in the same units as the reference and target width structure fields |
The following options can be passed to this argument as name/value pairs:
Variable | Type | Description |
---|---|---|
local | logical | Indicates whether to perform a local (1) or global (0) Gamma computation. If not present, the function will assume a global Gamma computation. |
refval | double | Reference value for the global absolute criterion. Is used with the percentage from varargin{3} to compute absolute value. If not present, the maximum value in the reference data is used. |
restrict | logical | Restricted search flag. If 1, only the gamma values along the X/Y/Z axes are computed during 3D comptation. If 0 or not provided, the entire rectangular search space is computed. |
res | integer | DTA resolution factor. The number of distance steps equal the resolution factor multiplied by the limit. If not provided, the factor is 100 for 1D, 50 for 2D, and 20 for 3D calculations. |
limit | double | DTA limit. This number determines how far the function will search in the distance axes when computing Gamma. This also therefore specifies the maximum "real" Gamma Index value. If not provided, the function will use 2. |
cpu | boolean | Set to 1 to force CPU computation. |
Output Arguments
Variable | Type | Description |
---|---|---|
gamma | double array | Array of the same dimensions as target.data containing the computed Gamma index values |