Files
Jungfraujoch/image_analysis/indexing/MultiLatticeSearch.h
T

25 lines
1.3 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <vector>
#include "../common/CrystalLattice.h"
#include "../common/Coord.h"
#include "../lattice_search/LatticeSearch.h"
struct MultiLatticeSearchResult {
CrystalLattice input_lattice; // lattice as it came in (kept for debugging only)
CrystalLattice output_lattice; // R * reference - a proper rotation of the first lattice
Coord rotation_vector; // Rodrigues vector: axis * angle, magnitude == angle [rad]
};
// Input: lattices assumed to describe the same crystal (same unit cell), differing
// only by orientation, and describing non-overlapping sets of spots.
// The first lattice is the reference. A subsequent lattice is kept only if its unit
// cell matches the reference (within tolerances); for each kept lattice we find the
// proper rotation R mapping reference -> lattice and store output_lattice = R * reference.
std::vector<MultiLatticeSearchResult> MultiLatticeSearch(const std::vector<CrystalLattice> &lattices,
float dist_tolerance = 0.03f,
float angle_tolerance_deg = 3.0f);