00001
00002
00003
00004
00005
00006
00007 #ifndef GRID_CLASSIFIER_H
00008 #define GRID_CLASSIFIER_H
00009
00010 #include "ColorFilterHistogram.h"
00011
00012 class QPixmap;
00013 class Transformation;
00014
00026 class GridClassifier
00027 {
00028 public:
00030 GridClassifier();
00031
00033 void classify (bool isGnuplot,
00034 const QPixmap &originalPixmap,
00035 const Transformation &transformation,
00036 int &countX,
00037 double &startX,
00038 double &stepX,
00039 int &countY,
00040 double &startY,
00041 double &stepY);
00042
00043 private:
00044
00045
00046
00047 static int NUM_PIXELS_PER_HISTOGRAM_BINS;
00048
00049 static int MIN_STEP_PIXELS;
00050 static double PEAK_HALF_WIDTH;
00051 static int BIN_START_UNSHIFTED;
00052
00053 int binFromCoordinate (double coord,
00054 double coordMin,
00055 double coordMax) const;
00056 void classify();
00057 void computeGraphCoordinateLimits (const QImage &image,
00058 const Transformation &transformation,
00059 double &xMin,
00060 double &xMax,
00061 double &yMin,
00062 double &yMax);
00063 double coordinateFromBin (int bin,
00064 double coordMin,
00065 double coordMax) const;
00066 void copyVectorToVector (const double from [],
00067 double to []) const;
00068 void dumpGnuplotCoordinate (const QString &coordinateLabel,
00069 double corr,
00070 const double *bins,
00071 double coordinateMin,
00072 double coordinateMax,
00073 int binStart,
00074 int binStep) const;
00075 void dumpGnuplotCorrelations (const QString &coordinateLabel,
00076 double valueMin,
00077 double valueMax,
00078 const double signalA [],
00079 const double signalB [],
00080 const double correlationsMax []);
00081 void initializeHistogramBins ();
00082 void loadPicketFence (double picketFence [],
00083 int binStart,
00084 int binStep,
00085 int count,
00086 bool isCount) const;
00087 void populateHistogramBins (const QImage &image,
00088 const Transformation &transformation,
00089 double xMin,
00090 double xMax,
00091 double yMin,
00092 double yMax);
00093 void searchCountSpace (double bins [],
00094 double binStart,
00095 double binStep,
00096 int &countMax);
00097 void searchStartStepSpace (bool isGnuplot,
00098 double bins [],
00099 const QString &coordinateLabel,
00100 double valueMin,
00101 double valueMax,
00102 double &start,
00103 double &step,
00104 double &binStart,
00105 double &binStep);
00106
00107 double *m_binsX;
00108 double *m_binsY;
00109
00110 int m_numHistogramBins;
00111 };
00112
00113 #endif // GRID_CLASSIFIER_H