IndexAndRefine: Refactor integration

This commit is contained in:
2025-11-29 21:02:14 +01:00
parent 70a03b87ff
commit 118fed1d83
15 changed files with 344 additions and 387 deletions
+7 -9
View File
@@ -4,7 +4,7 @@
#include "MXAnalysisAfterFPGA.h"
#include "spot_finding/DetModuleSpotFinder_cpu.h"
#include "../common/CUDAWrapper.h"
#include "SpotAnalyze.h"
#include "spot_finding/SpotUtils.h"
#include "bragg_integration/BraggPredictionFactory.h"
double stddev(const std::vector<float> &v) {
@@ -25,19 +25,14 @@ double stddev(const std::vector<float> &v) {
}
MXAnalysisAfterFPGA::MXAnalysisAfterFPGA(const DiffractionExperiment &in_experiment)
: experiment(in_experiment) {
MXAnalysisAfterFPGA::MXAnalysisAfterFPGA(const DiffractionExperiment &in_experiment, IndexAndRefine &indexer)
: experiment(in_experiment), indexer(indexer) {
if (experiment.IsSpotFindingEnabled())
find_spots = true;
prediction = CreateBraggPrediction();
}
MXAnalysisAfterFPGA &MXAnalysisAfterFPGA::SetIndexer(IndexerThreadPool *input) {
indexer = input;
return *this;
}
void MXAnalysisAfterFPGA::ReadFromFPGA(const DeviceOutput *output, const SpotFindingSettings &settings, size_t module_number) {
if (!find_spots || !settings.enable)
return;
@@ -93,7 +88,10 @@ void MXAnalysisAfterFPGA::Process(DataMessage &message, const SpotFindingSetting
if (!find_spots)
return;
SpotAnalyze(experiment, spot_finding_settings, spots, message.image, *prediction, indexer, message);
SpotAnalyze(experiment, spot_finding_settings, spots, message);
if (spot_finding_settings.indexing)
indexer.ProcessImage(message, spot_finding_settings, message.image, *prediction);
spots.clear();
}