59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_IMAGEANALYSISCPU_H
|
|
#define JFJOCH_IMAGEANALYSISCPU_H
|
|
|
|
#include <mutex>
|
|
|
|
#include "../common/JFJochMessages.h"
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "../common/AzimuthalIntegration.h"
|
|
#include "../common/PixelMask.h"
|
|
#include "../common/AzimuthalIntegrationProfile.h"
|
|
#include "bragg_integration/BraggPrediction.h"
|
|
#include "spot_finding/ImageSpotFinder.h"
|
|
#include "indexing/IndexerThreadPool.h"
|
|
|
|
class MXAnalysisWithoutFPGA {
|
|
std::mutex m;
|
|
const DiffractionExperiment &experiment;
|
|
const AzimuthalIntegration &integration;
|
|
|
|
|
|
std::vector<uint16_t> roi_map;
|
|
std::map<std::string, uint16_t> roi_names;
|
|
size_t roi_count;
|
|
|
|
size_t npixels;
|
|
size_t xpixels;
|
|
std::vector<bool> mask_1bit;
|
|
|
|
std::unique_ptr<ImageSpotFinder> spotFinder;
|
|
IndexerThreadPool *indexer;
|
|
std::unique_ptr<BraggPrediction> prediction;
|
|
std::vector<int32_t> &updated_image;
|
|
|
|
uint16_t azint_bins;
|
|
|
|
const int64_t saturation_limit;
|
|
|
|
const PixelMask &mask;
|
|
|
|
std::vector<bool> mask_resolution;
|
|
float mask_high_res;
|
|
float mask_low_res;
|
|
void UpdateMaskResolution(const SpotFindingSettings& settings);
|
|
|
|
template <class T>
|
|
void Analyze(DataMessage &output, const uint8_t *image, T err_pixel_val, T sat_pixel_val, AzimuthalIntegrationProfile &profile, const SpotFindingSettings &settings);
|
|
public:
|
|
MXAnalysisWithoutFPGA(const DiffractionExperiment &experiment, const AzimuthalIntegration &integration,
|
|
const PixelMask &mask,
|
|
IndexerThreadPool *indexer = nullptr);
|
|
void Analyze(DataMessage &output, std::vector<uint8_t> &buffer, AzimuthalIntegrationProfile &profile, const SpotFindingSettings &spot_finding_settings);
|
|
};
|
|
|
|
|
|
#endif //JFJOCH_IMAGEANALYSISCPU_H
|