Files
Jungfraujoch/image_analysis/IndexerWrapper.h
2024-04-20 13:41:41 +02:00

40 lines
1.0 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 = 16,
.max_input_cells = 1,
.max_spots = MAX_SPOT_COUNT
}; // default persistent config
fast_feedback::refine::indexer<float> indexer{cpers, crt};
#endif
constexpr const static uint64_t min_spots = 9;
constexpr const static float threshold = 0.05f;
public:
void Setup(const UnitCell &cell);
std::vector<IndexingResult> Run(const std::vector<Coord> &coord, float indexing_threshold);
};
#endif //JUNGFRAUJOCH_INDEXERWRAPPER_H