#ifndef HISTOGRAM_H_
#define HISTOGRAM_H_
#include <casa/aipstype.h>
#include <casa/vector.h>
#include <QTextStream>
#include <casa/Utilities/CountedPtr.h>
#include <guitools/Histogram/FootPrintWidget.qo.h>
namespace casacore{
template <class T> class ImageInterface;
template <class T> class SubImage;
class ImageRegion;
}
namespace casa {
template <class T> class ImageHistograms;
class HeightSource;
class Histogram {
public:
Histogram( HeightSource* source );
int getDataCount() const;
bool compute();
bool reset(FootPrintWidget::PlotMode mode );
void setRegion(casacore::ImageRegion* region);
void defineLine( int index, QVector<double>& xVals, QVector<double>& yVals,
bool useLogY ) const;
void defineStepHorizontal( int index, QVector<double>& xVals, QVector<double>& yVals,
bool useLogY ) const;
void defineStepVertical( int index, QVector<double>& xVals, QVector<double>& yVals,
bool useLogY ) const;
std::pair<float,float> getMinMaxBinCount() const;
std::vector<float> getXValues() const;
std::vector<float> getYValues() const;
std::pair<float,float> getDataRange() const;
void toAscii( QTextStream& out ) const;
virtual ~Histogram();
void setBinCount( int count );
void setChannelRangeDefault();
void setIntensityRangeDefault();
void setChannelRange( int minChannel, int maxChannel, int spectralIndex=-1 );
void setIntensityRange( float minimumIntensity, float maximumIntensity );
void setImage( const std::shared_ptr<const casacore::ImageInterface<casacore::Float> > image );
static double computeYValue( double value, bool useLog );
signals:
void postStatus( const QString& msg );
private:
Histogram( const Histogram& other );
Histogram operator=( const Histogram& other );