Into

Modules

Documentation

classPiiTableLabelerOperation

#include <PiiTableLabelerOperation.h>

PiiTableLabelerOperation can be used for classification where the classification rules are given in a table format.

Inherits PiiDefaultOperation

Description

The classifier has two ui componets, "configuration" and "toolbar". The "configurator" ui-component is used for setting manually the rules for the configurator and selecting labels for rules.

The operation supports several layers.

Inputs

featuresfeature vector of samples (any rule matrix with a primitive content type)

Outputs

labelXa classification (double) for the incoming features. If the operation is not configured, zero (0) is emitted for each incoming object. X denotes the zero-based index of the layer. For example, if there is only one layer, label0 emits its classification result. The label can be any floating point value, but its value range and resolution are limited by the layer type. For class label layers, emitted values are cardinal numbers.

Properties

QVariantList

Determines the properties of the features.

QVariantList

This property defines the result labels for the decision rows for the each layer.

QVariantList

A rather complex property which defines the rules, how feature inputs are converted to the labels in the outputs of the operation.

QVariantList

A property that defines the decision rules for the operation.

QVariantList

This property defines the rules for the decision rows for the each layer.

Constructors and destructor

Public member functions

( )

Creates the UI component for PiiTableLabelerOperation.

QVariantList
( )
QVariantList
( )
QList< QList< double > >

This function returns the labels in a "raw" format.

This function returns rule matrices in a "raw" format.

QList< QList< bool > >
QVariantList
( )
void
(
  • const QVariantList & featureProperties
)
void
( )
void
(
  • const QVariantList & layers
)
void
( )

This function sets the labels in a "raw" format.

void
( )

This function sets the rule matrices in a "raw" format.

void
( )
void
(
  • const QVariantList & ruleMatrices
)
void
( )

Returns the names of the supported UI components.

Protected member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

virtual void

Executes one round of processing.

Property details

  • QVariantList featureProperties

    [read, write]

    Determines the properties of the features.

    Contains the list of QVariantMaps, where each map contains the following key-value pairs:

    • displayName - visible name of the feature (QString)

    • name - id of the feature.

    • unit - unit of the feature (QString)

    • scale - scale of the feature unit compared to pixels (double)

    The item with the key "name" is mandatory. Other items are optional. The name and unit are shown for the user in the ui component. The scale is used for calculating the values as units stored in the rule matrices as pixels.

    Setting this property affects to the property ruleMatrices. The amount of columns (width) of each raws rule matrix is set equal to the length of the feature properties list set by this property.

    Changing the amount of the rows (height) of the rule matrices depens on the difference between the new features set by this property and the old features before setting the property. If by setting the property all the new features names are different than the old feature names, the rows of each rule matrix are removed. If by setting the property at least one new feature is same than the old, the rows in the rule matrices are not removed, but the column corresponding to the feature are copied from the old rule matrices to the new rule matrices. The equality is checked by comparing the name of the feature, not the unit nor the scale. If for a feature the new unit scale is different than the old, the visible values of the unit values changes according to the new scale, but they are still stored internally exaclty with the same values than before setting the property. The columns corresponding to the new feature are cleared in the raw rule matrices (by setting the min and max values to -INF and INF values).

  • QVariantList labels

    [read, write]

    This property defines the result labels for the decision rows for the each layer.

    The property contain a list, where an item is another list converted to QVariant. This inner list contains doubles converted to QVariant. The inner list contains the label values for a layer. The outer list contains these lists for each layer.

  • QVariantList layers

    [read, write]

    A rather complex property which defines the rules, how feature inputs are converted to the labels in the outputs of the operation.

    For each entry in this list, a new labeling layer is created. The configuration of the layer is stored as a map of name-value pairs. That is, each QVariant in this list is actually a QMap<QString, QVariant>. The configuration parameters depend on the type of the layer. Refer to the documentation of PiiLayerParser to get the more information of the exacts structure of the item in the list.

  • QVariantList ruleMatrices

    [read, write]

    A property that defines the decision rules for the operation.

    The ruleMatrices data structure contains a list of matrices, where each matrix contains the decision rules for a layer. The matrix is of type PiiMatrix<double>, which must be casted to QVariant through PiiVariant before adding to ruleMatrices list. The rows in a matrix is equal to the amount of rows of decision rules used in the layer. The items in a row contains the minimum and maximum values of the features to be used in the decision. The minimum and maximum values must alternate so that the minimum values are located in the even indexed locations and the maximum values in the odd indexed location. The amount of columns in a row should be twice the amount of the features in a feature vector coming in the operatotion through the featureInput.

  • QVariantList rules

    [read, write]

    This property defines the rules for the decision rows for the each layer.

    The property contain a list, where an item is another list converted to QVariant. This inner list contains booleans converted to QVariant. The inner list contains the boolean values for a layer (AND = true, OR = false). The outer list contains these lists for each layer.

Function details

  • PiiTableLabelerOperation

    ()
  • QWidget * createUiComponent

    ( )

    Creates the UI component for PiiTableLabelerOperation.

    Currently the UI components "configurator" and "toolbar" are supported. "configurator" is a widget of type PiiTableLabelerConfigurator. "toolbar" is a toolbar, of type PiiTableLabelerToolBar, for managing the configurator. The order of creation of "configurator" and "toolbar" doesn't matter.

  • QVariantList featureProperties

    ()
  • QList< QVariant > labels

    ()
  • QVariantList layers

    ()
  • QList< QList< double > > rawLabels

    ()

    This function returns the labels in a "raw" format.

    See the function setRawLabels() for the more information.

  • QList< PiiMatrix< PiiMinMax > > rawRuleMatrices

    ()

    This function returns rule matrices in a "raw" format.

    The matrices returned are deep copies of the orginal matrices. See the function setRawRuleMatrices for the more information.

  • QList< QList< bool > > rawRuleVectors

    ()
  • QVariantList ruleMatrices

    ()
  • QList< QVariant > rules

    ()
  • void setFeatureProperties

    (
    • const QVariantList & featureProperties
    )
  • void setLabels

    ( )
  • void setLayers

    (
    • const QVariantList & layers
    )
  • void setRawLabels

    ( )

    This function sets the labels in a "raw" format.

    The raw in this context means the format, that the PiiTableLabelerOperation itself uses for storing the label information. This function is recommended to be called only from inside the classification plugin. If you want to set the labels from somewhere else, use the labels property interface in stead.

  • void setRawRuleMatrices

    ( )

    This function sets the rule matrices in a "raw" format.

    The raw in this context means the format, that the PiiTableLabelerOperation itself uses for storing the matrices. This function is recommended to be called only from inside the plugin. If you want to set the rule matrices from somewhere else, use the ruleMatrices property interface in stead.

  • void setRawRuleVectors

    ( )
  • void setRuleMatrices

    (
    • const QVariantList & ruleMatrices
    )
  • void setRules

    ( )
  • QStringList supportedUiComponents

    ()

    Returns the names of the supported UI components.

    Currently configurator and toolbar are supported.

  • virtual void check

    (
    • bool reset
    )
    [protected, virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiDefaultOperation.

  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.