13#include "fitsviewer/fitsdata.h"
19 explicit BadPixel(uint16_t _x, uint16_t _y,
double _value) : x(_x), y(_y), value(_value) {}
20 bool operator<(
const BadPixel &rhs)
const
22 return value < rhs.value;
29typedef std::multiset<BadPixel> BadPixelSet;
36 Q_PROPERTY(
int HotPixelAggressiveness MEMBER m_HotPixelsAggressiveness)
38 Q_PROPERTY(
int ColdPixelAggressiveness MEMBER m_ColdPixelsAggressiveness)
40 Q_PROPERTY(
bool HotEnabled READ hotEnabled WRITE setHotEnabled)
42 Q_PROPERTY(
bool ColdEnabled READ coldEnabled WRITE setColdEnabled)
47 void setHotEnabled(
bool enabled);
48 void setColdEnabled(
bool enabled);
50 bool load(
const QString &filename);
54 const BadPixelSet &hotPixels()
const
58 const BadPixelSet &coldPixels()
const
63 bool hotEnabled()
const
67 bool coldEnabled()
const
76 const BadPixelSet::const_iterator hotThreshold()
const
78 return (m_HotEnabled ? m_HotPixelsThreshold : m_HotPixels.end());
80 const BadPixelSet::const_iterator coldThreshold()
const
82 return (m_ColdEnabled ? m_ColdPixelsThreshold : m_ColdPixels.begin());
84 uint32_t hotCount()
const
86 return m_HotPixelsCount;
88 uint32_t coldCount()
const
90 return m_ColdPixelsCount;
97 void pixelsUpdated(uint32_t hotPixelsCount, uint32_t coldPixelsCount);
100 double getHotThreshold(uint8_t aggressiveness);
101 double getColdThreshold(uint8_t aggressiveness);
102 double calculateSigma(uint8_t aggressiveness);
103 template <
typename T>
104 void initBadPixelsInternal(
double hotPixelThreshold,
double coldPixelThreshold);
106 BadPixelSet m_ColdPixels, m_HotPixels;
107 BadPixelSet::const_iterator m_ColdPixelsThreshold, m_HotPixelsThreshold;
108 uint8_t m_HotPixelsAggressiveness {75}, m_ColdPixelsAggressiveness {75};
109 uint32_t m_HotPixelsCount {0}, m_ColdPixelsCount {0};
110 double m_HotSigma {0}, m_ColdSigma {0};
111 double m_Median {0}, m_StandardDeviation {0};
112 bool m_HotEnabled {
true}, m_ColdEnabled {
true};