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
Outputs
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
|
QWidget *
|
Creates the UI component for |
|
QVariantList
|
|
|
( )
|
|
|
QVariantList
|
( )
|
|
( )
This function returns the labels in a "raw" format. |
|
|
( )
This function returns rule matrices in a "raw" format. |
|
|
( )
|
|
|
QVariantList
|
( )
|
|
( )
|
|
|
void
|
(
|
|
void
|
|
|
void
|
(
|
|
void
|
This function sets the labels in a "raw" format. |
|
void
|
This function sets the rule matrices in a "raw" format. |
|
void
|
|
|
void
|
(
|
|
void
|
|
|
Returns the names of the supported UI components. |
Protected member functions
|
virtual void
|
(
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)
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.
-
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
PiiLayerParserto 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.
Function details
-
PiiTableLabelerOperation
() -
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 theconfigurator. The order of creation of "configurator" and "toolbar" doesn't matter. -
QVariantList featureProperties
() -
-
QVariantList layers
() -
This function returns the labels in a "raw" format.
See the function setRawLabels() for the more information.
-
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.
-
-
QVariantList ruleMatrices
() -
-
void setFeatureProperties
(- const QVariantList & featureProperties
-
-
void setLayers
(- const QVariantList & layers
-
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
classificationplugin. If you want to set the labels from somewhere else, use thelabelspropertyinterface in stead. -
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
ruleMatricespropertyinterface in stead. -
-
void setRuleMatrices
(- const QVariantList & ruleMatrices
-
-
QStringList supportedUiComponents
()Returns the names of the supported UI components.
Currently
configuratorandtoolbarare 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.
Add a note
Not a single note added yet. Be the first, add yours.