USGS

Isis 3.0 Object Programmers' Reference

Home

StandardDeviationOperator.cpp
2 #include "Chip.h"
3 #include "Statistics.h"
4 
5 namespace Isis {
14  Statistics stats;
15  stats.SetValidRange(mdMinDN, mdMaxDN);
16  for(int i = 0; i < chip.Samples(); i++) {
17  double pixels[chip.Lines()];
18  int n = 0;
19  for(int j = 0; j < chip.Lines(); j++) {
20  if(!IsSpecial(chip.GetValue(i + 1, j + 1))) {
21  pixels[n] = chip.GetValue(i + 1, j + 1);
22  n++;
23  }
24  }
25  stats.AddData(pixels, n);
26  }
27 
28  return stats.StandardDeviation();
29  }
30 }
31 
32 extern "C" Isis::InterestOperator *StandardDeviationOperatorPlugin(Isis::Pvl &pPvl) {
33  return new Isis::StandardDeviationOperator(pPvl);
34 }
35