latest version v1.9 - last update 10 Apr 2010 |
This class provides some possibilites to visualize the given SOFM. More...
#include <ltiSOFM2DVisualizer.h>
Classes | |
class | parameters |
the parameters for the class SOFM2DVisualizer More... | |
Public Member Functions | |
SOFM2DVisualizer () | |
SOFM2DVisualizer (const parameters &par) | |
SOFM2DVisualizer (const SOFM2DVisualizer &other) | |
virtual | ~SOFM2DVisualizer () |
virtual const char * | getTypeName () const |
template<typename T > | |
bool | uMatrix (drawBase< T > &drawer, const SOFM2D &som) const |
template<typename T > | |
bool | drawClasses (drawBase< T > &drawer, const SOFM2D &som, const dmatrix &data, const ivector &ids) const |
template<typename T > | |
bool | drawHits (drawBase< T > &drawer, const SOFM2D &som, const dmatrix &data) const |
template<typename T > | |
bool | componentPlane (drawBase< T > &drawer, const SOFM2D &som, const int &comp) const |
template<typename T > | |
bool | sammonsMapper (drawBase< T > &drawer, const SOFM2D &som) const |
SOFM2DVisualizer & | copy (const SOFM2DVisualizer &other) |
SOFM2DVisualizer & | operator= (const SOFM2DVisualizer &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This class provides some possibilites to visualize the given SOFM.
If the drawer is an instance of ltiDraw<T>, you have to set the background color of the image that is used to a value that is different from the drawing colors in the colormap.
lti::SOFM2DVisualizer::SOFM2DVisualizer | ( | ) |
default constructor
lti::SOFM2DVisualizer::SOFM2DVisualizer | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::SOFM2DVisualizer::SOFM2DVisualizer | ( | const SOFM2DVisualizer & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::SOFM2DVisualizer::~SOFM2DVisualizer | ( | ) | [virtual] |
destructor
virtual functor* lti::SOFM2DVisualizer::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
bool lti::SOFM2DVisualizer::componentPlane | ( | drawBase< T > & | drawer, | |
const SOFM2D & | som, | |||
const int & | comp | |||
) | const [inline] |
Draws one component of the given som.
References lti::matrix< T >::getColumnCopy(), getParameters(), lti::SOFM::getPrototypes(), lti::drawBase< T >::rectangle(), lti::drawBase< T >::setGray(), lti::SOFM2DVisualizer::parameters::symbolSize, lti::SOFM2D::xSize(), and lti::SOFM2D::ySize().
SOFM2DVisualizer& lti::SOFM2DVisualizer::copy | ( | const SOFM2DVisualizer & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
bool lti::SOFM2DVisualizer::drawClasses | ( | drawBase< T > & | drawer, | |
const SOFM2D & | som, | |||
const dmatrix & | data, | |||
const ivector & | ids | |||
) | const [inline] |
draws distribution of data colored according to ids.
drawer | the drawing object | |
som | the som to draw | |
data | the | |
ids | the ids according to the data |
References lti::genericMatrix< T >::at(), lti::genericVector< T >::at(), lti::SOFM2D::classify(), getParameters(), lti::SOFM::getPrototypes(), lti::matrix< T >::getRow(), lti::classifier::outputVector::getWinnerUnit(), lti::vector< T >::maximum(), lti::drawBase< T >::rectangle(), lti::genericMatrix< T >::rows(), lti::rgbPixel::setBlue(), lti::drawBase< T >::setColor(), lti::rgbPixel::setGreen(), lti::rgbPixel::setRed(), lti::SOFM2D::xSize(), and lti::SOFM2D::ySize().
bool lti::SOFM2DVisualizer::drawHits | ( | drawBase< T > & | drawer, | |
const SOFM2D & | som, | |||
const dmatrix & | data | |||
) | const [inline] |
Classifies the given data with the som and draws the distribution of the hits where the data points were classified in the som.
References lti::genericMatrix< T >::at(), lti::SOFM2D::classify(), lti::matrix< T >::divide(), getParameters(), lti::matrix< T >::getRow(), lti::classifier::outputVector::getWinnerUnit(), lti::matrix< T >::maximum(), lti::drawBase< T >::rectangle(), lti::genericMatrix< T >::rows(), lti::drawBase< T >::setGray(), lti::SOFM2DVisualizer::parameters::symbolSize, lti::SOFM2D::xSize(), and lti::SOFM2D::ySize().
const parameters& lti::SOFM2DVisualizer::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
Referenced by componentPlane(), drawClasses(), drawHits(), sammonsMapper(), and uMatrix().
virtual const char* lti::SOFM2DVisualizer::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("SOFM2DVisualizer")
Reimplemented from lti::functor.
SOFM2DVisualizer& lti::SOFM2DVisualizer::operator= | ( | const SOFM2DVisualizer & | other | ) |
bool lti::SOFM2DVisualizer::sammonsMapper | ( | drawBase< T > & | drawer, | |
const SOFM2D & | som | |||
) | const [inline] |
Applies a sammons mapping to the given som and draws the resulting grid.
Please not that the sammonsMapping does not respect the orientation in the image plane. Thus, the result might be rotated by an arbitrary angle.
References lti::sammonsMapping::apply(), lti::genericMatrix< T >::at(), lti::boundsFunctor< T >::boundsOfRows(), lti::drawBase< T >::getCanvasSize(), getParameters(), lti::SOFM::getPrototypes(), lti::drawBase< T >::lineTo(), lti::drawBase< T >::marker(), lti::min(), lti::genericMatrix< T >::rows(), lti::drawBase< T >::set(), lti::functor::setParameters(), lti::drawBase< T >::setStyle(), lti::tpoint< T >::x, lti::SOFM2D::xSize(), lti::tpoint< T >::y, and lti::SOFM2D::ySize().
bool lti::SOFM2DVisualizer::uMatrix | ( | drawBase< T > & | drawer, | |
const SOFM2D & | som | |||
) | const [inline] |
Draws the unified distane matrix of the given som.
References lti::l2Distance< T >::apply(), lti::matrix< T >::copy(), getParameters(), lti::SOFM::getPrototypes(), lti::matrix< T >::getRow(), lti::drawBase< T >::rectangle(), lti::drawBase< T >::setGray(), lti::vector< T >::sumOfElements(), lti::SOFM2DVisualizer::parameters::symbolSize, lti::SOFM2D::xSize(), and lti::SOFM2D::ySize().