QXRD  0.11.16
Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
QxrdDataProcessorThreaded Class Reference

#include <qxrddataprocessorthreaded.h>

Inheritance diagram for QxrdDataProcessorThreaded:
Inheritance graph
[legend]
Collaboration diagram for QxrdDataProcessorThreaded:
Collaboration graph
[legend]

Public Slots

void sumImages (QStringList names)
 
void addImages (QStringList names)
 
void subtractImages (QStringList names)
 
void projectImages (QStringList names, int px, int py, int pz)
 
void integrateData (QString name)
 
void correlateImages (QStringList names)
 
void clearAccumulator ()
 
void integrateAndAccumulate (QStringList names)
 
void saveAccumulator (QString &path, QString filter)
 
void shiftImage (int dx, int dy)
 
void reflectVertically ()
 
void reflectHorizontally ()
 
void fitPeakNear (double x, double y)
 
void processData (QString name)
 
void processDataSequence (QString path, QString filter="*.tif")
 
void processDataSequence (QStringList paths)
 
void processDataSequence (QString path, QStringList filter)
 
void processNormalizedFile (QString path, double v1)
 
void processNormalizedFile (QString path, double v1, double v2)
 
void processNormalizedFile (QString path, QcepDoubleList v)
 
void setFileNormalization (QString path, double v1)
 
void setFileNormalization (QString path, double v1, double v2)
 
void setFileNormalization (QString path, QcepDoubleList v)
 
void slicePolygon (QVector< QPointF > poly)
 
void integrateSaveAndDisplay ()
 
void fixupBadBackgroundSubtraction (QString imagePattern, int nImgExposures, QString darkPath, int nDarkExposures)
 
- Public Slots inherited from QxrdDataProcessorBase
void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void statusMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void shutdown ()
 
void showMaskRange ()
 
void hideMaskRange ()
 
void showMaskRange (double min, double max)
 
void hideMaskRange (double min, double max)
 
void showMaskAll ()
 
void hideMaskAll ()
 
void invertMask ()
 
void growMask ()
 
void shrinkMask ()
 
void maskCircle (QRectF pt)
 
void maskPolygon (QVector< QPointF > poly)
 
void measurePolygon (QVector< QPointF > poly)
 
virtual void slicePolygon (QVector< QPointF > poly)=0
 
void printMeasuredPolygon (QVector< QPointF > poly)
 
void summarizeMeasuredPolygon (QVector< QPointF > poly)
 
virtual void integrateSaveAndDisplay ()=0
 
QString pwd () const
 
QStringList ls () const
 
QStringList ls (QString pattern) const
 
void loadData (QString name)
 
void saveData (QString name, int canOverwrite=NoOverwrite)
 
void saveData (QcepDataObjectPtr object, QString name, int canOverwrite=NoOverwrite)
 
void loadDark (QString name)
 
void saveDark (QString name, int canOverwrite=NoOverwrite)
 
void loadMask (QString name)
 
void saveMask (QString name, int canOverwrite=NoOverwrite)
 
void loadBadPixels (QString name)
 
void saveBadPixels (QString name, int canOverwrite=NoOverwrite)
 
void loadGainMap (QString name)
 
void saveGainMap (QString name, int canOverwrite=NoOverwrite)
 
void saveCachedGeometry (QString name)
 
void saveCachedIntensity (QString name)
 
void clearDark ()
 
void clearMask ()
 
void clearBadPixels ()
 
void clearGainMap ()
 
void subtractDark ()
 
void unsubtractDark ()
 
void multiplyData (double scalar)
 
void offsetData (double offset)
 
int maskStackSize ()
 
int maskStackPosition (int pos)
 
void newMaskStack ()
 
void pushMaskStack (QcepMaskDataPtr mask=QcepMaskDataPtr())
 
void popMaskStack (int amount=1)
 
void clearMaskStack ()
 
void clearMaskStackTop ()
 
void rollMaskStack (int amount)
 
void exchangeMaskStack (int pos)
 
void andMaskStack (int pos)
 
void orMaskStack (int pos)
 
void xorMaskStack (int pos)
 
void andNotMaskStack (int pos)
 
void orNotMaskStack (int pos)
 
void xorNotMaskStack (int pos)
 
void invertMaskStack (int pos)
 
void growMaskStack (int pos)
 
void shrinkMaskStack (int pos)
 
void hideMaskAllStack (int pos)
 
void showMaskAllStack (int pos)
 
void hideMaskRangeStack (int pos)
 
void showMaskRangeStack (int pos)
 
void findZingers ()
 
void newImage (int ncols, int nrows)
 
void exponentialTail (double cx, double cy, double width, int oversample)
 
void reciprocalTail (double cx, double cy, double strength, int oversample)
 
void powderRing (double cx, double cy, double radius, double width, double strength, int oversample)
 
void ellipse (double cx, double cy, double a, double e, double ang, double width, double strength, int oversample)
 
void updateEstimatedProcessingTime ()
 
void fileWriteTest (int dim, QString path)
 
int status (double delay)
 
void calculateROI ()
 
void calculateHistogram ()
 
void displayIntegratedData (QcepIntegratedDataPtr d)
 
void writeOutputScan (QcepIntegratedDataPtr d)
 
void newOutputScan (QString title)
 
void appendToOutputScan (double x, double y)
 
void plotOutputScan ()
 
void saveOutputScan (QString fileName)
 
QStringList integrateRectangle (int x0, int y0, int x1, int y1)
 
QString existingOutputDirectory (QString dir, QString subdir) const
 
QString filePathInExperimentDirectory (QString name) const
 
QString filePathInDataDirectory (QString name) const
 
QString filePathInDarkOutputDirectory (QString name) const
 
QString filePathInRawOutputDirectory (QString name) const
 
QString filePathInSubtractedOutputDirectory (QString name) const
 
QString filePathInIntegratedOutputDirectory (QString name) const
 
QString experimentDirectory () const
 
QString dataDirectory () const
 
QString darkOutputDirectory () const
 
QString rawOutputDirectory () const
 
QString subtractedOutputDirectory () const
 
QString integratedOutputDirectory () const
 
QcepDoubleImageDataPtr data () const
 
QcepDoubleImageDataPtr darkImage () const
 
QcepDoubleImageDataPtr gainMap () const
 
QcepDoubleImageDataPtr badPixels () const
 
QcepDoubleImageDataPtr liveData () const
 
QcepMaskDataPtr mask () const
 
QcepMaskDataPtr overflow () const
 
void newData (QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
 
- Public Slots inherited from QcepObject
virtual void printLine (QString line)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime()) const
 
virtual void criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
virtual void statusMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
virtual QString settingsScript ()
 
QString scriptValueLiteral (QVariant v)
 

Public Member Functions

 QxrdDataProcessorThreaded (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr doc, QxrdAcquisitionWPtr acq, QxrdFileSaverWPtr filesaver)
 
virtual ~QxrdDataProcessorThreaded ()
 
void beginAcquisition (int isDark)
 
void idleInt16Image (QcepInt16ImageDataPtr image, bool liveView)
 
void acquiredInt16Image (QcepInt16ImageDataPtr image, QcepMaskDataPtr overflow)
 
void acquiredInt32Image (QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow)
 
void acquiredDoubleImage (QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
 
void acquiredDoubleImage (QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, QcepDoubleList v)
 
- Public Member Functions inherited from QxrdDataProcessorBase
 QxrdDataProcessorBase (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr doc, QxrdAcquisitionWPtr acq, QxrdFileSaverWPtr filesaver)
 
virtual ~QxrdDataProcessorBase ()
 
void loadDefaultImages ()
 
QcepDoubleImageDataPtr takeNextFreeImage (int width, int height)
 
void readSettings (QSettings *settings, QString section)
 
void writeSettings (QSettings *settings, QString section)
 
void setAcquisition (QxrdAcquisitionWPtr acq)
 
void setWindow (QxrdWindowWPtr win)
 
void createMaskIfNeeded ()
 
QxrdMaskStackPtr maskStack ()
 
QxrdExperimentPtr experiment () const
 
QxrdCenterFinderPtr centerFinder () const
 
QxrdIntegratorPtr integrator () const
 
QxrdPolarTransformPtr polarTransform () const
 
QxrdPolarNormalizationPtr polarNormalization () const
 
QxrdGenerateTestImageWPtr generateTestImage () const
 
QxrdDistortionCorrectionPtr distortionCorrection () const
 
void newMask ()
 
void updateEstimatedTime (QcepDoubleProperty *prop, int msec)
 
- Public Member Functions inherited from QcepObject
 QcepObject (QString name, QcepObject *parent)
 
virtual ~QcepObject ()
 
QString get_Name () const
 
void set_Name (QString name)
 

Protected Member Functions

double estimatedProcessingTime (double estSerTime, double estParallelTime)
 
- Protected Member Functions inherited from QxrdDataProcessorBase
void saveNamedImageData (QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void saveNamedImageData (QString name, QcepInt16ImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void saveNamedImageData (QString name, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void saveNamedRawImageData (QString name, QcepInt16ImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void saveNamedRawImageData (QString name, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void saveNamedMaskData (QString name, QcepMaskDataPtr mask, int canOverwrite=NoOverwrite)
 
void saveNamedImageDataAsText (QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
 
void writeOutputScan (QVector< double > x, QVector< double > y)
 
QcepDoubleImageDataPtr processAcquiredInt16Image (QcepDoubleImageDataPtr processed, QcepInt16ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr processAcquiredInt32Image (QcepDoubleImageDataPtr processed, QcepInt32ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr processAcquiredDoubleImage (QcepDoubleImageDataPtr processed, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr processAcquiredDoubleImage (QcepDoubleImageDataPtr processed, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow, QcepDoubleList v)
 
QcepDoubleImageDataPtr processAcquiredImage (QcepDoubleImageDataPtr processed, QcepDoubleImageDataPtr dimg, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow, QcepDoubleList v=QcepDoubleList())
 
void newDarkImage (QcepInt16ImageDataPtr image)
 
void newDarkImage (QcepInt32ImageDataPtr image)
 
double estimatedProcessingTime (double estSerTime, double estParallelTime)
 
void newDarkImage (QcepDoubleImageDataPtr image)
 
void newBadPixelsImage (QcepDoubleImageDataPtr image)
 
void newGainMapImage (QcepDoubleImageDataPtr image)
 
int newMaskWidth () const
 
int newMaskHeight () const
 
int incrementAcquiredCount ()
 
int decrementAcquiredCount ()
 
int getAcquiredCount ()
 
void subtractDarkImage (QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
 
void unsubtractDarkImage (QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
 
void correctBadPixels (QcepDoubleImageDataPtr image)
 
void correctImageGains (QcepDoubleImageDataPtr image)
 
void performImageCorrections (QcepDoubleImageDataPtr image)
 

Private Slots

void onCorrectedImageAvailable ()
 
void onIntegratedDataAvailable ()
 
void onROIDataAvailable ()
 
void onHistogramDataAvailable ()
 

Private Member Functions

QcepDoubleImageDataPtr correctInt16Image (QcepDoubleImageDataPtr corrected, QcepInt16ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr correctInt32Image (QcepDoubleImageDataPtr corrected, QcepInt32ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr correctDoubleImage (QcepDoubleImageDataPtr corrected, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
 
QcepDoubleImageDataPtr correctDoubleImage (QcepDoubleImageDataPtr corrected, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr overflow, QcepDoubleList v)
 
QcepIntegratedDataPtr integrateImage (QcepIntegratedDataPtr integ, QcepDoubleImageDataPtr image, QcepMaskDataPtr mask, double cx, double cy)
 
QxrdROIDataPtr calculateROI (QcepDoubleImageDataPtr image, QcepMaskDataPtr mask)
 
QxrdHistogramDataPtr calculateHistogram (QcepDoubleImageDataPtr image, QcepMaskDataPtr mask)
 

Private Attributes

QxrdResultSerializer< QcepDoubleImageDataPtrm_CorrectedImages
 
QxrdResultSerializer< QcepIntegratedDataPtrm_IntegratedData
 
QxrdResultSerializer< QxrdROIDataPtrm_ROIData
 
QxrdResultSerializer< QxrdHistogramDataPtrm_HistogramData
 

Additional Inherited Members

- Public Types inherited from QxrdDataProcessorBase
enum  { NoOverwrite, CanOverwrite }
 
enum  { ZingerNoMask = -2, ZingerDataMask = -1, ZingerTopStack = -1 }
 
- Signals inherited from QxrdDataProcessorBase
void newIntegrationAvailable (QcepIntegratedDataPtr data)
 
- Static Public Member Functions inherited from QcepObject
static int allocatedObjects ()
 
static int deletedObjects ()
 
static QSet< QcepObject * > allocatedObjectsSet ()
 
static QString addSlashes (QString str)
 
- Public Attributes inherited from QxrdDataProcessorBase
enum QxrdDataProcessorBase:: { ... }  ZingerConstants
 
- Protected Attributes inherited from QxrdDataProcessorBase
QxrdExperimentWPtr m_Experiment
 
QcepSettingsSaverWPtr m_Saver
 
QxrdWindowWPtr m_Window
 
QxrdFileSaverWPtr m_FileSaver
 
QxrdAcquisitionWPtr m_Acquisition
 
QWaitCondition m_ProcessWaiting
 
QcepInt16ImageQueue m_AcquiredInt16Images
 
QcepInt32ImageQueue m_AcquiredInt32Images
 
QcepDoubleImageDataPtr m_Data
 
QcepDoubleImageDataPtr m_DarkFrame
 
QcepDoubleImageDataPtr m_BadPixels
 
QcepDoubleImageDataPtr m_GainMap
 
QcepDoubleImageDataPtr m_LiveData
 
QcepMaskDataPtr m_Overflow
 
QxrdMaskStack m_Masks
 
QAtomicInt m_AcquiredCount
 
QxrdCenterFinderPtr m_CenterFinder
 
QxrdIntegratorPtr m_Integrator
 
QxrdPolarTransformPtr m_PolarTransform
 
QxrdPolarNormalizationPtr m_PolarNormalization
 
QxrdGenerateTestImagePtr m_GenerateTestImage
 
QcepIntegratedDataPtr m_OutputScan
 
QxrdDistortionCorrectionPtr m_DistortionCorrection
 
- Properties inherited from QxrdDataProcessorBase
QString fileName
 
QString dataPath
 
QString darkImagePath
 
QString badPixelsPath
 
QString gainMapPath
 
QString maskPath
 
QString scriptPath
 
bool performDarkSubtraction
 
bool saveRawImages
 
bool saveDarkImages
 
bool performBadPixels
 
bool performGainCorrection
 
bool saveSubtracted
 
bool saveAsText
 
QString saveAsTextSeparator
 
int saveAsTextPerLine
 
bool saveOverflowFiles
 
bool performIntegration
 
bool displayIntegratedData
 
bool saveIntegratedData
 
QString saveIntegratedPath
 
bool saveDarkInSubdirectory
 
QString saveDarkSubdirectory
 
bool saveRawInSubdirectory
 
QString saveRawSubdirectory
 
bool saveSubtractedInSubdirectory
 
QString saveSubtractedSubdirectory
 
bool saveIntegratedInSeparateFiles
 
bool saveIntegratedInSubdirectory
 
QString saveIntegratedSubdirectory
 
bool accumulateIntegrated2D
 
QString accumulateIntegratedName
 
QString accumulateIntegratedDirectory
 
QString accumulateIntegratedFileName
 
QString accumulateIntegratedFormat
 
double performDarkSubtractionTime
 
double performBadPixelsTime
 
double performGainCorrectionTime
 
double saveSubtractedTime
 
double saveAsTextTime
 
double performIntegrationTime
 
double displayIntegratedDataTime
 
double saveIntegratedDataTime
 
double estimatedProcessingTime
 
double averagingRatio
 
double maskMinimumValue
 
double maskMaximumValue
 
double maskCircleRadius
 
bool maskSetPixels
 
double average
 
double averageDark
 
double averageRaw
 
int correctionQueueLength
 
int integrationQueueLength
 
int saverQueueLength
 
int zingerAlgorithm
 
int zingerMask
 
int zingerDestination
 
int zingerSize1
 
int zingerSize2
 
double zingerThreshold
 
- Properties inherited from QcepObject
QString name
 

Detailed Description

Definition at line 16 of file qxrddataprocessorthreaded.h.

Constructor & Destructor Documentation

QxrdDataProcessorThreaded::QxrdDataProcessorThreaded ( QcepSettingsSaverWPtr  saver,
QxrdExperimentWPtr  doc,
QxrdAcquisitionWPtr  acq,
QxrdFileSaverWPtr  filesaver 
)

Definition at line 18 of file qxrddataprocessorthreaded.cpp.

References m_CorrectedImages, m_HistogramData, m_IntegratedData, m_ROIData, onCorrectedImageAvailable(), onHistogramDataAvailable(), onIntegratedDataAvailable(), onROIDataAvailable(), and QxrdResultSerializerBase::resultAvailable().

22  : QxrdDataProcessorBase(saver, doc, acq, filesaver),
23  m_CorrectedImages(prop_CorrectionQueueLength(), this),
24  m_IntegratedData(prop_IntegrationQueueLength(), this),
25  m_ROIData(NULL, this),
26  m_HistogramData(NULL, this)
27 {
32 
33 // prop_CorrectionQueueLength()->setDebug(true);
34 // prop_IntegrationQueueLength()->setDebug(true);
35 }
QxrdResultSerializer< QxrdHistogramDataPtr > m_HistogramData
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QxrdDataProcessorBase(QcepSettingsSaverWPtr saver, QxrdExperimentWPtr doc, QxrdAcquisitionWPtr acq, QxrdFileSaverWPtr filesaver)
QxrdResultSerializer< QxrdROIDataPtr > m_ROIData

Here is the call graph for this function:

QxrdDataProcessorThreaded::~QxrdDataProcessorThreaded ( )
virtual

Definition at line 37 of file qxrddataprocessorthreaded.cpp.

38 {
39 }

Member Function Documentation

void QxrdDataProcessorThreaded::acquiredDoubleImage ( QcepDoubleImageDataPtr  image,
QcepMaskDataPtr  overflow 
)

Definition at line 98 of file qxrddataprocessorthreaded.cpp.

References correctDoubleImage(), QxrdDataProcessorBase::darkImage(), QxrdResultSerializer< T >::enqueue(), m_CorrectedImages, QxrdDataProcessorBase::mask(), and QxrdDataProcessorBase::takeNextFreeImage().

Referenced by processData(), and processNormalizedFile().

99 {
100  QcepDoubleImageDataPtr corrected = takeNextFreeImage(image->get_Width(), image->get_Height());
101 
104 
105  m_CorrectedImages.enqueue(QtConcurrent::run(this,
106  p,
107  corrected, image, darkImage(), mask(), overflow));
108 }
QcepMaskDataPtr mask() const
QcepDoubleImageDataPtr darkImage() const
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void enqueue(QFuture< T > future)
QcepDoubleImageDataPtr correctDoubleImage(QcepDoubleImageDataPtr corrected, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::acquiredDoubleImage ( QcepDoubleImageDataPtr  image,
QcepMaskDataPtr  overflow,
QcepDoubleList  v 
)

Definition at line 110 of file qxrddataprocessorthreaded.cpp.

References correctDoubleImage(), QxrdDataProcessorBase::darkImage(), QxrdResultSerializer< T >::enqueue(), m_CorrectedImages, and QxrdDataProcessorBase::takeNextFreeImage().

111 {
112  QcepDoubleImageDataPtr corrected = takeNextFreeImage(image->get_Width(), image->get_Height());
113 
116 
117  m_CorrectedImages.enqueue(QtConcurrent::run(this,
118  p,
119  corrected, image, darkImage(), overflow, v));
120 }
QcepDoubleImageDataPtr darkImage() const
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void enqueue(QFuture< T > future)
QcepDoubleImageDataPtr correctDoubleImage(QcepDoubleImageDataPtr corrected, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::acquiredInt16Image ( QcepInt16ImageDataPtr  image,
QcepMaskDataPtr  overflow 
)

Definition at line 80 of file qxrddataprocessorthreaded.cpp.

References correctInt16Image(), QxrdDataProcessorBase::darkImage(), QxrdResultSerializer< T >::enqueue(), m_CorrectedImages, QxrdDataProcessorBase::mask(), and QxrdDataProcessorBase::takeNextFreeImage().

81 {
82  QcepDoubleImageDataPtr corrected = takeNextFreeImage(image->get_Width(), image->get_Height());
83 
84  m_CorrectedImages.enqueue(QtConcurrent::run(this,
86  corrected, image, darkImage(), mask(), overflow));
87 }
QcepMaskDataPtr mask() const
QcepDoubleImageDataPtr darkImage() const
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
QcepDoubleImageDataPtr correctInt16Image(QcepDoubleImageDataPtr corrected, QcepInt16ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
void enqueue(QFuture< T > future)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::acquiredInt32Image ( QcepInt32ImageDataPtr  image,
QcepMaskDataPtr  overflow 
)

Definition at line 89 of file qxrddataprocessorthreaded.cpp.

References correctInt32Image(), QxrdDataProcessorBase::darkImage(), QxrdResultSerializer< T >::enqueue(), m_CorrectedImages, QxrdDataProcessorBase::mask(), and QxrdDataProcessorBase::takeNextFreeImage().

90 {
91  QcepDoubleImageDataPtr corrected = takeNextFreeImage(image->get_Width(), image->get_Height());
92 
93  m_CorrectedImages.enqueue(QtConcurrent::run(this,
95  corrected, image, darkImage(), mask(), overflow));
96 }
QcepMaskDataPtr mask() const
QcepDoubleImageDataPtr darkImage() const
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void enqueue(QFuture< T > future)
QcepDoubleImageDataPtr correctInt32Image(QcepDoubleImageDataPtr corrected, QcepInt32ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::addImages ( QStringList  names)
slot

Definition at line 383 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), QxrdDataProcessorBase::data(), QxrdDataProcessorBase::filePathInDataDirectory(), QcepObject::name, QxrdDataProcessorBase::newData(), QxrdDataProcessorBase::printMessage(), QcepImageDataBase::Raw16Data, QcepImageDataBase::Raw32Data, QxrdDataProcessorBase::statusMessage(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

384 {
385  QcepDoubleImageDataPtr summed = data();
386 
387  foreach(QString name, names) {
389  QString path = filePathInDataDirectory(name);
390 
391  if (img->readImage(path)) {
392  printMessage(tr("Load image from %1").arg(path));
393  statusMessage(tr("Load image from %1").arg(path));
394 
395  img -> loadMetaData();
396 
397  int typ = img->get_DataType();
398 
399  if ((typ == QcepDoubleImageData::Raw16Data) ||
401  {
403  }
404 
405  summed->add(img);
406  } else {
407  printMessage(tr("Couldn't load %1").arg(path));
408  statusMessage(tr("Couldn't load %1").arg(path));
409  }
410  }
411 
412  newData(summed, QcepMaskDataPtr());
413 }
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QcepDoubleImageDataPtr data() const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::beginAcquisition ( int  isDark)

Definition at line 41 of file qxrddataprocessorthreaded.cpp.

42 {
43 }
QxrdHistogramDataPtr QxrdDataProcessorThreaded::calculateHistogram ( QcepDoubleImageDataPtr  image,
QcepMaskDataPtr  mask 
)
private

Definition at line 309 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

310 {
311  QThread::currentThread()->setObjectName("calculateHistogram");
312 
313  if (qcepDebug(DEBUG_PROCESS)) {
314  printMessage(tr("QxrdDataProcessorThreaded::calculateHistogram"));
315  }
316 
317  return QxrdHistogramDataPtr();
318 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdHistogramData > QxrdHistogramDataPtr

Here is the call graph for this function:

QxrdROIDataPtr QxrdDataProcessorThreaded::calculateROI ( QcepDoubleImageDataPtr  image,
QcepMaskDataPtr  mask 
)
private

Definition at line 288 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

289 {
290  QThread::currentThread()->setObjectName("calculateROI");
291 
292  if (qcepDebug(DEBUG_PROCESS)) {
293  printMessage(tr("QxrdDataProcessorThreaded::calculateROI"));
294  }
295 
296  return QxrdROIDataPtr();
297 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdROIData > QxrdROIDataPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

void QxrdDataProcessorThreaded::clearAccumulator ( )
slot

Definition at line 447 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::m_Integrator.

448 {
449  m_Integrator -> clearAccumulator(get_AccumulateIntegratedName());
450 }
QxrdIntegratorPtr m_Integrator
QcepDoubleImageDataPtr QxrdDataProcessorThreaded::correctDoubleImage ( QcepDoubleImageDataPtr  corrected,
QcepDoubleImageDataPtr  image,
QcepDoubleImageDataPtr  dark,
QcepMaskDataPtr  mask,
QcepMaskDataPtr  overflow 
)
private

Definition at line 174 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

Referenced by acquiredDoubleImage().

175 {
176  QThread::currentThread()->setObjectName("correctDoubleImage");
177 
178  if (qcepDebug(DEBUG_PROCESS)) {
179  printMessage(tr("QxrdDataProcessorThreaded::correctDoubleImage"));
180  }
181 
182  if (image) {
183  if ((image -> get_ImageNumber()) >= 0) {
184  return processAcquiredDoubleImage(corrected, image, dark, mask, overflow);
185  } else {
186  if (get_SaveDarkImages()) {
187  saveNamedImageData(image->get_FileName(), image, overflow);
188 
189  set_DarkImagePath(image->get_FileName());
190  }
191 
192  newDarkImage(image);
193  }
194  }
195 
196  return QcepDoubleImageDataPtr();
197 }
QcepMaskDataPtr mask() const
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void newDarkImage(QcepInt16ImageDataPtr image)
QcepDoubleImageDataPtr processAcquiredDoubleImage(QcepDoubleImageDataPtr processed, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void saveNamedImageData(QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

QcepDoubleImageDataPtr QxrdDataProcessorThreaded::correctDoubleImage ( QcepDoubleImageDataPtr  corrected,
QcepDoubleImageDataPtr  image,
QcepDoubleImageDataPtr  dark,
QcepMaskDataPtr  overflow,
QcepDoubleList  v 
)
private

Definition at line 200 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

201 {
202  QThread::currentThread()->setObjectName("correctDoubleImage");
203 
204  if (qcepDebug(DEBUG_PROCESS)) {
205  printMessage(tr("QxrdDataProcessorThreaded::correctDoubleImage"));
206  }
207 
208  if (image) {
209  if ((image -> get_ImageNumber()) >= 0) {
210  return processAcquiredDoubleImage(corrected, image, dark, image->mask(), overflow, v);
211  } else {
212  if (get_SaveDarkImages()) {
213  saveNamedImageData(image->get_FileName(), image, overflow);
214 
215  set_DarkImagePath(image->get_FileName());
216  }
217 
218  newDarkImage(image);
219  }
220  }
221 
222  return QcepDoubleImageDataPtr();
223 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void newDarkImage(QcepInt16ImageDataPtr image)
QcepDoubleImageDataPtr processAcquiredDoubleImage(QcepDoubleImageDataPtr processed, QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void saveNamedImageData(QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

QcepDoubleImageDataPtr QxrdDataProcessorThreaded::correctInt16Image ( QcepDoubleImageDataPtr  corrected,
QcepInt16ImageDataPtr  image,
QcepDoubleImageDataPtr  dark,
QcepMaskDataPtr  mask,
QcepMaskDataPtr  overflow 
)
private

Definition at line 123 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

Referenced by acquiredInt16Image().

124 {
125  QThread::currentThread()->setObjectName("correctInt16Image");
126 
127  if (qcepDebug(DEBUG_PROCESS)) {
128  printMessage(tr("QxrdDataProcessorThreaded::correctInt16Image"));
129  }
130 
131  if (image) {
132  if ((image -> get_ImageNumber()) >= 0) {
133  return processAcquiredInt16Image(corrected, image, dark, mask, overflow);
134  } else {
135  if (get_SaveDarkImages()) {
136  saveNamedImageData(image->get_FileName(), image, overflow);
137  set_DarkImagePath(image->get_FileName());
138  }
139 
140  newDarkImage(image);
141  }
142  }
143 
144  return QcepDoubleImageDataPtr();
145 }
QcepMaskDataPtr mask() const
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void newDarkImage(QcepInt16ImageDataPtr image)
QcepDoubleImageDataPtr processAcquiredInt16Image(QcepDoubleImageDataPtr processed, QcepInt16ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void saveNamedImageData(QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

QcepDoubleImageDataPtr QxrdDataProcessorThreaded::correctInt32Image ( QcepDoubleImageDataPtr  corrected,
QcepInt32ImageDataPtr  image,
QcepDoubleImageDataPtr  dark,
QcepMaskDataPtr  mask,
QcepMaskDataPtr  overflow 
)
private

Definition at line 148 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

Referenced by acquiredInt32Image().

149 {
150  QThread::currentThread()->setObjectName("correctInt32Image");
151 
152  if (qcepDebug(DEBUG_PROCESS)) {
153  printMessage(tr("QxrdDataProcessorThreaded::correctInt32Image"));
154  }
155 
156  if (image) {
157  if ((image -> get_ImageNumber()) >= 0) {
158  return processAcquiredInt32Image(corrected, image, dark, mask, overflow);
159  } else {
160  if (get_SaveDarkImages()) {
161  saveNamedImageData(image->get_FileName(), image, overflow);
162 
163  set_DarkImagePath(image->get_FileName());
164  }
165 
166  newDarkImage(image);
167  }
168  }
169 
170  return QcepDoubleImageDataPtr();
171 }
QcepMaskDataPtr mask() const
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void newDarkImage(QcepInt16ImageDataPtr image)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void saveNamedImageData(QString name, QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow, int canOverwrite=NoOverwrite)
QcepDoubleImageDataPtr processAcquiredInt32Image(QcepDoubleImageDataPtr processed, QcepInt32ImageDataPtr image, QcepDoubleImageDataPtr dark, QcepMaskDataPtr mask, QcepMaskDataPtr overflow)
QcepMaskDataPtr overflow() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::correlateImages ( QStringList  names)
slot

Definition at line 662 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), QxrdDataProcessorBase::data(), QxrdDataProcessorBase::filePathInDataDirectory(), QcepObject::name, QxrdDataProcessorBase::printMessage(), QcepImageDataBase::Raw16Data, QcepImageDataBase::Raw32Data, QxrdDataProcessorBase::statusMessage(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

663 {
664  QcepDoubleImageDataPtr imga = data();
665 
666  foreach(QString name, names) {
668  QString path = filePathInDataDirectory(name);
669 
670  if (imgb->readImage(path)) {
671  printMessage(tr("Load image from %1").arg(path));
672  statusMessage(tr("Load image from %1").arg(path));
673 
674  imgb -> loadMetaData();
675 
676  int typ = imgb->get_DataType();
677 
678  if ((typ == QcepDoubleImageData::Raw16Data) ||
680  {
681  subtractDarkImage(imgb, darkImage());
682  }
683 
684  printMessage("dx\tdy\tcorr");
685 
686  for (int dy = -10; dy<=10; dy++) {
687  for (int dx = -10; dx<=10; dx++) {
688  double corr = imga->correlate(imgb, dx, dy, 10, 10);
689 
690  printMessage(tr("%1\t%2\t%3").arg(dx).arg(dy).arg(corr));
691  }
692  }
693  } else {
694  printMessage(tr("Couldn't load %1").arg(path));
695  statusMessage(tr("Couldn't load %1").arg(path));
696  }
697  }
698 }
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QcepDoubleImageDataPtr data() const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

double QxrdDataProcessorThreaded::estimatedProcessingTime ( double  estSerTime,
double  estParallelTime 
)
protected

Definition at line 329 of file qxrddataprocessorthreaded.cpp.

330 {
331  int nThreads = QThreadPool::globalInstance()->maxThreadCount();
332 
333  if (nThreads >= 2) {
334  return qMax(estSerialTime, estParallelTime/((double)nThreads));
335  } else {
336  return estSerialTime + estParallelTime;
337  }
338 }
void QxrdDataProcessorThreaded::fitPeakNear ( double  x,
double  y 
)
slot

Definition at line 947 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::centerFinder().

948 {
950 
951  if (cf) {
952  cf->fitPeakNear(x,y);
953  }
954 }
QSharedPointer< QxrdCenterFinder > QxrdCenterFinderPtr
QxrdCenterFinderPtr centerFinder() const

Here is the call graph for this function:

void QxrdDataProcessorThreaded::fixupBadBackgroundSubtraction ( QString  imagePattern,
int  nImgExposures,
QString  darkPath,
int  nDarkExposures 
)
slot

Definition at line 904 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::dataDirectory(), QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::m_FileSaver, QxrdDataProcessorBase::NoOverwrite, QxrdDataProcessorBase::printMessage(), and QxrdDataProcessorBase::takeNextFreeImage().

905 {
906  QDirIterator imagePaths(dataDirectory(), QStringList(imagePattern));
907 
909  QString path = filePathInDataDirectory(darkPath);
910 
911  if (dark->readImage(path)) {
912  dark->loadMetaData();
913 
914  int nFileDarkExposures = dark->get_SummedExposures();
915 
916  printMessage(tr("Loaded Dark image from %1 (%2 summed)").arg(path).arg(nFileDarkExposures));
917 
918  while (imagePaths.hasNext()) {
919  QString imagePath=imagePaths.next();
920 
921  QString path = filePathInDataDirectory(imagePath);
923 
924  if (image->readImage(path)) {
925  image->loadMetaData();
926 
927  int nFileImageExposures = image->get_SummedExposures();
928 
929  printMessage(tr("Loaded image from %1 (%2 summed)").arg(path).arg(nFileImageExposures));
930 
931  image->correctBadBackgroundSubtraction(dark,nImgExposures,nDarkExposures);
932 
934 
935  if (saver) {
936  saver->saveDoubleData(path, image, QcepMaskDataPtr(), NoOverwrite);
937  }
938  } else {
939  printMessage(tr("Failed to load image from %1").arg(path));
940  }
941  }
942  } else {
943  printMessage(tr("Failed to load Dark image from %1").arg(path));
944  }
945 }
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
QSharedPointer< QxrdFileSaver > QxrdFileSaverPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QxrdFileSaverWPtr m_FileSaver
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::idleInt16Image ( QcepInt16ImageDataPtr  image,
bool  liveView 
)

Definition at line 45 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), DEBUG_PROCESS, QxrdDataProcessorBase::m_LiveData, QxrdDataProcessorBase::newData(), QxrdDataProcessorBase::printMessage(), qcepDebug(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

46 {
47  QcepMutexLocker lock(__FILE__, __LINE__, image->mutex());
48  int height = image->get_Height();
49  int width = image->get_Width();
50  int nres = image-> get_SummedExposures();
51  int npixels = width*height;
52  if (nres <= 0) nres = 1;
53  double avgraw = 0;
54  quint16 *img = image->data();
55 
56  for (int i=0; i<npixels; i++) {
57  avgraw += *img++;
58  }
59 
60  set_AverageRaw(avgraw/npixels/nres);
61  set_Average(get_AverageRaw() - get_AverageDark());
62 
63  if (liveView) {
64  if (qcepDebug(DEBUG_PROCESS)) {
65  printMessage("Image Live View");
66  }
67 
68  QcepDoubleImageDataPtr corrected = takeNextFreeImage(image->get_Width(), image->get_Height());
70 
71  corrected->copyFrom(image);
72  subtractDarkImage(corrected, dark);
73 
74  newData(corrected, QcepMaskDataPtr());
75 
76  m_LiveData = corrected;
77  }
78 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr m_LiveData
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::integrateAndAccumulate ( QStringList  names)
slot

Definition at line 452 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::m_Integrator, QxrdDataProcessorBase::mask(), QcepObject::name, QxrdDataProcessorBase::printMessage(), QxrdDataProcessorBase::statusMessage(), and QxrdDataProcessorBase::takeNextFreeImage().

453 {
454  int nImages = names.count();
455  m_Integrator -> prepareAccumulator(get_AccumulateIntegratedName(), nImages);
456 
457  foreach(QString name, names) {
459  QString path = filePathInDataDirectory(name);
460 
461  if (img->readImage(path)) {
462  printMessage(tr("Load image from %1").arg(path));
463  statusMessage(tr("Load image from %1").arg(path));
464 
465  img -> loadMetaData();
466 
467  m_Integrator -> appendIntegration(get_AccumulateIntegratedName(), img, mask());
468  } else {
469  printMessage(tr("Couldn't load %1").arg(path));
470  statusMessage(tr("Couldn't load %1").arg(path));
471  }
472  }
473 
474  m_Integrator -> completeAccumulator(get_AccumulateIntegratedName());
475 }
QcepMaskDataPtr mask() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdIntegratorPtr m_Integrator
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::integrateData ( QString  name)
slot

Definition at line 713 of file qxrddataprocessorthreaded.cpp.

References QcepAllocator::AlwaysAllocate, QxrdDataProcessorBase::centerFinder(), QxrdResultSerializer< T >::enqueue(), QxrdDataProcessorBase::filePathInDataDirectory(), integrateImage(), m_IntegratedData, QxrdDataProcessorBase::mask(), QcepAllocator::newDoubleImageAndIntegratedData(), QxrdDataProcessorBase::printMessage(), and QxrdDataProcessorBase::statusMessage().

714 {
715  QThread::currentThread()->setObjectName("integrateData");
716 
718  QcepIntegratedDataPtr result;
719 
721 
722  QString path = filePathInDataDirectory(name);
723 
724  if (img -> readImage(path)) {
725  printMessage(tr("Load image from %1").arg(path));
726  statusMessage(tr("Load image from %1").arg(path));
727 
728  // printf("Read %d x %d image\n", res->get_Width(), res->get_Height());
729 
730  img -> loadMetaData();
731 
733  result,
734  img, mask(),
735  centerFinder() -> get_CenterX(),
736  centerFinder() -> get_CenterY()));
737  } else {
738  printMessage(tr("Couldn't load %1").arg(path));
739  statusMessage(tr("Couldn't load %1").arg(path));
740  }
741 }
QcepMaskDataPtr mask() const
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
static void newDoubleImageAndIntegratedData(AllocationStrategy strat, int width, int height, QcepObject *parent, QcepDoubleImageDataPtr &img, QcepIntegratedDataPtr &integ)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
void enqueue(QFuture< T > future)
QcepIntegratedDataPtr integrateImage(QcepIntegratedDataPtr integ, QcepDoubleImageDataPtr image, QcepMaskDataPtr mask, double cx, double cy)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QxrdCenterFinderPtr centerFinder() const
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

QcepIntegratedDataPtr QxrdDataProcessorThreaded::integrateImage ( QcepIntegratedDataPtr  integ,
QcepDoubleImageDataPtr  image,
QcepMaskDataPtr  mask,
double  cx,
double  cy 
)
private

Definition at line 247 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, and qcepDebug().

Referenced by integrateData(), and onCorrectedImageAvailable().

248 {
249  QThread::currentThread()->setObjectName("integrateImage");
250 
251  if (qcepDebug(DEBUG_PROCESS)) {
252  printMessage(tr("QxrdDataProcessorThreaded::integrateImage"));
253  }
254 
255  if (image && get_PerformIntegration()) {
256  QTime tic;
257  tic.start();
258 
259  m_Integrator -> performIntegration(integ, image, mask);
260 
261  updateEstimatedTime(prop_PerformIntegrationTime(), tic.restart());
262 
263  return integ;
264  }
265 
266  return QcepIntegratedDataPtr();
267 }
QcepMaskDataPtr mask() const
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
void updateEstimatedTime(QcepDoubleProperty *prop, int msec)
QxrdIntegratorPtr m_Integrator
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::integrateSaveAndDisplay ( )
slot

Definition at line 888 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::data(), DEBUG_INTEGRATOR, QxrdResultSerializer< T >::enqueue(), QxrdDataProcessorBase::m_CenterFinder, m_IntegratedData, QxrdDataProcessorBase::m_Integrator, QxrdDataProcessorBase::mask(), QcepAllocator::newIntegratedData(), QxrdIntegrator::performIntegration(), QxrdDataProcessorBase::printMessage(), qcepDebug(), and QcepAllocator::WaitTillAvailable.

Referenced by QxrdWindow::initialize(), and QxrdIntegratorDialog::QxrdIntegratorDialog().

889 {
891  printMessage(tr("processor.integrateSaveAndDisplay: %1, %2, %3")
892  .arg(data()->get_FileName()).arg(m_CenterFinder->get_CenterX()).arg(m_CenterFinder->get_CenterY()));
893  }
894 
896 
898  QtConcurrent::run(m_Integrator.data(),
900  integ,
901  data(), mask()));
902 }
QcepMaskDataPtr mask() const
static QcepIntegratedDataPtr newIntegratedData(AllocationStrategy strat, QcepDoubleImageDataPtr image, QcepObject *parent)
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
QxrdCenterFinderPtr m_CenterFinder
QcepIntegratedDataPtr performIntegration(QcepIntegratedDataPtr integ, QcepDoubleImageDataPtr dimg, QcepMaskDataPtr mask)
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
void enqueue(QFuture< T > future)
QcepDoubleImageDataPtr data() const
QxrdIntegratorPtr m_Integrator
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::onCorrectedImageAvailable ( )
privateslot

Definition at line 225 of file qxrddataprocessorthreaded.cpp.

References QcepAllocator::AlwaysAllocate, QxrdDataProcessorBase::calculateHistogram(), QxrdDataProcessorBase::calculateROI(), QxrdDataProcessorBase::centerFinder(), QxrdResultSerializer< T >::dequeue(), QxrdResultSerializer< T >::enqueue(), integrateImage(), m_CorrectedImages, m_HistogramData, m_IntegratedData, m_ROIData, and QcepAllocator::newIntegratedData().

Referenced by QxrdDataProcessorThreaded().

226 {
228  QcepMaskDataPtr mask = (img ? img->mask() : QcepMaskDataPtr());
230 
231  if (img) {
233  integ,
234  img, mask,
235  centerFinder() -> get_CenterX(),
236  centerFinder() -> get_CenterY()));
237 
239  img, mask));
240 
242  img, mask));
243  }
244 }
QcepMaskDataPtr mask() const
static QcepIntegratedDataPtr newIntegratedData(AllocationStrategy strat, QcepDoubleImageDataPtr image, QcepObject *parent)
QxrdResultSerializer< QxrdHistogramDataPtr > m_HistogramData
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
QxrdResultSerializer< QcepDoubleImageDataPtr > m_CorrectedImages
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
void enqueue(QFuture< T > future)
QcepIntegratedDataPtr integrateImage(QcepIntegratedDataPtr integ, QcepDoubleImageDataPtr image, QcepMaskDataPtr mask, double cx, double cy)
QxrdResultSerializer< QxrdROIDataPtr > m_ROIData
QxrdCenterFinderPtr centerFinder() const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::onHistogramDataAvailable ( )
privateslot

Definition at line 320 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, QxrdResultSerializer< T >::dequeue(), m_HistogramData, QxrdDataProcessorBase::printMessage(), and qcepDebug().

Referenced by QxrdDataProcessorThreaded().

321 {
322  if (qcepDebug(DEBUG_PROCESS)) {
323  printMessage(tr("QxrdDataProcessorThreaded::onHistogramDataAvailable"));
324  }
325 
327 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdResultSerializer< QxrdHistogramDataPtr > m_HistogramData
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdHistogramData > QxrdHistogramDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::onIntegratedDataAvailable ( )
privateslot

Definition at line 269 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, QxrdResultSerializer< T >::dequeue(), QxrdDataProcessorBase::displayIntegratedData, m_IntegratedData, QxrdDataProcessorBase::m_Integrator, QxrdDataProcessorBase::printMessage(), qcepDebug(), and QxrdDataProcessorBase::writeOutputScan().

Referenced by QxrdDataProcessorThreaded().

270 {
271  if (qcepDebug(DEBUG_PROCESS)) {
272  printMessage(tr("QxrdDataProcessorThreaded::onIntegratedDataAvailable"));
273  }
274 
276 
277  if (integ) {
278  writeOutputScan(integ);
279  displayIntegratedData(integ);
280 
281  if (get_AccumulateIntegrated2D()) {
282  m_Integrator -> appendIntegration(get_AccumulateIntegratedName(), integ);
283  }
284  }
285 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
QxrdIntegratorPtr m_Integrator
void writeOutputScan(QcepIntegratedDataPtr d)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::onROIDataAvailable ( )
privateslot

Definition at line 299 of file qxrddataprocessorthreaded.cpp.

References DEBUG_PROCESS, QxrdResultSerializer< T >::dequeue(), m_ROIData, QxrdDataProcessorBase::printMessage(), and qcepDebug().

Referenced by QxrdDataProcessorThreaded().

300 {
301  if (qcepDebug(DEBUG_PROCESS)) {
302  printMessage(tr("QxrdDataProcessorThreaded::onROIDataAvailable"));
303  }
304 
305  QxrdROIDataPtr roiData = m_ROIData.dequeue();
306 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdROIData > QxrdROIDataPtr
QxrdResultSerializer< QxrdROIDataPtr > m_ROIData
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::processData ( QString  name)
slot

Definition at line 743 of file qxrddataprocessorthreaded.cpp.

References acquiredDoubleImage(), QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::printMessage(), QxrdDataProcessorBase::statusMessage(), and QxrdDataProcessorBase::takeNextFreeImage().

Referenced by processDataSequence().

744 {
746 
747  QString path = filePathInDataDirectory(name);
748 
749  if (res -> readImage(path)) {
750  printMessage(tr("Load image from %1").arg(path));
751  statusMessage(tr("Load image from %1").arg(path));
752 
753  // printf("Read %d x %d image\n", res->get_Width(), res->get_Height());
754 
755  res -> loadMetaData();
756 
757  acquiredDoubleImage(res, /*darkImage(), mask(),*/ QcepMaskDataPtr());
758 
759  set_DataPath(res -> get_FileName());
760  } else {
761  printMessage(tr("Couldn't load %1").arg(path));
762  statusMessage(tr("Couldn't load %1").arg(path));
763  }
764 }
void acquiredDoubleImage(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::processDataSequence ( QString  path,
QString  filter = "*.tif" 
)
slot

Definition at line 766 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::printMessage(), and processData().

767 {
768  QDirIterator iter(path, QStringList(filter));
769 
770  while (iter.hasNext()) {
771  QString path = iter.next();
772 
773  printMessage(path);
774 
775  processData(path);
776  }
777 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

void QxrdDataProcessorThreaded::processDataSequence ( QStringList  paths)
slot

Definition at line 779 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::printMessage(), and processData().

780 {
781  QString path;
782 
783  foreach(path, paths) {
784  printMessage(path);
785 
786  processData(path);
787  }
788 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

void QxrdDataProcessorThreaded::processDataSequence ( QString  path,
QStringList  filter 
)
slot

Definition at line 790 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::printMessage(), and processData().

791 {
792  QDirIterator iter(path, filters);
793 
794  while (iter.hasNext()) {
795  QString path = iter.next();
796 
797  printMessage(path);
798 
799  processData(path);
800  }
801 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

void QxrdDataProcessorThreaded::processNormalizedFile ( QString  path,
double  v1 
)
slot

Definition at line 803 of file qxrddataprocessorthreaded.cpp.

Referenced by processNormalizedFile().

804 {
805  QList<double> v;
806  v << v1;
807 
808  processNormalizedFile(path, v);
809 }
void processNormalizedFile(QString path, double v1)

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::processNormalizedFile ( QString  path,
double  v1,
double  v2 
)
slot

Definition at line 811 of file qxrddataprocessorthreaded.cpp.

References processNormalizedFile().

812 {
813  QList<double> v;
814  v << v1 << v2;
815 
816  processNormalizedFile(path, v);
817 }
void processNormalizedFile(QString path, double v1)

Here is the call graph for this function:

void QxrdDataProcessorThreaded::processNormalizedFile ( QString  path,
QcepDoubleList  v 
)
slot

Definition at line 819 of file qxrddataprocessorthreaded.cpp.

References acquiredDoubleImage(), QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::mask(), QxrdDataProcessorBase::printMessage(), and QxrdDataProcessorBase::takeNextFreeImage().

820 {
822 
823  QString path = filePathInDataDirectory(name);
824 
825  if (res -> readImage(path)) {
826 
827  // printf("Read %d x %d image\n", res->get_Width(), res->get_Height());
828 
829  res -> loadMetaData();
830  res -> setMask(mask(), QcepMaskDataPtr());
831 
832  acquiredDoubleImage(res, /*darkImage(), mask(),*/ QcepMaskDataPtr(), v);
833 
834  set_DataPath(res -> get_FileName());
835  } else {
836  printMessage(tr("Couldn't load %1").arg(path));
837  }
838 }
QcepMaskDataPtr mask() const
void acquiredDoubleImage(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::projectImages ( QStringList  names,
int  px,
int  py,
int  pz 
)
slot

Definition at line 526 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::m_Experiment, QxrdDataProcessorBase::newData(), QxrdDataProcessorBase::printMessage(), QcepImageDataBase::Raw16Data, QcepImageDataBase::Raw32Data, QxrdDataProcessorBase::statusMessage(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

527 {
528  QcepDoubleImageDataPtr sumx, sumy, sumz;
529 
530  int nx = 0;
531  int ny = 0;
532  int nz = names.count();
533  int first = true;
534 
535  if (px) {
536  sumx = takeNextFreeImage(0,0);
537  printMessage(tr("Projecting %1 images onto X").arg(nz));
538  }
539 
540  if (py) {
541  sumy = takeNextFreeImage(0,0);
542  printMessage(tr("Projecting %1 images onto Y").arg(nz));
543  }
544 
545  if (pz) {
546  sumz = takeNextFreeImage(0,0);
547  printMessage(tr("Projecting %1 images onto Z").arg(nz));
548  }
549 
551 
552  if (expt) {
553  expt->commenceWork(nz);
554  }
555 
556  for (int i=0; i<nz; i++) {
558  QString path = filePathInDataDirectory(names[i]);
559 
560  if (img->readImage(path)) {
561  printMessage(tr("Load image from %1").arg(path));
562  statusMessage(tr("Load image from %1").arg(path));
563 
564  img->loadMetaData();
565  int typ = img->get_DataType();
566 
567  if ((typ == QcepDoubleImageData::Raw16Data) ||
569  {
571  }
572 
573  if (first) {
574  nx = img->get_Width();
575  ny = img->get_Height();
576 
577  if (px) {
578  sumx->copyPropertiesFrom(img);
579  sumx->resize(nz,ny);
580  sumx->clear();
581  sumx->set_SummedExposures(0);
582  }
583 
584  if (py) {
585  sumy->copyPropertiesFrom(img);
586  sumy->resize(nz,nx);
587  sumy->clear();
588  sumy->set_SummedExposures(0);
589  }
590 
591  if (pz) {
592  sumz->copyPropertiesFrom(img);
593  sumz->resize(nx,ny);
594  sumz->clear();
595  sumz->set_SummedExposures(0);
596  }
597 
598  first = false;
599  }
600 
601  if (px) {
602  sumx->prop_SummedExposures()->incValue(1);
603 
604  for (int y=0; y<ny; y++) {
605  double sum=0;
606 
607  for (int x=0; x<nx; x++) {
608  sum += img->getImageData(x,y);
609  }
610 
611  sumx->addValue(i,y, sum);
612  }
613  }
614 
615  if (py) {
616  sumy->prop_SummedExposures()->incValue(1);
617 
618  for (int x=0; x<nx; x++) {
619  double sum=0;
620 
621  for (int y=0; y<ny; y++) {
622  sum += img->getImageData(x,y);
623  }
624 
625  sumy->addValue(i,x, sum);
626  }
627  }
628 
629  if (pz) {
630  sumz->prop_SummedExposures()->incValue(1);
631 
632  for (int x=0; x<nx; x++) {
633  for (int y=0; y<ny; y++) {
634  sumz->addValue(x,y, img->getImageData(x,y));
635  }
636  }
637  }
638  }
639 
640  if (expt) {
641  expt->completeWork(1);
642  }
643  }
644 
645  if (px) {
646  newData(sumx, QcepMaskDataPtr());
647  }
648 
649  if (py) {
650  newData(sumy, QcepMaskDataPtr());
651  }
652 
653  if (pz) {
654  newData(sumz, QcepMaskDataPtr());
655  }
656 
657  if (expt) {
658  expt->finishedWork(nz);
659  }
660 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdExperimentWPtr m_Experiment
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::reflectHorizontally ( )
slot

Definition at line 482 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::data(), and QxrdDataProcessorBase::newData().

483 {
484  QcepDoubleImageDataPtr image = data();
485 
486  if (image) {
487  int wid = image->get_Width();
488  int hgt = image->get_Height();
489 
490  for (int y=0; y<hgt; y++) {
491  for (int x=0; x<wid/2; x++) {
492  double val1 = image->getImageData(x,y);
493  double val2 = image->getImageData(wid-x-1, y);
494 
495  image->setValue(wid-x-1, y, val1);
496  image->setValue(x,y, val2);
497  }
498  }
499  }
500 
501  newData(image, QcepMaskDataPtr());
502 }
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr data() const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::reflectVertically ( )
slot

Definition at line 504 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::data(), and QxrdDataProcessorBase::newData().

505 {
506  QcepDoubleImageDataPtr image = data();
507 
508  if (image) {
509  int wid = image->get_Width();
510  int hgt = image->get_Height();
511 
512  for (int x=0; x<wid; x++) {
513  for (int y=0; y<hgt/2; y++) {
514  double val1 = image->getImageData(x,y);
515  double val2 = image->getImageData(x, hgt-y-1);
516 
517  image->setValue(x, hgt-y-1, val1);
518  image->setValue(x,y, val2);
519  }
520  }
521  }
522 
523  newData(image, QcepMaskDataPtr());
524 }
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr data() const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::saveAccumulator ( QString &  path,
QString  filter 
)
slot

Definition at line 477 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::m_Integrator.

478 {
479  m_Integrator -> saveAccumulator(get_AccumulateIntegratedName(), path, filter);
480 }
QxrdIntegratorPtr m_Integrator
void saveAccumulator(QString &path, QString filter)
void QxrdDataProcessorThreaded::setFileNormalization ( QString  path,
double  v1 
)
slot

Definition at line 840 of file qxrddataprocessorthreaded.cpp.

Referenced by setFileNormalization().

841 {
842  QList<double> v;
843  v << v1;
844 
845  setFileNormalization(path, v);
846 }
void setFileNormalization(QString path, double v1)

Here is the caller graph for this function:

void QxrdDataProcessorThreaded::setFileNormalization ( QString  path,
double  v1,
double  v2 
)
slot

Definition at line 848 of file qxrddataprocessorthreaded.cpp.

References setFileNormalization().

849 {
850  QList<double> v;
851  v << v1 << v2;
852 
853  setFileNormalization(path, v);
854 }
void setFileNormalization(QString path, double v1)

Here is the call graph for this function:

void QxrdDataProcessorThreaded::setFileNormalization ( QString  path,
QcepDoubleList  v 
)
slot

Definition at line 856 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::filePathInDataDirectory(), QxrdDataProcessorBase::m_Experiment, QxrdDataProcessorBase::mask(), QxrdDataProcessorBase::printMessage(), and QxrdDataProcessorBase::takeNextFreeImage().

857 {
859 
860  QString path = filePathInDataDirectory(name);
861 
862  if (res -> readImage(path)) {
863 
864  // printf("Read %d x %d image\n", res->get_Width(), res->get_Height());
865 
867 
868  res -> loadMetaData();
869  res -> setMask(mask(), QcepMaskDataPtr());
870  res -> set_Normalization(v);
871  res -> saveMetaData(name);
872  } else {
873  printMessage(tr("Couldn't load %1").arg(path));
874  }
875 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QcepMaskDataPtr mask() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
QxrdExperimentWPtr m_Experiment
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::shiftImage ( int  dx,
int  dy 
)
slot

Definition at line 700 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::data(), QxrdDataProcessorBase::newData(), and QxrdDataProcessorBase::takeNextFreeImage().

701 {
703 
704  if (img) {
705  QcepDoubleImageDataPtr shft = takeNextFreeImage(img->get_Width(), img->get_Height());
706 
707  shft->shiftImage(img, dx, dy);
708 
709  newData(shft, QcepMaskDataPtr());
710  }
711 }
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
QcepDoubleImageDataPtr data() const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::slicePolygon ( QVector< QPointF >  poly)
slot

Definition at line 877 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::data(), QxrdResultSerializer< T >::enqueue(), QxrdDataProcessorBase::m_Data, m_IntegratedData, QxrdDataProcessorBase::m_Integrator, QcepAllocator::newIntegratedData(), QxrdIntegrator::slicePolygon(), and QcepAllocator::WaitTillAvailable.

878 {
880 
882  QtConcurrent::run(m_Integrator.data(),
884  integ,
885  m_Data, poly, 0));
886 }
QcepIntegratedDataPtr slicePolygon(QcepIntegratedDataPtr integ, QcepDoubleImageDataPtr dimg, QVector< QPointF > poly, double width)
static QcepIntegratedDataPtr newIntegratedData(AllocationStrategy strat, QcepDoubleImageDataPtr image, QcepObject *parent)
QxrdResultSerializer< QcepIntegratedDataPtr > m_IntegratedData
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
void enqueue(QFuture< T > future)
QcepDoubleImageDataPtr data() const
QcepDoubleImageDataPtr m_Data
QxrdIntegratorPtr m_Integrator

Here is the call graph for this function:

void QxrdDataProcessorThreaded::subtractImages ( QStringList  names)
slot

Definition at line 415 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), QxrdDataProcessorBase::data(), QxrdDataProcessorBase::filePathInDataDirectory(), QcepObject::name, QxrdDataProcessorBase::newData(), QxrdDataProcessorBase::printMessage(), QcepImageDataBase::Raw16Data, QcepImageDataBase::Raw32Data, QxrdDataProcessorBase::statusMessage(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

416 {
417  QcepDoubleImageDataPtr summed = data();
418 
419  foreach(QString name, names) {
421  QString path = filePathInDataDirectory(name);
422 
423  if (img->readImage(path)) {
424  printMessage(tr("Load image from %1").arg(path));
425  statusMessage(tr("Load image from %1").arg(path));
426 
427  img -> loadMetaData();
428 
429  int typ = img->get_DataType();
430 
431  if ((typ == QcepDoubleImageData::Raw16Data) ||
433  {
435  }
436 
437  summed->subtract(img);
438  } else {
439  printMessage(tr("Couldn't load %1").arg(path));
440  statusMessage(tr("Couldn't load %1").arg(path));
441  }
442  }
443 
444  newData(summed, QcepMaskDataPtr());
445 }
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QcepDoubleImageDataPtr data() const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

void QxrdDataProcessorThreaded::sumImages ( QStringList  names)
slot

Definition at line 340 of file qxrddataprocessorthreaded.cpp.

References QxrdDataProcessorBase::darkImage(), QxrdDataProcessorBase::filePathInDataDirectory(), QcepObject::name, QxrdDataProcessorBase::newData(), QxrdDataProcessorBase::printMessage(), QcepImageDataBase::Raw16Data, QcepImageDataBase::Raw32Data, QxrdDataProcessorBase::statusMessage(), QxrdDataProcessorBase::subtractDarkImage(), and QxrdDataProcessorBase::takeNextFreeImage().

341 {
343  int first = true;
344 
345  foreach(QString name, names) {
347  QString path = filePathInDataDirectory(name);
348 
349  if (img->readImage(path)) {
350  printMessage(tr("Load image from %1").arg(path));
351  statusMessage(tr("Load image from %1").arg(path));
352 
353  img -> loadMetaData();
354 
355  int typ = img->get_DataType();
356 
357  if ((typ == QcepDoubleImageData::Raw16Data) ||
359  {
361  }
362 
363  if (first) {
364  summed->copyFrom(img);
365  first = false;
366  } else {
367  summed->accumulateImage(img);
368  }
369  } else {
370  printMessage(tr("Couldn't load %1").arg(path));
371  statusMessage(tr("Couldn't load %1").arg(path));
372  }
373  }
374 
375  if (first) {
376  printMessage(tr("No images were loaded"));
377  statusMessage(tr("No images were loaded"));
378  } else {
379  newData(summed, QcepMaskDataPtr());
380  }
381 }
void subtractDarkImage(QcepDoubleImageDataPtr image, QcepDoubleImageDataPtr dark)
QcepDoubleImageDataPtr darkImage() const
QcepDoubleImageDataPtr takeNextFreeImage(int width, int height)
void newData(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QString filePathInDataDirectory(QString name) const
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr

Here is the call graph for this function:

Member Data Documentation

QxrdResultSerializer<QcepDoubleImageDataPtr> QxrdDataProcessorThreaded::m_CorrectedImages
private
QxrdResultSerializer<QxrdHistogramDataPtr> QxrdDataProcessorThreaded::m_HistogramData
private
QxrdResultSerializer<QcepIntegratedDataPtr> QxrdDataProcessorThreaded::m_IntegratedData
private
QxrdResultSerializer<QxrdROIDataPtr> QxrdDataProcessorThreaded::m_ROIData
private

The documentation for this class was generated from the following files: