Files
Jungfraujoch/image_analysis/indexing/FFBIDXIndexer.cpp
T
leonarski_fandClaude Opus 5 6081b6bc43 docs: credit the L test, FFT indexing, TORO, Niggli, peakfinder8 and SparseCCL
Six methods the pages name or describe carried no citation: Padilla & Yeates
(the L test), Steller, Bolotovsky & Rossmann (the projection/FFT autoindexing
MOSFLM implements), TORO (what ffbidx implements), Krivy & Gruber and the
ITA lattice-character table (the reduction and Bravais assignment), Cheetah's
peakfinder8 (the per-ring background statistics of the adaptive finder) and
Hennequin et al.'s SparseCCL (already credited to traccc, now also to its
authors). Each gets its ACKNOWLEDGEMENT.md paragraph, a References entry in
CPU_DATA_ANALYSIS.md, and a one-line credit at the algorithm. The
Sheriff & Hendrickson / Popov & Bourenkov entry is re-scoped so each claim
sits on the paper that supports it - P&B 2003 is titled, and credited for the
sigma-aware anisotropy estimation its statistic modelling contains, not for
the tensor and its constraints. All DOIs verified against the publishers;
the SparseCCL DOI resolves to IEEE document 9049184 (IEEE blocks content
scraping, so verified by the resolved document id plus two independent
sources).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
2026-09-02 09:18:36 +02:00

58 lines
1.8 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include "FFBIDXIndexer.h"
#include "PostIndexingRefinement.h"
// The ffbidx library implements the TORO algorithm:
// Gasparotto et al. (2024) J. Appl. Cryst. 57, 931-944
void FFBIDXIndexer::SetupUnitCell(const std::optional<UnitCell> &cell) {
if (!cell.has_value())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"FFBIDX requires unit cell");
reference_unit_cell = cell;
CrystalLattice l1(cell.value());
Eigen::Matrix3f m;
indexer.iCellM() << l1.Vec0().x, l1.Vec0().y, l1.Vec0().z,
l1.Vec1().x, l1.Vec1().y, l1.Vec1().z,
l1.Vec2().x, l1.Vec2().y, l1.Vec2().z;
}
std::vector<CrystalLattice> FFBIDXIndexer::RunInternal(const std::vector<Coord> &coord, size_t nspots) {
std::vector<CrystalLattice> ret;
if (nspots > coord.size())
nspots = coord.size();
if (nspots < viable_cell_min_spots)
return ret;
assert(nspots <= MAX_SPOT_COUNT);
assert(coord.size() <= MAX_SPOT_COUNT);
for (int i = 0; i < coord.size(); i++) {
indexer.spotX(i) = coord[i].x;
indexer.spotY(i) = coord[i].y;
indexer.spotZ(i) = coord[i].z;
}
// Index
indexer.index(1, nspots);
RefineParameters parameters{
.viable_cell_min_spots = viable_cell_min_spots,
.dist_tolerance_vs_reference = dist_tolerance_vs_reference,
.reference_unit_cell = reference_unit_cell,
.min_length_A = 1, // doesn't matter
.max_length_A = 1000, // doesn't matter
.min_angle_deg = 30,
.max_angle_deg = 150,
.indexing_tolerance = indexing_tolerance
};
return Refine(coord, nspots, indexer.oCellM(), indexer.oScoreV(), parameters);
}