dip::Feature::Base class

The pure virtual base class for all measurement features.

Contents

Derived classes

class dip::Feature::LineBased abstract
The pure virtual base class for all line-based measurement features.
class dip::Feature::ImageBased abstract
The pure virtual base class for all image-based measurement features.
class dip::Feature::ChainCodeBased abstract
The pure virtual base class for all chain-code–based measurement features.
class dip::Feature::PolygonBased abstract
The pure virtual base class for all polygon-based measurement features.
class dip::Feature::ConvexHullBased abstract
The pure virtual base class for all convex-hull–based measurement features.
class dip::Feature::Composite abstract
The pure virtual base class for all composite measurement features.

Functions

void Configure(dip::String const& parameter, dip::dfloat value) virtual
A feature can have configurable parameters. Such a feature can define a Configure method that the user can access through dip::MeasurementTool::Configure.
auto Initialize(dip::Image const& label, dip::Image const& grey, dip::uint nObjects) -> dip::Feature::ValueInformationArray pure virtual
All measurement features define an Initialize method that prepares the feature class to perform measurements on the image. It also gives information on the feature as applied to that image.
void Cleanup() virtual
All measurement features define a Cleanup method that is called after finishing the measurement process for one image.

Variables

dip::Feature::Information const information
Information on the feature
dip::Feature::Type const type
The type of the measurement

Function documentation

dip::Feature::ValueInformationArray Initialize(dip::Image const& label, dip::Image const& grey, dip::uint nObjects) pure virtual

All measurement features define an Initialize method that prepares the feature class to perform measurements on the image. It also gives information on the feature as applied to that image.

This function should check image properties and throw an exception if the measurement cannot be made. The dip::MeasurementTool will not catch this exception, please provide a meaningful error message for the user. label will always be a scalar, unsigned integer image, and grey will always be of a real type. But grey can be a tensor image, so do check for that. For chain-code–based and convex-hull–based measurements, the images will always have exactly two dimensions; for other measurement types, the images will have at least one dimension, check the image dimensionality if there are other constraints. grey will always have the same dimensionality and sizes as label if the measurement requires a grey-value image; it will be a raw image otherwise.

Information returned includes the number of output values it will generate per object, what their name and units will be, and how many intermediate values it will need to store (for line-based functions only).

Note that this function can store information about the images in private data members of the class, so that it is available when performing measurements. For example, it can store the pixel size.