-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDefectMaskingEER.h
68 lines (43 loc) · 1.61 KB
/
DefectMaskingEER.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Copyright (C) 2019 Thermo Fisher Scientific. Do not distribute.
*/
#pragma once
#include <vector>
#include <unordered_map>
#include <random>
#include "ElectronCountedFramesDecompressor.h"
#include "GainDefectCorrect.h"
typedef uint8_t defectNeighborInfo_t;
struct DefectNeighborSpec
{
defectNeighborInfo_t defectInfo;
float gainCoefficient;
DefectNeighborSpec() {}
DefectNeighborSpec(defectNeighborInfo_t t, float g): defectInfo(t), gainCoefficient(g) {}
};
struct CameraDefectNeighborInformation
{
std::vector<defectNeighborInfo_t> neighborSpec;
const float* gainImage; // not data owner, so be careful not to free the gainImage array too early.
CameraDefectNeighborInformation(): neighborSpec(4096*4096,0) {}
};
void CreateDefectNeighborInfoMap(const CameraDefects& def, const float* gainImage, CameraDefectNeighborInformation& camDefectNeighborInfo);
struct DefectElectronAdder
{
DefectElectronAdder();
unsigned execute(ElectronPos* pListPtr, unsigned nElect, const CameraDefectNeighborInformation& camDefectNeighborInfo);
private:
std::default_random_engine generator;
std::uniform_real_distribution<float> distHit;
std::uniform_int_distribution<uint16_t> distSubPix;
std::unordered_map<uint32_t, float> defectCounts;
};
// FOR SUPERRESOLUTION TESTING PURPOSES
struct SubpixelPositionRandomizer
{
SubpixelPositionRandomizer();
void execute(ElectronPos* pListPtr, unsigned nElec);
private:
std::default_random_engine generator;
std::uniform_int_distribution<uint16_t> distSubPix;
};