Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Comparison Metrics

Mark Geurts edited this page Oct 2, 2015 · 2 revisions

Similar to Failure Modes, the TomoTherapy FMEA Simulation Tool uses "plugin" functions to allow customized metrics to be added. Each metric is computed for the reference (unmodified) plan dose and each Failure Mode simulated dose.

Contents

Metric Specification

The cell array metrics in the function AutoSystematicError() specifies the list of plugins that will be executed for each dose volume. Each row in this array specifies the name, function, and optional additional arguments to be passed to the plugin function as three string elements. In the following example, the plugin "gamma2pct1mm" calls the function "CalcGammaMetric" with the additional arguments "2" and "1". Multiple arguments (up to three) can be specified in the argument string, separated by a forward slash (/). At this time, only static values for optional parameters are currently supported.

metrics = {'gamma2pct1mm'   'CalcGammaMetric'   '2/1'};

Each metric plugin is executed using the feval() command, with the image structure as the first argument, reference dose structure as the second argument, modified dose as the third argument, atlas cell array as the fourth argument, and any additional arguments as specified in the metric cell array. A numerical metric is expected as the return variable. Given the example above, the execution will be as follows:

metric = feval('CalcGammaMetric', image, refDose, modDose, altas, '2', '1');

The image structure contains both the CT data and structure set information (see LoadReferenceImage() and LoadReferenceStructures() for more information on this format). For more information on the dose structure format, see CalcDose(). Finally, for information on the atlas cell array format, see LoadAtlas().

Current Installed Metrics

The following metrics are included and illustrate how the structures/atlas and dose arguments can be used. For additional documentation refer to the documentation in the function.

Function Arguments Description
CalcGammaMetric percent/dta Computes the 3D Gamma index pass rate percentage between the modified and reference dose volumes using global percent and dta (in mm) criteria. Only voxels greater than 20 percent of the maximum reference dose are included.
CalcStructureStat structure/stat Computes a specified stat for one or more structures. The stat can be Mean, Max, Min, Median, Std, Dx, or Vx (case insensitive). If Dx, the maximum dose to x percentage of the structure volume is calculated. If Vx, the percent volume receiving at least x dose is calculated. The structure argument can be any structure name within the atlas cell array. The voxels contained within all structures that match the inclusion/exclusion regexp criteria for that structure name are then determined, and the statistic computed and returned.

Adding New Metric Plugins

To add a new plugin, first write a function that accepts the image, refDose, modDose, and atlas as the first four arguments, then up to three additional arguments, that finally returns a metric value. The following example illustrates a function declaration with one argument:

metric = function NewMetricPlugin(image, refDose, modDose, altas, arg1)
% This is an example function to illustate how to write custom plugins
  
     % Compute the metric somehow
     metric = str2double(arg1) * max(max(max(modDose.data)));

% End of function  
end

Next, edit the metrics cell array definition in AutoSystematicError() to add the new function, giving it the name "newmetric":

metrics = {
     'gamma2pct1mm'   'CalcGammaMetric'   '2/1'
     'newmetric'      'NewMetricPlugin'   '5'
};

When NewMetricPlugin is executed, arg1 will be passed using a value of 5.