PinkIndexer.h 2.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once


#include "Backprojection.h"
#include "ExperimentSettings.h"
#include "Lattice.h"
#include "Refinement.h"
#include "SimpleDiffractionPatternPrediction.h"
#include "SimpleProjection.h"
#include "Sinogram.h"
#include <Eigen/Dense>
#include <stdint.h>


class PinkIndexer
{
  public:
    enum class ConsideredPeaksCount
    {
        veryFew,
        few,
        standard,
        many,
        manyMany
    };

    enum class AngleResolution
    {
        extremelyLoose,
        loose,
        standard,
        dense,
        extremelyDense
    };

    enum class RefinementType
    {
        none,
        fixedLatticeParameters,
        variableLatticeParameters,
Yaroslav Gevorkov's avatar
Yaroslav Gevorkov committed
41
42
        firstFixedThenVariableLatticeParameters,
        firstFixedThenVariableLatticeParametersMultiSeed
43
44
45
    };

    PinkIndexer(const ExperimentSettings& experimentSettings, ConsideredPeaksCount consideredPeaksCount, AngleResolution angleResolution,
46
                RefinementType refinementType, float maxResolutionForIndexing_1_per_A);
47

48
49
50
51
    int indexPattern(Lattice& indexedLattice, Eigen::Array<bool, Eigen::Dynamic, 1>& fittedPeaks, Eigen::RowVectorXf& intensities,
                     const Eigen::Matrix2Xf& detectorPeaks_m, int threadCount);
    int indexPattern(Lattice& indexedLattice, Eigen::Array<bool, Eigen::Dynamic, 1>& fittedPeaks, Eigen::RowVectorXf& intensities,
                     const Eigen::Matrix3Xf& meanReciprocalPeaks_1_per_A, int threadCount);
52
53

  private:
Yaroslav Gevorkov's avatar
Yaroslav Gevorkov committed
54
    void reducePeakCount(Eigen::Matrix3Xf& ucsDirections, Eigen::Array2Xf& ucsBorderNorms, Eigen::RowVectorXf& intensities,
55
                         const Eigen::Matrix2Xf& detectorPeaks_m);
56
    void refine(Lattice& indexedLattice, const Eigen::Matrix3Xf& ucsDirections, const Eigen::Array2Xf& ucsBorderNorms);
57
58
59
60
61
62
63
64
65
66
67
68
69

    float getAngleResolution();
    int getConsideredPeaksCount();

    SimpleProjection reciprocalToRealProjection;
    Backprojection backprojection;
    Sinogram sinogram;
    Refinement refinement;
    Lattice sampleLattice;

    ConsideredPeaksCount consideredPeaksCount;
    AngleResolution angleResolution;
    RefinementType refinementType;
70
    float maxResolutionForIndexing_1_per_A;
71
    float finalRefinementTolerance;
72
};