Histogram.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef HISTOGRAM_H_
00027 #define HISTOGRAM_H_
00028
00029 #include <casa/aipstype.h>
00030 #include <casa/vector.h>
00031 #include <QTextStream>
00032 #include <casa/Utilities/CountedPtr.h>
00033 #include <guitools/Histogram/FootPrintWidget.qo.h>
00034
00035 namespace casa {
00036
00037 template <class T> class ImageInterface;
00038 template <class T> class ImageHistograms;
00039 template <class T> class SubImage;
00040 class ImageRegion;
00041 class HeightSource;
00042
00047 class Histogram {
00048 public:
00049 Histogram( HeightSource* source );
00050 int getDataCount() const;
00051
00052
00053
00054 bool compute();
00055
00056
00057 bool reset(FootPrintWidget::PlotMode mode );
00058
00059 void setRegion(ImageRegion* region);
00060 void defineLine( int index, QVector<double>& xVals, QVector<double>& yVals,
00061 bool useLogY ) const;
00062 void defineStepHorizontal( int index, QVector<double>& xVals, QVector<double>& yVals,
00063 bool useLogY ) const;
00064 void defineStepVertical( int index, QVector<double>& xVals, QVector<double>& yVals,
00065 bool useLogY ) const;
00066 std::pair<float,float> getMinMaxBinCount() const;
00067 vector<float> getXValues() const;
00068 vector<float> getYValues() const;
00069 std::pair<float,float> getDataRange() const;
00070 void toAscii( QTextStream& out ) const;
00071 virtual ~Histogram();
00072
00073
00074 void setBinCount( int count );
00075 void setChannelRangeDefault();
00076 void setIntensityRangeDefault();
00077 void setChannelRange( int minChannel, int maxChannel, int spectralIndex=-1 );
00078 void setIntensityRange( float minimumIntensity, float maximumIntensity );
00079 void setImage( const SHARED_PTR<const ImageInterface<Float> > image );
00080 static double computeYValue( double value, bool useLog );
00081
00082 signals:
00083 void postStatus( const QString& msg );
00084
00085 private:
00086 Histogram( const Histogram& other );
00087 Histogram operator=( const Histogram& other );
00088 ImageHistograms<Float>* filterByChannels( const SHARED_PTR<const ImageInterface<Float> > image );
00089 HeightSource* heightSource;
00090 vector<Float> xValues;
00091 vector<Float> yValues;
00092 ImageHistograms<Float>* histogramMaker;
00093 ImageRegion* region;
00094
00095 const int ALL_CHANNELS;
00096 const int ALL_INTENSITIES;
00097 SHARED_PTR<const ImageInterface<Float> > image;
00098 int channelMin;
00099 int channelMax;
00100 int specIndex;
00101 float intensityMin;
00102 float intensityMax;
00103 int binCount;
00104
00105 };
00106
00107 }
00108 #endif