viewer: index rotation frames one by one in interactive analysis

The interactive analysers now read a member copy of the worker's experiment
with rotation indexing off, so a rotation frame is indexed and predicted on
its own, like a still. They used to wait for the online rotation-indexer
counter, which is about to go; the rotation indexer itself needs the whole
sweep, which only a processing job reads, and those keep the flag. The copy
is refreshed wherever the analysers used to see curr_experiment change in
place (load, indexing settings, ROIs) and outlives the analysers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-08 08:42:43 +01:00
1 parent 5d24eac3ce
commit ed86b9b29e
2 files changed
+17 -2

No files matched your search

+12 -2
View File
@@ -452,13 +452,21 @@ void JFJochImageReadingWorker::LoadImage(int64_t image_number, int64_t summation
LoadImage_i(image_number, summation);
}
void JFJochImageReadingWorker::UpdateAnalysisExperiment_i() {
analysis_experiment = curr_experiment;
auto settings = analysis_experiment.GetIndexingSettings();
settings.RotationIndexing(false);
analysis_experiment.ImportIndexingSettings(settings);
}
void JFJochImageReadingWorker::UpdateAzint_i(const JFJochReaderDataset *dataset) {
if (dataset) {
UpdateAnalysisExperiment_i();
azint_mapping = std::make_unique<AzimuthalIntegrationMapping>(curr_experiment, *dataset->pixel_mask);
// Interactive/live analysis only needs the current image's result (returned per image); it
// never scales the accumulated run, so don't retain the whole-run integration_outcome vector.
index_and_refine = std::make_unique<IndexAndRefine>(curr_experiment, indexing.get(), /*retain_outcomes=*/false);
image_analysis = std::make_unique<MXAnalysisWithoutFPGA>(curr_experiment, *azint_mapping, *dataset->pixel_mask,
index_and_refine = std::make_unique<IndexAndRefine>(analysis_experiment, indexing.get(), /*retain_outcomes=*/false);
image_analysis = std::make_unique<MXAnalysisWithoutFPGA>(analysis_experiment, *azint_mapping, *dataset->pixel_mask,
*index_and_refine.get(), /*enable_fused_adaptive_gpu=*/true);
last_profile_.reset();
@@ -694,6 +702,7 @@ void JFJochImageReadingWorker::UpdateSpotFindingSettings(const SpotFindingSettin
logger.ErrorException(e);
return;
}
UpdateAnalysisExperiment_i();
if (auto_reanalyze) {
ReanalyzeImage_i();
@@ -876,6 +885,7 @@ void JFJochImageReadingWorker::SetROIDefinition_i(const ROIDefinition &rois) {
// edited ROIs override whatever the file carried.
roi_override_ = rois;
curr_experiment.ROI().SetROI(rois);
UpdateAnalysisExperiment_i();
if (image_analysis)
image_analysis->RebuildROI();
+5
View File
@@ -116,6 +116,10 @@ private:
QString current_file;
DiffractionExperiment curr_experiment;
// What the interactive analysers below read (they hold a reference to it): curr_experiment with
// rotation indexing off, so every frame is indexed on its own, rotation or not. The rotation
// indexer wants the whole sweep, which only a processing job reads (from curr_experiment).
DiffractionExperiment analysis_experiment;
// Once the user edits ROIs they override whatever the file carried, for this and
// every subsequently loaded image, until a new file is opened.
std::optional<ROIDefinition> roi_override_;
@@ -211,6 +215,7 @@ private:
void ReanalyzeImage_i();
void UpdateDataset_i(const std::optional<DiffractionExperiment>& experiment);
void UpdateAzint_i(const JFJochReaderDataset *dataset);
void UpdateAnalysisExperiment_i();
void UpdateUserMask_i(const std::vector<uint32_t> &mask);
void SetROIDefinition_i(const ROIDefinition &rois);
void ApplyROIOverrideToImage_i(); // rewrite current_image_ptr's dataset with roi_override_