2 #include "ui_qxrdhistogramdialog.h"
15 m_HistogramDialogSettings(settings)
18 printf(
"QxrdHistogramDialog::QxrdHistogramDialog(%p)\n",
this);
26 m_HistogramPlot->init(set->histogramPlotSettings());
33 printf(
"QxrdHistogramDialog::~QxrdHistogramDialog(%p)\n",
this);
49 set->set_HistogramRect(rect);
71 QRectF rect = set->get_HistogramRect();
73 int nsum =
m_Image->get_SummedExposures();
81 double satlev = 60000;
84 satlev = acq->get_OverflowLevel();
87 double min = 0, max = satlev*nsum;
93 for (
int i=0; i<nbins; i++) {
95 x0[i] = i*100.0/(double)nbins;
100 int width =
m_Image->get_Width();
101 int height=
m_Image->get_Height();
103 double *data =
m_Image->data();
105 for (
int i=0; i<width; i++) {
106 for (
int j=0; j<height; j++) {
116 n=(nbins-1)*(v-min)/(max-min);
129 if (rect.contains(i,j)) {
135 m_HistogramPlot->detachItems();
139 pc0->setSamples(x0, h0);
140 pc0->setPen(QPen(Qt::red));
142 pc0->attach(m_HistogramPlot);
145 tr(
"[%1,%2]-[%3,%4]")
146 .arg(rect.left()).arg(rect.bottom())
147 .arg(rect.right()).arg(rect.top()));
149 pc1->setSamples(x0, h1);
150 pc1->setPen(QPen(Qt::darkRed));
152 pc1->attach(m_HistogramPlot);
154 m_HistogramPlot->replot();
157 expt -> printMessage(tr(
"Histogram of data took %1 msec").arg(tic.elapsed()));
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
qint64 qcepDebug(int cond)
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
QSharedPointer< QxrdHistogramDialogSettings > QxrdHistogramDialogSettingsPtr
QWeakPointer< QxrdExperiment > QxrdExperimentWPtr
QVector< double > QcepDoubleVector
void updateHistogramNeeded()
QcepDoubleImageDataPtr m_Image
QxrdExperimentWPtr m_Experiment
A class which draws piecewise curves.
QWeakPointer< QxrdHistogramDialogSettings > QxrdHistogramDialogSettingsWPtr
void onProcessedImageAvailable(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
void histogramSelectionChanged(QRectF rect)
virtual ~QxrdHistogramDialog()
QSharedPointer< QcepMaskData > QcepMaskDataPtr
void recalculateHistogram()
QxrdHistogramDialog(QxrdHistogramDialogSettingsWPtr settings, QxrdExperimentWPtr expt, QWidget *parent)
QxrdHistogramDialogSettingsWPtr m_HistogramDialogSettings
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr