ImageSpotFinder: Getting ready for abstract class for both CPU and GPU spot finders

This commit is contained in:
2025-10-04 22:25:55 +02:00
parent 1dff8301ff
commit 1a2c234525
9 changed files with 75 additions and 38 deletions
+5 -3
View File
@@ -14,7 +14,6 @@ MXAnalysisWithoutFPGA::MXAnalysisWithoutFPGA(const DiffractionExperiment &in_exp
IndexerThreadPool *in_indexer)
: experiment(in_experiment),
integration(in_integration),
updated_image(experiment.GetPixelsNum()),
roi_count(0),
npixels(experiment.GetPixelsNum()),
xpixels(experiment.GetXPixelsNum()),
@@ -35,6 +34,7 @@ MXAnalysisWithoutFPGA::MXAnalysisWithoutFPGA(const DiffractionExperiment &in_exp
mask_1bit[i] = (in_mask.GetMask().at(i) != 0);
spotFinder = std::make_unique<ImageSpotFinderCPU>(experiment.GetXPixelsNum(), experiment.GetYPixelsNum());
updated_image = spotFinder->GetHostBuffer();
}
void MXAnalysisWithoutFPGA::Analyze(DataMessage &output, std::vector<uint8_t> &image, AzimuthalIntegrationProfile &profile,
@@ -159,10 +159,12 @@ void MXAnalysisWithoutFPGA::Analyze(DataMessage &output,
|| mask_low_res != settings.low_resolution_limit)
UpdateMaskResolution(settings);
const std::vector<DiffractionSpot> spots = spotFinder->Run(updated_image.data(), settings, mask_resolution);
const std::vector<DiffractionSpot> spots = spotFinder->Run(settings, mask_resolution);
SpotAnalyze(experiment, settings, spots,
CompressedImage(updated_image, experiment.GetXPixelsNum(), experiment.GetYPixelsNum()),
CompressedImage(updated_image, sizeof(int32_t) * experiment.GetPixelsNum(),
experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
CompressedImageMode::Int32),
indexer, output);
}