ImagePreprocessor: Dedicated class to handle preprocessing of diffraction images in Receiver Lite workflow + remove ROI calculation in Lite workflow
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Created by jungfrau on 4/22/26.
|
||||
//
|
||||
|
||||
#include "ImagePreprocessor.h"
|
||||
|
||||
ImagePreprocessor::ImagePreprocessor(const DiffractionExperiment &experiment,
|
||||
const AzimuthalIntegration &integration,
|
||||
const PixelMask &mask)
|
||||
: npixels(experiment.GetPixelsNum()),
|
||||
experiment(experiment),
|
||||
integration(integration),
|
||||
azint_sum(integration.GetBinNumber(), 0.0),
|
||||
azint_sum2(integration.GetBinNumber(), 0.0),
|
||||
azint_count(integration.GetBinNumber(), 0),
|
||||
processed_image(npixels, INT32_MIN),
|
||||
mask_1bit(npixels, false),
|
||||
azint_bins(integration.GetBinNumber()),
|
||||
saturation_limit(experiment.GetSaturationLimit()) {
|
||||
for (int i = 0; i < npixels; i++)
|
||||
mask_1bit[i] = (mask.GetMask().at(i) != 0);
|
||||
}
|
||||
|
||||
const std::vector<int32_t> &ImagePreprocessor::GetProcessedImage() const {
|
||||
return processed_image;
|
||||
}
|
||||
|
||||
void ImagePreprocessor::Update(AzimuthalIntegrationProfile &profile) const {
|
||||
profile.Clear(integration);
|
||||
profile.Add(azint_sum, azint_count);
|
||||
}
|
||||
Reference in New Issue
Block a user