Gaia
gaia2::Analyzer Class Reference

the Analyzer abstract base class. More...

#include <analyzer.h>

Inheritance diagram for gaia2::Analyzer:
gaia2::AddField gaia2::Center gaia2::Cleaner gaia2::Enumerate gaia2::Extract gaia2::FixLength gaia2::Gaussianize gaia2::InverseProjection gaia2::MergeRegion gaia2::Normalize gaia2::PCA gaia2::RCA gaia2::Remove gaia2::RemoveVL gaia2::Rename gaia2::Select gaia2::SVMTrain

Public Member Functions

 Analyzer (const ParameterMap &params)
 
virtual Transformation analyze (const DataSet *dataset) const
 
virtual Transformation analyze (const DataSet *dataset, const Region &region) 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 RegioncheckFixedLength (const Region &region, 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
 

Detailed Description

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!

Member Function Documentation

void gaia2::Analyzer::checkDataSet ( const DataSet dataset) const

Checks that the given dataset is valid.

At the moment, it does:

  • checks that it is not a null pointer
  • checks that all the points share the same layout memory object
    Exceptions
    GaiaExceptionif 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.

Exceptions
GaiaExceptionif 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.

Exceptions
GaiaExceptionif that is not the case.

References name.

Referenced by gaia2::RCA::analyze().

Member Data Documentation

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().


The documentation for this class was generated from the following files: