31 Centroid::~Centroid(){};
44 int Centroid::select(
Chip *inputChip,
Chip *selectionChip) {
46 int lines, samples,line,sample;
52 lines = inputChip->
Lines();
55 if (lines <= 0 || samples <= 0)
58 selectionChip->
SetSize(samples,lines);
67 std::vector < std::vector<int> > Q;
68 std::vector <int> pt(2);
70 dn = inputChip->
GetValue(sample,line);
71 if (dn < m_minDN || dn > m_maxDN) {
81 for (i=0;i<Q.size();i++) {
82 dn = inputChip->
GetValue(Q[i][0], Q[i][1]);
85 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(Q[i][0], Q[i][1]) == 0.0) {
87 selectionChip->
SetValue(sample, line, 1.0);
89 if (sample < samples) {
90 dn = inputChip->
GetValue(sample + 1, line);
92 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample+1, line) == 0.0) {
99 dn = inputChip->
GetValue(sample-1, line);
101 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample-1, line) == 0.0) {
108 dn = inputChip->
GetValue(sample, line +1);
110 if( dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample, line+1) == 0.0 ) {
117 dn = inputChip->
GetValue(sample, line-1);
119 if( dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample, line-1) == 0.0 ) {
140 int Centroid::setDNRange(
double minimumDN,
double maximumDN ) {
142 if (maximumDN < minimumDN)
153 double Centroid::getMinDN() {
161 double Centroid::getMaxDN() {
A small chip of data used for pattern matching.
Namespace for the standard library.
void SetAllValues(const double &d)
Single value assignment operator.
void SetSize(const int samples, const int lines)
Change the size of the Chip.
void SetValue(int sample, int line, const double &value)
Sets a value in the chip.
Namespace for ISIS/Bullet specific routines.
double ChipSample() const
double GetValue(int sample, int line)
Loads a Chip with a value.