1 #ifndef QCEPIMAGEDATA_H
2 #define QCEPIMAGEDATA_H
8 #include <QSharedPointer>
31 Q_PROPERTY(
int width READ get_Width WRITE set_Width)
34 Q_PROPERTY(
int height READ get_Height WRITE set_Height)
37 Q_PROPERTY(
double hStart READ get_HStart WRITE set_HStart)
40 Q_PROPERTY(
double hStep READ get_HStep WRITE set_HStep)
43 Q_PROPERTY(
double vStart READ get_VStart WRITE set_VStart)
46 Q_PROPERTY(
double vStep READ get_VStep WRITE set_VStep)
49 Q_PROPERTY(QString
hLabel READ get_HLabel WRITE set_HLabel)
52 Q_PROPERTY(QString
hUnits READ get_HUnits WRITE set_HUnits)
55 Q_PROPERTY(QString
vLabel READ get_VLabel WRITE set_VLabel)
58 Q_PROPERTY(QString
vUnits READ get_VUnits WRITE set_VUnits)
61 Q_PROPERTY(
int dataType READ get_DataType WRITE set_DataType)
66 Q_PROPERTY(QString
fileBase READ get_FileBase WRITE set_FileBase)
69 Q_PROPERTY(QString
title READ get_Title WRITE set_Title)
72 Q_PROPERTY(
int readoutMode READ get_ReadoutMode WRITE set_ReadoutMode)
75 Q_PROPERTY(
double exposureTime READ get_ExposureTime WRITE set_ExposureTime)
78 Q_PROPERTY(
int summedExposures READ get_SummedExposures WRITE set_SummedExposures)
84 Q_PROPERTY(
int imageNumber READ get_ImageNumber WRITE set_ImageNumber)
87 Q_PROPERTY(
int phaseNumber READ get_PhaseNumber WRITE set_PhaseNumber)
90 Q_PROPERTY(
int nPhases READ get_NPhases WRITE set_NPhases)
93 Q_PROPERTY(QDateTime
dateTime READ get_DateTime WRITE set_DateTime)
99 Q_PROPERTY(
double timeStamp READ get_TimeStamp WRITE set_TimeStamp)
102 Q_PROPERTY(
int hBinning READ get_HBinning WRITE set_HBinning)
105 Q_PROPERTY(
int vBinning READ get_VBinning WRITE set_VBinning)
108 Q_PROPERTY(
double cameraGain READ get_CameraGain WRITE set_CameraGain)
111 Q_PROPERTY(
int triggered READ get_Triggered WRITE set_Triggered)
114 Q_PROPERTY(QString
userComment1 READ get_UserComment1 WRITE set_UserComment1)
117 Q_PROPERTY(QString
userComment2 READ get_UserComment2 WRITE set_UserComment2)
120 Q_PROPERTY(QString
userComment3 READ get_UserComment3 WRITE set_UserComment3)
123 Q_PROPERTY(QString
userComment4 READ get_UserComment4 WRITE set_UserComment4)
132 Q_PROPERTY(
bool used READ get_Used WRITE set_Used)
137 void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const;
140 virtual QVector<
double>
getImageData(
int x0,
int y0,
int x1,
int y1) const = 0;
143 virtual
void clear() = 0;
144 virtual
void resize(
int width,
int height) = 0;
145 virtual
void fill(
double val) = 0;
147 virtual
double minValue() const = 0;
148 virtual
double maxValue() const = 0;
160 virtual
double sumInPeak(QRectF rect) = 0;
162 double hValue(
int n) const;
163 double vValue(
int n) const;
188 return get_DateTime().toString(tr(
"yyyy.MM.dd : hh:mm:ss.zzz"));
240 template <
typename T>
255 void resize(
int width,
int height);
257 void fill(
double val);
260 QVector<double>
getImageData(
int x0,
int y0,
int x1,
int y1)
const;
281 template <
typename T2>
287 void dumpPixels(
int x0,
int y0,
int x1,
int y1);
292 T
value(
int x,
int y)
const;
293 T
value(
double x,
double y)
const;
307 template <
typename T2>
310 template <
typename T2>
313 template <
typename T2>
316 template <
typename T2>
319 template <
typename T2>
322 template <
typename T2>
325 template <
typename T2>
void saveTextData(QString name, QString sep, bool transp=false)
double correlate(QSharedPointer< QcepImageData< T > > image, int dx, int dy, int mx, int my)
void shiftImage(QSharedPointer< QcepImageData< T > > image, double dx, double dy)
double sumInPeak(QRectF rect)
QcepMaskDataPtr overflow() const
QcepMaskDataPtr m_Overflow
void subtractValue(int x, int y, T val)
QcepSettingsSaverWPtr m_Saver
void setMask(QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
double maxInRectangle(QRectF rect)
void multiplyValue(int x, int y, T val)
virtual void resize(int width, int height)=0
virtual double maxInRectangle(QRectF rect)=0
virtual void fill(double val)=0
#define QCEP_DOUBLE_PROPERTY(propname)
void addValue(int x, int y, T val)
double maxInEllipse(QRectF rect)
double minInRectangle(QRectF rect)
static QSharedPointer< QcepImageData< T > > newImage(QcepSettingsSaverWPtr saver, QString name, int width, int height, QcepObject *parent)
QcepDoubleList normalization
virtual double averageInEllipse(QRectF rect)=0
virtual double sumInEllipse(QRectF rect)=0
void resize(int width, int height)
QcepImageData(QcepSettingsSaverWPtr saver, int width, int height, T def, QcepObject *parent)
QString fileFormatTransposedCSV()
void copyImage(QSharedPointer< QcepImageData< T2 > > dest)
double findAverage() const
double vValue(int n) const
T value(int x, int y) const
QcepImageDataBase(QcepSettingsSaverWPtr saver, int width, int height, int size, QcepObject *parent)
static void fromScriptValue(const QScriptValue &obj, QSharedPointer< QcepImageData< T > > &data)
void subtractDark(const QSharedPointer< QcepImageData< T2 > > dark)
void copyProperties(QcepImageDataBase *dest)
void copyPropertiesFrom(QSharedPointer< QcepImageDataBase > src)
void divideValue(int x, int y, T val)
double minInEllipse(QRectF rect)
void calculateRangeInCircle()
static QScriptValue toScriptValue(QScriptEngine *engine, const QSharedPointer< QcepImageData< T > > &data)
void accumulateImage(QSharedPointer< QcepImageData< T2 > > image)
double sumInRectangle(QRectF rect)
QcepDoubleList extraInputs
virtual double maxInEllipse(QRectF rect)=0
#define QCEP_INTEGER_PROPERTY(propname)
void setImageData(int x, int y, double v)
virtual double sumInRectangle(QRectF rect)=0
virtual double getImageData(int x, int y) const =0
QPointF percentileRange(double lowpct, double highpct)
virtual double minValue() const =0
void add(QSharedPointer< QcepImageData< T2 > > image)
double sumInEllipse(QRectF rect)
bool readImage(QString filename)
void divide(QSharedPointer< QcepImageData< T2 > > image)
QList< double > QcepDoubleList
virtual QString fileFormatFilterString()
#define QCEP_STRING_PROPERTY(propname)
double hValue(int n) const
void saveTIFFData(QString name)
virtual void setImageData(int x, int y, double v)=0
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void setValue(int x, int y, T val)
QString get_DateString() const
QString get_DataTypeName() const
void multiply(QSharedPointer< QcepImageData< T2 > > image)
virtual double minInRectangle(QRectF rect)=0
QString fileFormatTabDelimited()
#define QCEP_BOOLEAN_PROPERTY(propname)
void dumpPixels(int x0, int y0, int x1, int y1)
void set_DateString(QString)
void set_DataTypeName(QString)
virtual QString description() const
void subtract(QSharedPointer< QcepImageData< T2 > > image)
virtual void saveData(QString &name, QString filter, Overwrite canOverwrite=NoOverwrite)
double getImageData(int x, int y) const
virtual double sumInPeak(QRectF rect)=0
virtual double averageInRectangle(QRectF rect)=0
QString fileFormatTransposedTabDelimited()
virtual ~QcepImageDataBase()
virtual double maxValue() const =0
void setDefaultValue(T def)
virtual QPointF percentileRange(double lowpct, double highpct)=0
void correctBadBackgroundSubtraction(QcepDoubleImageDataPtr dark, int nImgExposures, int nDarkExposures)
void setDefaultFileName(QString path)
virtual double minInEllipse(QRectF rect)=0
QSharedPointer< QcepMaskData > QcepMaskDataPtr
double averageInRectangle(QRectF rect)
void copyFrom(const QSharedPointer< QcepImageData< T2 > > img)
static double secondsSinceEpoch()
#define QCEP_DOUBLE_LIST_PROPERTY(propname)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
#define QCEP_DATETIME_PROPERTY(propname)
double averageInEllipse(QRectF rect)
QcepSettingsSaverWPtr saver()
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr
QcepMaskDataPtr mask() const