Isis 3.0 Object Programmers' Reference
Home
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
StandardDeviationOperator.cpp
1
#include "
StandardDeviationOperator.h
"
2
#include "
Chip.h
"
3
#include "
Statistics.h
"
4
5
namespace
Isis {
13
double
StandardDeviationOperator::Interest
(
Chip
&chip) {
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