Isis 3 Programmer Reference
StandardDeviationOperator.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "StandardDeviationOperator.h"
8 #include "Chip.h"
9 #include "Statistics.h"
10 
11 namespace Isis {
20  Statistics stats;
21  stats.SetValidRange(mdMinDN, mdMaxDN);
22  for(int i = 0; i < chip.Samples(); i++) {
23  double pixels[chip.Lines()];
24  int n = 0;
25  for(int j = 0; j < chip.Lines(); j++) {
26  if(!IsSpecial(chip.GetValue(i + 1, j + 1))) {
27  pixels[n] = chip.GetValue(i + 1, j + 1);
28  n++;
29  }
30  }
31  stats.AddData(pixels, n);
32  }
33 
34  return stats.StandardDeviation();
35  }
36 }
37 
38 extern "C" Isis::InterestOperator *StandardDeviationOperatorPlugin(Isis::Pvl &pPvl) {
39  return new Isis::StandardDeviationOperator(pPvl);
40 }
41 
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::ControlNetValidMeasure::mdMaxDN
double mdMaxDN
Standard Option MaxDN.
Definition: ControlNetValidMeasure.h:255
Isis::Chip::GetValue
double GetValue(int sample, int line)
Loads a Chip with a value.
Definition: Chip.h:145
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::Chip::Lines
int Lines() const
Definition: Chip.h:106
Isis::Statistics::StandardDeviation
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:312
Isis::StandardDeviationOperator::Interest
virtual double Interest(Chip &chip)
This method returns the amount of interest for the given chip.
Definition: StandardDeviationOperator.cpp:19
Isis::StandardDeviationOperator
Standard deviation interest operator.
Definition: StandardDeviationOperator.h:37
Isis::ControlNetValidMeasure::mdMinDN
double mdMinDN
Standard Option MinDN.
Definition: ControlNetValidMeasure.h:254
Isis::Chip
A small chip of data used for pattern matching.
Definition: Chip.h:86
Isis::Chip::Samples
int Samples() const
Definition: Chip.h:99
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::InterestOperator
Interest Operator class.
Definition: InterestOperator.h:109