Files
Jungfraujoch/image_analysis/IndexerWrapper.h

44 lines
1.1 KiB
C++

// Copyright (2019-2024) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_INDEXERWRAPPER_H
#define JUNGFRAUJOCH_INDEXERWRAPPER_H
#include <vector>
#include "../common/Coord.h"
#include "CrystalLattice.h"
#include "../common/Definitions.h"
#ifdef JFJOCH_USE_CUDA
#include <ffbidx/refine.h>
#endif
struct IndexingResult {
CrystalLattice l;
std::vector<Coord> predicted_spots;
};
class IndexerWrapper {
#ifdef JFJOCH_USE_CUDA
fast_feedback::config_runtime<float> crt{};
fast_feedback::config_persistent<float> cpers{
.max_output_cells = 32,
.max_input_cells = 1,
.max_spots = MAX_SPOT_COUNT,
.num_candidate_vectors = 32,
.redundant_computations = true,
}; // default persistent config
fast_feedback::refine::config_ifssr<float> cifssr{
.min_spots = 6u
};
fast_feedback::refine::indexer<float> indexer{cpers, crt};
#endif
constexpr const static uint32_t viable_cell_min_spots = 9;
public:
void Setup(const UnitCell &cell);
std::vector<IndexingResult> Run(const std::vector<Coord> &coord, float indexing_threshold);
};
#endif //JUNGFRAUJOCH_INDEXERWRAPPER_H