CustomMeasurement
This class allows the creation of a new label analysis measurement, based on a user-defined formula.
A custom measurement is defined by a string formula that can invoke other measurements. It can be used by most of the individual analysis algorithms. It must have a unique name.
The formula defining a custom measurement must be written in accordance with the custom formula syntax. The validity of the formula can be verified with the checkMeasurementFormula method.
Notes
A custom measurement is defined by a string formula that can invoke other measurements. It can be used by most of the individual analysis algorithms. It must have a unique name.
The formula defining a custom measurement must be written in accordance with the custom formula syntax. The validity of the formula can be verified with the checkMeasurementFormula method.
Notes
- Even if it generally works, it is not recommended to create a new user measurement which depends on another user measurement, because it may not be as efficient as one might expect. The order of computation may also cause some problems.
- A user-defined measurement cannot refer to an array of another measurement, except for distributions like FeretDiameter where the array is accessed through brackets.
AnalysisMsr* analysis = new AnalysisMsr();
// Create a circularity factor between 0 and 1
std::string circularityFormula = "1.0/InverseCircularity";
if ( checkMeasurementFormula( circularityFormula ) )
{
auto customMeasurementInfo =
AnalysisMsr::registerCustomMeasurement( "Circularity", circularityFormula, "This is my circularity factor." );
auto circularity = analysis->select( customMeasurementInfo );
}
analysis = imagedev.AnalysisMsr()
# Create a circularity factor between 0 and 1
circularity_formula = "1.0/InverseCircularity";
if (imagedev.check_measurement_formula(circularity_formula)):
customMeasurementInfo = imagedev.registerCustomMeasurement("Circularity", circularityFormula, "This is my circularity factor.")
circularity = analysis.select(customMeasurementInfo)
AnalysisMsr analysis = new AnalysisMsr();
// Create a circularity factor between 0 and 1
String circularityFormula = "1.0/InverseCircularity";
if (Processing.CheckMeasurementFormula(circularityFormula))
{
var customMeasurementInfo =
AnalysisMsr.RegisterCustomMeasurement("Circularity", circularityFormula, "This is my circularity factor.");
var circularity = analysis.Select(customMeasurementInfo);
}