Files
Jungfraujoch/image_analysis/IndexerWrapper.h

47 lines
1.2 KiB
C++

// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef JUNGFRAUJOCH_INDEXERWRAPPER_H
#define JUNGFRAUJOCH_INDEXERWRAPPER_H
#include <vector>
#include "../common/Coord.h"
#include "CrystalLattice.h"
#ifdef JFJOCH_USE_CUDA
#include <ffbidx/refine.h>
#endif
#define MIN_SPOTS_TO_INDEX (10)
#define MAX_SPOTS_TO_INDEX (100)
struct IndexingResult {
CrystalLattice l;
std::vector<bool> indexed_spots;
uint64_t indexed_spots_count;
};
class IndexerWrapper {
#ifdef JFJOCH_USE_CUDA
fast_feedback::config_runtime<float> crt{
.num_sample_points = 32768
};
fast_feedback::config_persistent<float> cpers{
.max_output_cells = 4,
.max_input_cells = 1,
.max_spots = MAX_SPOTS_TO_INDEX
}; // default persistent config
fast_feedback::refine::config_ifss<float> conf_ifss{};
fast_feedback::refine::indexer_ifss<float> indexer{cpers, crt, conf_ifss};
#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);
};
#endif //JUNGFRAUJOCH_INDEXERWRAPPER_H