/** 
* @file TextonFeature.h
* @brief texton feature similar to jamie shottons idea
* @author Erik Rodner
* @date 05/07/2008

*/
#ifndef TEXTONFEATUREINCLUDE
#define TEXTONFEATUREINCLUDE

#include "core/vector/VectorT.h"
#include "core/vector/MatrixT.h"
 
#include "core/basics/Config.h"
#include "vislearning/cbaselib/Feature.h"
#include "vislearning/classifier/fpclassifier/randomforest/DecisionNode.h"


namespace OBJREC {

/** texton feature similar to jamie shottons idea */
class TextonFeature : public Feature
{

    protected:
	int window_size_x;
	int window_size_y;

	int node_index;

 std::map<DecisionNode *, std::pair<long, int> > *nodeList;

	int numScales;
	double scaleStep;
	int maxdepth;

    public:
  
	/** simple constructor */
	TextonFeature( const NICE::Config *conf,
		       std::map<DecisionNode *, std::pair<long, int> > *_nodeList,
		       int maxdepth );

	/** internally used by TextonFeature::explode */
	TextonFeature () {};
      
	/** simple destructor */
	virtual ~TextonFeature();
     
	double val( const Example *example ) const;
	void explode ( std::vector<Feature *> & featurePool, bool variableWindow = true ) const;
	Feature *clone() const;
	Feature *generateFirstParameter () const;

	void restore (std::istream & is, int format = 0);
	void store (std::ostream & os, int format = 0) const;
	void clear ();

};


} // namespace

#endif