Gaia
|
the Analyzer abstract base class. More...
#include <analyzer.h>
Public Member Functions | |
Analyzer (const ParameterMap ¶ms) | |
virtual Transformation | analyze (const DataSet *dataset) const |
virtual Transformation | analyze (const DataSet *dataset, const Region ®ion) const |
void | checkDataSet (const DataSet *dataset) const |
Checks that the given dataset is valid. More... | |
void | checkMinPoints (const DataSet *dataset, int n) const |
Checks that the given dataset as at least the specified number of points. More... | |
const Region & | checkFixedLength (const Region ®ion, const PointLayout &layout) const |
Checks that the given Region only contains fixed-length descriptors and throws an exception if not. More... | |
Public Attributes | |
QString | name |
Name for the algorithm, usually the key that was used to instantiate it from the factory. | |
QStringList | validParams |
List of valid parameters this analyzer accepts. More... | |
Protected Attributes | |
ParameterMap | _params |
QStringList | _descriptorNames |
QStringList | _exclude |
the Analyzer abstract base class.
If you want to implement a specific analyzer, you need to inherit from this base class and implement either one of the 2 analyze methods.
Analyzer::analyze(DataSet*) just gives you the DataSet and you're good to go, whereas Analyzer::analyze(DataSet*, Region&) gives you an already parsed Region of descriptors as well (got from the descriptorNames
and exclude
parameter.
: if you use the analyze(DataSet*) method, you should also call the checkDataSet() method to make sure you were not given a null pointer!
void gaia2::Analyzer::checkDataSet | ( | const DataSet * | dataset | ) | const |
Checks that the given dataset is valid.
At the moment, it does:
GaiaException | if there was a problem with the dataset. |
References gaia2::DataSet::checkAllPointsShareSameLayout().
Referenced by gaia2::RCA::analyze(), and checkFixedLength().
const Region & gaia2::Analyzer::checkFixedLength | ( | const Region & | region, |
const PointLayout & | layout | ||
) | const |
Checks that the given Region only contains fixed-length descriptors and throws an exception if not.
GaiaException | if the region contained variable-length descriptors. |
References checkDataSet(), gaia2::PointLayout::descriptorLocation(), gaia2::PointLayout::descriptorNames(), gaia2::Region::isLengthTypeOnlyFrom(), gaia2::DataSet::layout(), name, gaia2::Region::select(), and gaia2::selectDescriptors().
Referenced by gaia2::RCA::analyze().
void gaia2::Analyzer::checkMinPoints | ( | const DataSet * | dataset, |
int | n | ||
) | const |
Checks that the given dataset as at least the specified number of points.
GaiaException | if that is not the case. |
References name.
Referenced by gaia2::RCA::analyze().
QStringList gaia2::Analyzer::validParams |
List of valid parameters this analyzer accepts.
It needs to be filled in the constructor of the derived analyzer, and will be checked by the factory just after instantiation.
Referenced by gaia2::SVMTrain::initParams().