diff --git a/viewer/JFJochImageReadingWorker.cpp b/viewer/JFJochImageReadingWorker.cpp index 55661f511..a6ae492b0 100644 --- a/viewer/JFJochImageReadingWorker.cpp +++ b/viewer/JFJochImageReadingWorker.cpp @@ -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(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(curr_experiment, indexing.get(), /*retain_outcomes=*/false); - image_analysis = std::make_unique(curr_experiment, *azint_mapping, *dataset->pixel_mask, + index_and_refine = std::make_unique(analysis_experiment, indexing.get(), /*retain_outcomes=*/false); + image_analysis = std::make_unique(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(); diff --git a/viewer/JFJochImageReadingWorker.h b/viewer/JFJochImageReadingWorker.h index b2692bf2f..e0a76c053 100644 --- a/viewer/JFJochImageReadingWorker.h +++ b/viewer/JFJochImageReadingWorker.h @@ -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 roi_override_; @@ -211,6 +215,7 @@ private: void ReanalyzeImage_i(); void UpdateDataset_i(const std::optional& experiment); void UpdateAzint_i(const JFJochReaderDataset *dataset); + void UpdateAnalysisExperiment_i(); void UpdateUserMask_i(const std::vector &mask); void SetROIDefinition_i(const ROIDefinition &rois); void ApplyROIOverrideToImage_i(); // rewrite current_image_ptr's dataset with roi_override_