view annotationCalculatorSrc/Histogram.h @ 48:5359e2c0b0fb

Added data from six tracks. Absolute histogram
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Wed, 09 May 2012 21:55:16 +0100
parents 689704aa55d5
children 8df911733fdc
line wrap: on
line source
/*
 *  Histogram.h
 *  annotationResultCalculator
 *
 *  Created by Andrew on 08/05/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */



#ifndef HISTOGRAM
#define HISTOGRAM

#include "ofMain.h"

class Histogram{
public:	
	Histogram();
	typedef std::vector<double> DoubleVector;
	typedef std::vector<int> IntVector;
	IntVector histogram;
	
	void createHistogram(const int& binWidthIn, const int& numberofBinsIn);
	void createAbsoluteHistogram(const int& binWidthIn, const int& numberofBinsIn);
	
	
	void processDataIntoHistogram(const DoubleVector& data);
	void plotHistogram();
	void plotHistogram(const double& maxHeight);
	
	void setBinPoints();
	int numberofBins;
	int binWidth;
	double minimumBinValue, maximumBinValue;
	
	DoubleVector binPoints;

	double maximum;
	int numberOutsideRange;
	
	int getY(const int& y);
	int screenHeight;
};
#endif