ImageDev

AnalysisMsr

Defines the measurements to compute in analysis algorithms and gives access to their results.

The analysis algorithms using this object are listed here.

Some native measurements are already available. The NativeMeasurements object gives quick access to their MsrInfo.
In addition to native measurements, an API to generate user-defined measurements is available. The registerCustomMeasurement static method adds a custom measurement to the current instance.

See related example

Syntax

Method Description
static AnalysisMsr read( const std::string& pathName ) Reads an AnalysisMsr object from a file name.
void write( const std::string& pathName ) Writes an AnalysisMsr object to a file name.
static const MsrInfo* getMeasurementInfoFromName( const std::string& name ) Gets the information of a measurement from its name.
The MsrInfo object contains the name and the physical dimension of the measurement.
std::shared_ptr< iolink::DataFrameView > toDataFrame() Convert the analysis into an iolink DataFrame.
std::shared_ptr< Measurement> select( const MsrInfo* info ) Selects a specific measurement to be computed by an image analysis processing algorithm.
The type of the measurement returned by this method depends on the type of the given MsrInfo object.
For instance, adding an Area2dInfo object returns the related Area2d measurement object generated.
void select( std::vector< MsrInfo*> infos ) Selects a list of measurements to be computed by an image analysis processing algorithm.
std::shared_ptr< Measurement> get( const MsrInfo* info ) Returns the measurement corresponding to the given MsrInfo object.
For instance, getting an Area2dInfo object returns the Area2d measurement object.
uint64_t labelCount() Returns the number of label.
static const CustomMeasurementInfo* registerCustomMeasurement( const std::string& name, const std::string& formula, const std::string& description ) Adds a custom measurement to the current instance.
This custom measurement is defined by a name, a formula and a description. The formula is a combination of native measurement and the syntax can be checked using the checkMeasurementFormula utility. A CustomMeasurementInfo is returned for further use.
Method Description
read(pathname) Reads an AnalysisMsr object from a file name.
write(self, pathname) Writes an AnalysisMsr object to a file name.
msr_from_name(name) Gets the information of a measurement from its name.
The MsrInfo object contains the name and the physical dimension of the measurement.
to_data_frame() -> iolink.DataFrameView Convert the analysis into an iolink DataFrame.
select(self, msr) Selects a specific measurement to be computed by an image analysis processing algorithm.
The type of the measurement returned by this method depends on the type of the given MsrInfo object.
For instance, adding an Area2dInfo object returns the related Area2d measurement object generated.
select(self, infos) Selects a list of measurements to be computed by an image analysis processing algorithm.
get(self, info) Returns the measurement corresponding to the given MsrInfo object.
For instance, getting an Area2dInfo object returns the Area2d measurement object.
label_count(self) Returns the number of label.
register_custom_measurement( name, formula, description ) -> CustomMeasurementInfo Adds a custom measurement to the current instance.
This custom measurement is defined by a name, a formula and a description. The formula is a combination of native measurement and the syntax can be checked using the checkMeasurementFormula utility. A CustomMeasurementInfo is returned for further use.
Method Description
static AnalysisMsr Read(String pathName) Reads an AnalysisMsr object from a file name.
void Write(String pathName) Writes an AnalysisMsr object to a file name.
static MsrInfo GetMeasurementInfoFromName(String name) Gets the information of a measurement from its name.
The MsrInfo object contains the name and the physical dimension of the measurement.
IOLink.DataFrameView ToDataFrame() Convert the analysis into an iolink DataFrame.
Measurement Select(MsrInfo info) Selects a specific measurement to be computed by an image analysis processing algorithm.
The type of the measurement returned by this method depends on the type of the given MsrInfo object.
For instance, adding an Area2dInfo object returns the related Area2d measurement object generated.
void Select(MsrInfo[] infos) Selects a list of measurements to be computed by an image analysis processing algorithm.
Measurement Get(MsrInfo info) Returns the measurement corresponding to the given MsrInfo object.
For instance, getting an Area2dInfo object returns the Area2d measurement object.
int LabelCount() Returns the number of label.
static CustomMeasurementInfo RegisterCustomMeasurement(String name, String formula, String description ) Adds a custom measurement to the current instance.
This custom measurement is defined by a name, a formula and a description. The formula is a combination of native measurement and the syntax can be checked using the checkMeasurementFormula utility. A CustomMeasurementInfo is returned for further use.