diff --git a/image_analysis/IndexAndRefine.cpp b/image_analysis/IndexAndRefine.cpp index 378a6079..4cb80433 100644 --- a/image_analysis/IndexAndRefine.cpp +++ b/image_analysis/IndexAndRefine.cpp @@ -26,7 +26,11 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data if (rotation_indexer) { auto result = rotation_indexer->ProcessImage(msg.number, msg.spots); if (result) { - outcome.lattice_candidate = result->lattice; + + // get rotated lattice + auto gon = experiment.GetGoniometer(); + if (gon) + outcome.lattice_candidate = result->lattice.Multiply(gon->GetTransformation(-msg.number)); outcome.experiment.BeamX_pxl(result->geom.GetBeamX_pxl()) .BeamY_pxl(result->geom.GetBeamY_pxl()) @@ -132,10 +136,6 @@ void IndexAndRefine::QuickPredictAndIntegrate(DataMessage &msg, CrystalLattice latt = outcome.lattice_candidate.value(); if (rotation_indexer) { - // Rotate lattice_candidate to the current image angle - auto gon = experiment.GetGoniometer(); - if (gon) - latt = outcome.lattice_candidate->Multiply(gon->GetTransformation(-msg.number)); // Use moving average for mosaicity and profile_radius (also add beam center later) if (msg.mosaicity_deg) msg.mosaicity_deg = rotation_parameters.Mosaicity(msg.mosaicity_deg.value()); @@ -201,8 +201,7 @@ void IndexAndRefine::ProcessImage(DataMessage &msg, if (!outcome.lattice_candidate) return; - if (!AnalyzeIndexing(msg, outcome.experiment, *outcome.lattice_candidate, - outcome.experiment.GetGoniometer(), rotation_indexer.get() != nullptr)) + if (!AnalyzeIndexing(msg, outcome.experiment, *outcome.lattice_candidate)) return; msg.lattice_type = outcome.symmetry; diff --git a/image_analysis/RotationIndexer.cpp b/image_analysis/RotationIndexer.cpp index 90177995..ba0ad0a6 100644 --- a/image_analysis/RotationIndexer.cpp +++ b/image_analysis/RotationIndexer.cpp @@ -133,7 +133,6 @@ std::optional RotationIndexer::ProcessImage(int64_t image .search_result = search_result_, .geom = updated_geom_ }; - return GetLattice(); } std::optional RotationIndexer::GetLattice() { diff --git a/image_analysis/indexing/AnalyzeIndexing.cpp b/image_analysis/indexing/AnalyzeIndexing.cpp index 2937dcad..3fa42078 100644 --- a/image_analysis/indexing/AnalyzeIndexing.cpp +++ b/image_analysis/indexing/AnalyzeIndexing.cpp @@ -165,9 +165,7 @@ namespace { bool AnalyzeIndexing(DataMessage &message, const DiffractionExperiment &experiment, - const CrystalLattice &latt, - const std::optional &rotation_axis, - bool rotation_indexed) { + const CrystalLattice &latt) { std::vector indexed_spots(message.spots.size()); // Check spots @@ -218,9 +216,7 @@ bool AnalyzeIndexing(DataMessage &message, nspots_ref++; } - if (rotation_indexed - || (nspots_indexed >= viable_cell_min_spots - && nspots_indexed >= std::lround(min_percentage_spots * nspots_ref))) { + if (nspots_indexed >= viable_cell_min_spots && nspots_indexed >= std::lround(min_percentage_spots * nspots_ref)) { auto uc = latt.GetUnitCell(); if (!ok(uc.a) || !ok(uc.b) || !ok(uc.c) || !ok(uc.alpha) || !ok(uc.beta) || !ok(uc.gamma)) return false; diff --git a/image_analysis/indexing/AnalyzeIndexing.h b/image_analysis/indexing/AnalyzeIndexing.h index deb2b335..0644bb6b 100644 --- a/image_analysis/indexing/AnalyzeIndexing.h +++ b/image_analysis/indexing/AnalyzeIndexing.h @@ -12,9 +12,7 @@ constexpr static float min_percentage_spots = 0.20f; bool AnalyzeIndexing(DataMessage &message, const DiffractionExperiment &experiment, - const CrystalLattice &latt, - const std::optional &rotation_axis, - bool rotation_indexed); + const CrystalLattice &latt); #endif //JFJOCH_ANALYZEINDEXING_H \ No newline at end of file