1 #ifndef QXRDCENTERFINDER_H
2 #define QXRDCENTERFINDER_H
15 #include <QScriptValue>
28 Q_PROPERTY(
double centerX READ get_CenterX WRITE set_CenterX)
31 Q_PROPERTY(
double centerY READ get_CenterY WRITE set_CenterY)
34 Q_PROPERTY(
double centerStep READ get_CenterStep WRITE set_CenterStep)
43 Q_PROPERTY(
double detectorDistance READ get_DetectorDistance WRITE set_DetectorDistance)
49 Q_PROPERTY(
double energy READ get_Energy WRITE set_Energy)
52 Q_PROPERTY(
bool implementTilt READ get_ImplementTilt WRITE set_ImplementTilt)
55 Q_PROPERTY(
double detectorTilt READ get_DetectorTilt WRITE set_DetectorTilt)
58 Q_PROPERTY(
double detectorTiltStep READ get_DetectorTiltStep WRITE set_DetectorTiltStep)
73 Q_PROPERTY(
double ringRadius READ get_RingRadius WRITE set_RingRadius)
76 Q_PROPERTY(
double ringRadiusA READ get_RingRadiusA WRITE set_RingRadiusA)
79 Q_PROPERTY(
double ringRadiusB READ get_RingRadiusB WRITE set_RingRadiusB)
82 Q_PROPERTY(
double ringRotation READ get_RingRotation WRITE set_RingRotation)
85 Q_PROPERTY(
double peakFitRadius READ get_PeakFitRadius WRITE set_PeakFitRadius)
88 Q_PROPERTY(
double peakHeight READ get_PeakHeight WRITE set_PeakHeight)
91 Q_PROPERTY(
double peakCenterX READ get_PeakCenterX WRITE set_PeakCenterX)
94 Q_PROPERTY(
double peakCenterY READ get_PeakCenterY WRITE set_PeakCenterY)
97 Q_PROPERTY(
double peakWidth READ get_PeakWidth WRITE set_PeakWidth)
100 Q_PROPERTY(
double peakBackground READ get_PeakBackground WRITE set_PeakBackground)
109 Q_PROPERTY(
bool peakFitDebug READ get_PeakFitDebug WRITE set_PeakFitDebug)
124 Q_PROPERTY(
int ringIndex READ get_RingIndex WRITE set_RingIndex)
133 Q_PROPERTY(
double fittedWidthMin READ get_FittedWidthMin WRITE set_FittedWidthMin)
136 Q_PROPERTY(
double fittedWidthMax READ get_FittedWidthMax WRITE set_FittedWidthMax)
168 void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
const;
169 void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())
const;
174 double getTTH(
double x,
double y)
const;
175 double getTTH(QPointF pt)
const;
177 double getQ(
double x,
double y)
const;
178 double getQ(QPointF pt)
const;
180 double getR(
double x,
double y)
const;
181 double getR(QPointF pt)
const;
183 double getChi(
double x,
double y)
const;
184 double getChi(QPointF pt)
const;
186 double getDist(
double x,
double y)
const;
187 double getDist(QPointF pt)
const;
189 QPointF
getXY(
double tth,
double chi);
204 void appendPowderPoint(
int n1,
int n2,
int n3,
double x,
double y,
double r1=0,
double r2=0,
double az=0);
221 void setPowderPoint(
int i,
int n1,
int n2,
int n3,
double x,
double y,
double r1,
double r2,
double az);
244 void readSettings(QSettings *settings, QString section);
267 #endif // QXRDCENTERFINDER_H
double getChi(double x, double y) const
virtual ~QxrdCenterFinder()
int getPowderPointN2(int i)
QSharedPointer< QxrdCenterFinder > QxrdCenterFinderPtr
double getTTH(double x, double y) const
double ringAverageDisplacement
void disablePowderRing(int n)
bool subtractRingAverages
QcepDoubleImageDataPtr data() const
int countPowderRingPoints() const
void fitPowderCircle(int n=0)
double getQ(double x, double y) const
void adjustDistance(int n)
#define QCEP_DOUBLE_PROPERTY(propname)
void deletePowderPoints()
double fittedHeightMinRatio
double getR(double x, double y) const
void calculateCalibration()
int countPowderRings() const
#define QCEP_DOUBLE_VECTOR_PROPERTY(propname)
void setData(QcepDoubleImageDataPtr data)
double calibrantDSpacing(int n)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QWeakPointer< QxrdExperiment > QxrdExperimentWPtr
double detectorYPixelSize
static QString levmarFailureReason(int n)
bool traceRingNear(double x0, double y0, double step=25.0)
bool fitPowderPointPosition
void onPointSelected(QPointF pt)
void writeSettings(QSettings *settings, QString section)
QScriptValue getPowderPoint(int i)
static void fromScriptValue(const QScriptValue &obj, QxrdCenterFinderPtr &proc)
QVector< double > QcepDoubleVector
QScriptValue getPowderPoints()
double powderRingAverageQ(int r) const
#define QCEP_INTEGER_PROPERTY(propname)
bool missingRingNear(double x, double y)
QxrdPowderPointVector markedPoints
double getPowderPointY(int i)
static QScriptValue toScriptValue(QScriptEngine *engine, const QxrdCenterFinderPtr &proc)
QPointF getXY(double tth, double chi)
double powderRingAverageTTH(int r) const
bool fitPeakNear(double x, double y)
double tiltPlaneRotationStep
QxrdCenterFinder(QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt)
void setPowderPoint(int i, int n1, int n2, int n3, double x, double y, double r1, double r2, double az)
QcepDoubleImageDataPtr m_Data
double calibrantTTH(int n)
QxrdPowderPoint nearestPowderPoint(double x, double y)
void readSettings(QSettings *settings, QString section)
void onCenterChanged(QPointF pt)
QcepDoubleVector ringAngles
QxrdPowderPoint powderRingPoint(int i) const
QxrdExperimentWPtr m_Experiment
double fittedPositionMaxDistance
bool fitRingNear(double x0, double y0)
#define QCEP_BOOLEAN_PROPERTY(propname)
double ringAngleTolerance
QxrdExperimentWPtr experiment() const
void normalizePowderRings()
void deletePowderRing(int n)
double powderRingAverageR(int r) const
double getDist(double x, double y) const
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdPowderPoint powderPoint(int i)
int getPowderPointN1(int i)
int nearestPowderPointIndex(double x, double y)
void enablePowderRing(int n)
#define QXRD_POWDERPOINTVECTOR_PROPERTY(propname)
QxrdPowderPointVector fittedRings
double detectorDistanceStep
int m_CenterFitRingNumber
void appendPowderPoint(double x, double y)
double detectorXPixelSize
void deletePowderPointNear(double x, double y)
double imageValue(double x, double y)
double getPowderPointX(int i)
void fitPowderEllipse(int n=0)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
QcepDoubleImageDataPtr newData()
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr
enum QxrdCenterFinder::@5 UserAbsorptionKinds