79 AutoReg::AutoReg(
Pvl &pvl) {
80 p_template = pvl.
findObject(
"AutoRegistration");
83 p_patternChip.SetSize(3, 3);
84 p_searchChip.SetSize(5, 5);
85 p_fitChip.SetSize(5, 5);
86 p_reducedPatternChip.SetSize(3, 3);
87 p_reducedSearchChip.SetSize(5, 5);
88 p_reducedFitChip.SetSize(5, 5);
89 p_gradientFilterType = None;
91 SetPatternValidPercent(50.0);
92 SetSubsearchValidPercent(50.0);
93 SetPatternZScoreMinimum(1.0);
96 SetSubPixelAccuracy(
true);
97 SetSurfaceModelDistanceTolerance(1.5);
98 SetSurfaceModelWindowSize(5);
100 SetReductionFactor(1);
104 p_totalRegistrations = 0;
105 p_pixelSuccesses = 0;
106 p_subpixelSuccesses = 0;
107 p_patternChipNotEnoughValidDataCount = 0;
108 p_patternZScoreNotMetCount = 0;
109 p_fitChipNoDataCount = 0;
110 p_fitChipToleranceNotMetCount = 0;
111 p_surfaceModelNotEnoughValidDataCount = 0;
112 p_surfaceModelSolutionInvalidCount = 0;
113 p_surfaceModelDistanceInvalidCount = 0;
127 void AutoReg::Init() {
141 for(
int line = 1; line <= p_fitChip.Lines(); line++) {
142 for(
int samp = 1; samp <= p_fitChip.Samples(); samp++) {
149 for(
int line = 1; line <= p_reducedPatternChip.Lines(); line++) {
150 for(
int samp = 1; samp <= p_reducedPatternChip.Samples(); samp++) {
151 p_reducedPatternChip.SetValue(samp, line,
Isis::Null);
157 for(
int line = 1; line <= p_reducedSearchChip.Lines(); line++) {
158 for(
int samp = 1; samp <= p_reducedSearchChip.Samples(); samp++) {
159 p_reducedSearchChip.SetValue(samp, line,
Isis::Null);
166 AutoReg::~AutoReg() {
207 void AutoReg::Parse(
Pvl &pvl) {
211 SetTolerance(algo[
"Tolerance"]);
213 SetChipInterpolator((QString)algo[
"ChipInterpolator"]);
217 SetSubPixelAccuracy((QString)algo[
"SubpixelAccuracy"] ==
"True");
221 SetReductionFactor((
int)algo[
"ReductionFactor"]);
225 SetGradientFilterType((QString)algo[
"Gradient"]);
230 PatternChip()->SetSize((
int)pchip[
"Samples"], (
int)pchip[
"Lines"]);
234 if(pchip.hasKeyword(
"ValidMinimum")) minimum = pchip[
"ValidMinimum"];
235 if(pchip.hasKeyword(
"ValidMaximum")) maximum = pchip[
"ValidMaximum"];
236 PatternChip()->SetValidRange(minimum, maximum);
238 if(pchip.hasKeyword(
"MinimumZScore")) {
239 SetPatternZScoreMinimum((
double)pchip[
"MinimumZScore"]);
241 if(pchip.hasKeyword(
"ValidPercent")) {
242 SetPatternValidPercent((
double)pchip[
"ValidPercent"]);
247 SearchChip()->SetSize((
int)schip[
"Samples"], (
int)schip[
"Lines"]);
251 if(schip.hasKeyword(
"ValidMinimum")) minimum = schip[
"ValidMinimum"];
252 if(schip.hasKeyword(
"ValidMaximum")) maximum = schip[
"ValidMaximum"];
253 SearchChip()->SetValidRange(minimum, maximum);
254 if(schip.hasKeyword(
"SubchipValidPercent")) {
255 SetSubsearchValidPercent((
double)schip[
"SubchipValidPercent"]);
263 SetSurfaceModelDistanceTolerance((
double)smodel[
"DistanceTolerance"]);
267 SetSurfaceModelWindowSize((
int)smodel[
"WindowSize"]);
273 QString msg =
"Improper format for AutoReg PVL [" + pvl.
fileName() +
"]";
286 void AutoReg::SetGradientFilterType(
const QString &gradientFilterType) {
287 if (gradientFilterType ==
"None") {
288 p_gradientFilterType = None;
290 else if (gradientFilterType ==
"Sobel") {
291 p_gradientFilterType = Sobel;
295 "Invalid Gradient type. Cannot use [" 296 + gradientFilterType +
"] to filter chip",
302 QString AutoReg::GradientFilterString()
const {
303 switch (p_gradientFilterType) {
304 case None:
return "None";
305 case Sobel:
return "Sobel";
307 IException::Programmer,
308 "AutoReg only allows Sobel gradient filter or None",
325 void AutoReg::SetSubPixelAccuracy(
bool on) {
326 p_subpixelAccuracy = on;
352 void AutoReg::SetPatternValidPercent(
const double percent) {
353 if((percent <= 0.0) || (percent > 100.0)) {
354 string msg =
"Invalid value for PatternChip ValidPercent [" 356 +
"]. Must be greater than 0.0 and less than or equal to 100.0 (Default is 50.0).";
359 p_patternValidPercent = percent;
380 void AutoReg::SetSubsearchValidPercent(
const double percent) {
381 if((percent <= 0.0) || (percent > 100.0)) {
382 string msg =
"Invalid value for SearchChip SubchipValidPercent [" 384 +
"]. Must be greater than 0.0 and less than or equal to 100.0 (Default is 50.0).";
387 p_subsearchValidPercent = percent;
407 void AutoReg::SetPatternZScoreMinimum(
double minimum) {
409 string msg =
"Invalid value for PatternChip MinimumZScore [" 411 +
"]. Must be greater than 0.0. (Default is 1.0).";
414 p_minimumPatternZScore = minimum;
429 void AutoReg::SetTolerance(
const double tolerance) {
430 p_tolerance = tolerance;
453 void AutoReg::SetChipInterpolator(
const QString &interpolator) {
456 if(interpolator ==
"NearestNeighborType") {
457 itype = Isis::Interpolator::NearestNeighborType;
459 else if(interpolator ==
"BiLinearType") {
460 itype = Isis::Interpolator::BiLinearType;
462 else if(interpolator ==
"CubicConvolutionType") {
463 itype = Isis::Interpolator::CubicConvolutionType;
467 "Invalid Interpolator type. Cannot use [" 468 + interpolator +
"] to load chip",
473 p_patternChip.SetReadInterpolator(itype);
474 p_searchChip.SetReadInterpolator(itype);
475 p_reducedPatternChip.SetReadInterpolator(itype);
476 p_reducedSearchChip.SetReadInterpolator(itype);
493 void AutoReg::SetSurfaceModelWindowSize(
int size) {
494 if(size % 2 != 1 || size < 3) {
495 string msg =
"Invalid value for SurfaceModel WindowSize [" 496 +
IString(size) +
"]. Must be an odd number greater than or equal to 3";
514 void AutoReg::SetSurfaceModelDistanceTolerance(
double distance) {
515 if(distance <= 0.0) {
516 string msg =
"Invalid value for SurfaceModel DistanceTolerance [" 517 +
IString(distance) +
"]. Must greater than 0.0.";
520 p_distanceTolerance = distance;
534 void AutoReg::SetReductionFactor(
int factor) {
536 string msg =
"Invalid value for Algorithm ReductionFactor [" 537 +
IString(factor) +
"]. Must greater than or equal to 1.";
540 p_reduceFactor = factor;
552 Chip AutoReg::Reduce(
Chip &chip,
int reductionFactor) {
554 (int)chip.
Lines() / reductionFactor);
555 if((
int)rChip.Samples() < 1 || (int)rChip.Lines() < 1) {
562 for(
int line = 1; line <= rChip.Lines(); line++) {
563 for(
int samp = 1; samp <= rChip.Samples(); samp++) {
569 for(
int l = 1; l <= rChip.Lines(); l++) {
570 int istartLine = (l - 1) * reductionFactor + 1;
571 int iendLine = istartLine + reductionFactor - 1;
572 for(
int s = 1; s <= rChip.Samples(); s++) {
574 int istartSamp = (s - 1) * reductionFactor + 1;
575 int iendSamp = istartSamp + reductionFactor - 1;
578 for(
int line = istartLine; line < iendLine; line++) {
579 for(
int sample = istartSamp; sample < iendSamp; sample++) {
583 rChip.SetValue(s, l, stats.
Average());
603 int N = p_windowSize / 2 + 1;
605 if(p_searchChip.Samples() < p_patternChip.Samples() + N) {
606 string msg =
"Search chips samples [";
607 msg +=
IString(p_searchChip.Samples()) +
"] must be at ";
608 msg +=
"least [" +
IString(N) +
"] pixels wider than the pattern chip samples [";
609 msg +=
IString(p_patternChip.Samples()) +
"] for successful surface modeling";
613 if(p_searchChip.Lines() < p_patternChip.Lines() + N) {
614 string msg =
"Search chips lines [";
615 msg +=
IString(p_searchChip.Lines()) +
"] must be at ";
616 msg +=
"least [" +
IString(N) +
"] pixels taller than the pattern chip lines [";
617 msg +=
IString(p_patternChip.Lines()) +
"] for successful surface modeling";
622 p_totalRegistrations++;
628 Chip gradientPatternChip(p_patternChip);
629 Chip gradientSearchChip(p_searchChip);
630 ApplyGradientFilter(gradientPatternChip);
631 ApplyGradientFilter(gradientSearchChip);
634 if(!gradientPatternChip.
IsValid(p_patternValidPercent)) {
635 p_patternChipNotEnoughValidDataCount++;
636 p_registrationStatus = PatternChipNotEnoughValidData;
637 return PatternChipNotEnoughValidData;
640 if(!ComputeChipZScore(gradientPatternChip)) {
641 p_patternZScoreNotMetCount++;
642 p_registrationStatus = PatternZScoreNotMet;
643 return PatternZScoreNotMet;
665 int startSamp = (gradientPatternChip.
Samples() - 1) / 2 + 1;
666 int startLine = (gradientPatternChip.
Lines() - 1) / 2 + 1;
667 int endSamp = gradientSearchChip.
Samples() - startSamp + 1;
668 int endLine = gradientSearchChip.
Lines() - startLine + 1;
674 if (p_reduceFactor != 1) {
675 if(gradientPatternChip.
Samples() / p_reduceFactor < 2 || gradientPatternChip.
Lines() / p_reduceFactor < 2) {
676 string msg =
"Reduction factor is too large";
683 int bestSearchSamp = gradientSearchChip.
TackSample();
684 int bestSearchLine = gradientSearchChip.
TackLine();
691 if(p_reduceFactor != 1) {
692 p_reducedPatternChip.SetSize((
int)gradientPatternChip.
Samples() / p_reduceFactor,
693 (int)gradientPatternChip.
Lines() / p_reduceFactor);
698 for(
int line = 1; line <= p_reducedPatternChip.Lines(); line++) {
699 for(
int samp = 1; samp <= p_reducedPatternChip.Samples(); samp++) {
700 p_reducedPatternChip.SetValue(samp, line,
Isis::Null);
704 p_reducedPatternChip =
Reduce(gradientPatternChip, p_reduceFactor);
705 if(!ComputeChipZScore(p_reducedPatternChip)) {
706 p_patternZScoreNotMetCount++;
707 p_registrationStatus = PatternZScoreNotMet;
708 return PatternZScoreNotMet;
711 p_reducedSearchChip =
Reduce(gradientSearchChip, p_reduceFactor);
712 int reducedStartSamp = (p_reducedPatternChip.Samples() - 1) / 2 + 1;
713 int reducedEndSamp = p_reducedSearchChip.Samples() - reducedStartSamp + 1;
714 int reducedStartLine = (p_reducedPatternChip.Lines() - 1) / 2 + 1;
715 int reducedEndLine = p_reducedSearchChip.Lines() - reducedStartLine + 1;
717 Match(p_reducedSearchChip, p_reducedPatternChip, p_reducedFitChip,
718 reducedStartSamp, reducedEndSamp, reducedStartLine, reducedEndLine);
721 p_fitChipNoDataCount++;
722 p_registrationStatus = FitChipNoData;
723 return FitChipNoData;
730 int bs = (p_bestSamp - 1) * p_reduceFactor + ((p_reduceFactor - 1) / 2) + 1;
731 int bl = (p_bestLine - 1) * p_reduceFactor + ((p_reduceFactor - 1) / 2) + 1;
738 int newstartSamp = bs - p_reduceFactor - p_windowSize - 1;
739 int newendSamp = bs + p_reduceFactor + p_windowSize + 1;
740 int newstartLine = bl - p_reduceFactor - p_windowSize - 1;
741 int newendLine = bl + p_reduceFactor + p_windowSize + 1;
743 if(newstartLine < startLine) newstartLine = startLine;
744 if(newendSamp > endSamp) newendSamp = endSamp;
745 if(newstartSamp < startSamp) newstartSamp = startSamp;
746 if(newendLine > endLine) newendLine = endLine;
748 startSamp = newstartSamp;
749 endSamp = newendSamp;
750 startLine = newstartLine;
751 endLine = newendLine;
762 p_registrationStatus = Registration(gradientSearchChip, gradientPatternChip,
763 p_fitChip, startSamp, startLine, endSamp, endLine,
764 bestSearchSamp, bestSearchLine);
767 p_searchChip.SetChipPosition(p_chipSample, p_chipLine);
768 p_cubeSample = gradientSearchChip.
CubeSample();
769 p_cubeLine = gradientSearchChip.
CubeLine();
773 if (p_gradientFilterType != None) {
774 p_gradientSearchChip = gradientSearchChip;
775 p_gradientPatternChip = gradientPatternChip;
778 p_goodnessOfFit = p_bestFit;
781 if (p_registrationStatus == AutoReg::SuccessSubPixel)
782 p_subpixelSuccesses++;
787 return p_registrationStatus;
825 Chip &fChip,
int startSamp,
int startLine,
int endSamp,
int endLine,
826 int bestSamp,
int bestLine) {
829 Match(sChip, pChip, fChip, startSamp, endSamp, startLine, endLine);
834 p_fitChipNoDataCount++;
835 p_registrationStatus = FitChipNoData;
836 return FitChipNoData;
840 if (!CompareFits(p_bestFit, Tolerance())) {
841 p_fitChipToleranceNotMetCount++;
842 p_registrationStatus = FitChipToleranceNotMet;
843 return FitChipToleranceNotMet;
847 if (p_subpixelAccuracy && !IsIdeal(p_bestFit)) {
848 Chip window(p_windowSize, p_windowSize);
849 fChip.
Extract(p_bestSamp, p_bestLine, window);
854 if (!window.
IsValid(100.0 * 2.1 / 3.0)) {
855 p_surfaceModelNotEnoughValidDataCount++;
856 p_registrationStatus = SurfaceModelNotEnoughValidData;
857 p_chipSample = p_bestSamp;
858 p_chipLine = p_bestLine;
859 return SurfaceModelNotEnoughValidData;
864 bool computedSubPixel = SetSubpixelPosition(window);
865 if (!computedSubPixel) {
866 p_chipSample = p_bestSamp;
867 p_chipLine = p_bestLine;
868 p_registrationStatus = SurfaceModelSolutionInvalid;
869 return SurfaceModelSolutionInvalid;
874 p_sampMovement = fabs(p_bestSamp - p_chipSample);
875 p_lineMovement = fabs(p_bestLine - p_chipLine);
876 if (p_sampMovement > p_distanceTolerance ||
877 p_lineMovement > p_distanceTolerance) {
879 p_surfaceModelDistanceInvalidCount++;
880 p_registrationStatus = SurfaceModelDistanceInvalid;
881 p_chipSample = p_bestSamp;
882 p_chipLine = p_bestLine;
883 return SurfaceModelDistanceInvalid;
886 p_registrationStatus = SuccessSubPixel;
887 return SuccessSubPixel;
890 p_chipSample = p_bestSamp;
891 p_chipLine = p_bestLine;
892 p_registrationStatus = SuccessPixel;
908 bool AutoReg::ComputeChipZScore(
Chip &chip) {
910 for(
int i = 0; i < chip.
Samples(); i++) {
911 double pixels[chip.
Lines()];
912 for(
int j = 0; j < chip.
Lines(); j++) {
913 pixels[j] = chip.
GetValue(i + 1, j + 1);
925 if (p_zScoreMax < p_minimumPatternZScore && -p_zScoreMin < p_minimumPatternZScore) {
940 void AutoReg::ApplyGradientFilter(
Chip &chip) {
941 if (p_gradientFilterType == None) {
948 if (p_gradientFilterType == Sobel) {
954 "No rule to set sub-chip width for selected Gradient Filter Type.";
965 for (
int line = 1; line <= chip.
Lines(); line++) {
966 for (
int sample = 1; sample <= chip.
Samples(); sample++) {
967 Chip subChip = chip.
Extract(subChipWidth, subChipWidth,
972 Buffer buffer(subChipWidth, subChipWidth, 1, Isis::None);
975 for (
int subChipLine = 1; subChipLine <= subChip.
Lines();
977 for (
int subChipSample = 1; subChipSample <= subChip.
Samples();
979 doubleBuffer[bufferIndex] = subChip.
GetValue(subChipSample,
987 double newPixelValue = 0;
988 if (p_gradientFilterType == Sobel) {
989 SobelGradient(buffer, newPixelValue);
991 filteredChip.SetValue(sample, line, newPixelValue);
996 for (
int line = 1; line <= filteredChip.Lines(); line++) {
997 for (
int sample = 1; sample <= filteredChip.Samples(); sample++) {
998 chip.
SetValue(sample, line, filteredChip.GetValue(sample, line));
1013 void AutoReg::SobelGradient(
Buffer &in,
double &v) {
1014 bool specials =
false;
1015 for(
int i = 0; i < in.
size(); ++i) {
1024 v = abs((in[0] + 2 * in[1] + in[2]) - (in[6] + 2 * in[7] + in[8])) +
1025 abs((in[2] + 2 * in[5] + in[8]) - (in[0] + 2 * in[3] + in[6]));
1044 void AutoReg::Match(
Chip &sChip,
Chip &pChip,
Chip &fChip,
int startSamp,
int endSamp,
int startLine,
int endLine) {
1046 if(startSamp == endSamp && startLine == endLine) {
1047 string msg =
"StartSample [" +
IString(startSamp) +
"] = EndSample [" 1048 +
IString(endSamp) +
"] and StartLine [" +
IString(startLine) +
" = EndLine [" 1056 for(
int line = 1; line <= fChip.
Lines(); line++) {
1057 for(
int samp = 1; samp <= fChip.
Samples(); samp++) {
1065 for(
int line = startLine; line <= endLine; line++) {
1066 for(
int samp = startSamp; samp <= endSamp; samp++) {
1068 sChip.
Extract(samp, line, subsearch);
1071 if(!subsearch.IsValid(p_subsearchValidPercent))
continue;
1074 double fit = MatchAlgorithm(pChip, subsearch);
1079 if((p_bestFit ==
Isis::Null) || CompareFits(fit, p_bestFit)) {
1100 bool AutoReg::SetSubpixelPosition(
Chip &window) {
1103 double samples = window.
Samples();
1104 double lines= window.
Lines();
1106 if (bestDN < window.
GetValue(1, 1)) {
1107 for (
int s=1; s <= samples; s++)
1108 for (
int l=1; l <= lines; l++)
1110 bestDN = 1 / bestDN;
1114 double greatestEdgeDn = 0.0;
1115 for (
int s = 1; s <= samples; s++) {
1116 greatestEdgeDn = max(window.
GetValue(s, 1), greatestEdgeDn);
1117 greatestEdgeDn = max(window.
GetValue(s, lines), greatestEdgeDn);
1119 for (
int l = 2; l <= lines - 1; l++) {
1120 greatestEdgeDn = max(window.
GetValue(1, l), greatestEdgeDn);
1121 greatestEdgeDn = max(window.
GetValue(samples, l), greatestEdgeDn);
1129 double temp = greatestEdgeDn + 0.2 * (bestDN - greatestEdgeDn);
1134 Chip selectionChip(window);
1135 floodFill.
select(&window, &selectionChip);
1137 double windowSample;
1139 floodFill.centerOfMassWeighted(
1140 &window, &selectionChip, &windowSample, &windowLine);
1142 int offsetS = p_bestSamp - window.
ChipSample();
1143 int offsetL = p_bestLine - window.
ChipLine();
1144 p_chipSample = windowSample + offsetS;
1145 p_chipLine = windowLine + offsetL;
1147 if (p_chipSample != p_chipSample) {
1148 p_surfaceModelSolutionInvalidCount++;
1165 bool AutoReg::CompareFits(
double fit1,
double fit2) {
1166 return(std::fabs(fit1 - IdealFit()) <= std::fabs(fit2 - IdealFit()));
1175 bool AutoReg::IsIdeal(
double fit) {
1176 return(std::fabs(IdealFit() - fit) < 0.00001);
1190 Pvl AutoReg::RegistrationStatistics() {
1192 PvlGroup stats(
"AutoRegStatistics");
1203 PvlGroup grp(
"PatternChipFailures");
1204 grp +=
PvlKeyword(
"PatternNotEnoughValidData",
toString(p_patternChipNotEnoughValidDataCount));
1210 fit +=
PvlKeyword(
"FitChipToleranceNotMet",
toString(p_fitChipToleranceNotMetCount));
1213 PvlGroup model(
"SurfaceModelFailures");
1214 model +=
PvlKeyword(
"SurfaceModelNotEnoughValidData",
toString(p_surfaceModelNotEnoughValidDataCount));
1215 model +=
PvlKeyword(
"SurfaceModelSolutionInvalid",
toString(p_surfaceModelSolutionInvalidCount));
1216 model +=
PvlKeyword(
"SurfaceModelDistanceInvalid",
toString(p_surfaceModelDistanceInvalidCount));
1219 return (AlgorithmStatistics(pvl));
1232 PvlGroup &algo = p_template.findGroup(
"Algorithm", Pvl::Traverse);
1233 reg +=
PvlKeyword(
"Algorithm", algo[
"Name"][0]);
1234 reg +=
PvlKeyword(
"Tolerance", algo[
"Tolerance"][0]);
1236 reg +=
PvlKeyword(
"SubpixelAccuracy", algo[
"SubpixelAccuracy"][0]);
1239 reg +=
PvlKeyword(
"ReductionFactor", algo[
"ReductionFactor"][0]);
1242 reg +=
PvlKeyword(
"Gradient", algo[
"Gradient"][0]);
1245 PvlGroup &pchip = p_template.findGroup(
"PatternChip", Pvl::Traverse);
1246 reg +=
PvlKeyword(
"PatternSamples", pchip[
"Samples"][0]);
1247 reg +=
PvlKeyword(
"PatternLines", pchip[
"Lines"][0]);
1249 reg +=
PvlKeyword(
"PatternMinimum", pchip[
"ValidMinimum"][0]);
1252 reg +=
PvlKeyword(
"PatternMaximum", pchip[
"ValidMaximum"][0]);
1255 reg +=
PvlKeyword(
"MinimumZScore", pchip[
"MinimumZScore"][0]);
1258 SetPatternValidPercent((
double)pchip[
"ValidPercent"]);
1259 reg +=
PvlKeyword(
"ValidPercent", pchip[
"ValidPercent"][0]);
1262 PvlGroup &schip = p_template.findGroup(
"SearchChip", Pvl::Traverse);
1263 reg +=
PvlKeyword(
"SearchSamples", schip[
"Samples"][0]);
1264 reg +=
PvlKeyword(
"SearchLines", schip[
"Lines"][0]);
1266 reg +=
PvlKeyword(
"SearchMinimum", schip[
"ValidMinimum"][0]);
1269 reg +=
PvlKeyword(
"SearchMaximum", schip[
"ValidMaximum"][0]);
1271 if(schip.
hasKeyword(
"SubchipValidPercent")) {
1272 SetSubsearchValidPercent((
double)schip[
"SubchipValidPercent"]);
1273 reg +=
PvlKeyword(
"SubchipValidPercent", schip[
"SubchipValidPercent"][0]);
1276 if(p_template.hasGroup(
"SurfaceModel")) {
1277 PvlGroup &smodel = p_template.findGroup(
"SurfaceModel", Pvl::Traverse);
1279 reg +=
PvlKeyword(
"DistanceTolerance", smodel[
"DistanceTolerance"][0]);
1283 reg +=
PvlKeyword(
"WindowSize", smodel[
"WindowSize"][0]);
1305 reg +=
PvlKeyword(
"Algorithm", AlgorithmName());
1308 SubPixelAccuracy() ?
"True" :
"False");
1310 reg +=
PvlKeyword(
"Gradient", GradientFilterString());
1312 Chip *pattern = PatternChip();
1319 Chip *search = SearchChip();
1325 if (SubPixelAccuracy()) {
Buffer for reading and writing cube data.
void SetChipPosition(const double sample, const double line)
Compute the position of the cube given a chip coordinate.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
double * DoubleBuffer() const
Returns the value of the shape buffer.
const double Null
Value for an Isis Null pixel.
interpType
The interpolator type, including: None, Nearest Neighbor, BiLinear or Cubic Convultion.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
const double ValidMinimum
The minimum valid double value for Isis pixels.
double Minimum() const
Returns the absolute minimum double found in all data passed through the AddData method.
A small chip of data used for pattern matching.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
int select(Chip *inputChip, Chip *selectionChip)
Given a range of DN this function creates a biniary chip for all continuous pixels that have the DN w...
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Namespace for the standard library.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Chip Extract(int samples, int lines, int samp, int line)
Extract a sub-chip from a chip.
int size() const
Returns the total number of pixels in the shape buffer.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
This class is used to accumulate statistics on double arrays.
bool IsValid(int sample, int line)
Contains multiple PvlContainers.
void Reset()
Reset all accumulators and counters to zero.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
double CubeSample() const
bool IsSpecial(const double d)
Returns if the input pixel is special.
int TackSample() const
This method returns a chip's fixed tack sample; the middle of the chip.
void SetSize(const int samples, const int lines)
Change the size of the Chip.
Container for cube-like labels.
void SetValue(int sample, int line, const double &value)
Sets a value in the chip.
const double ValidMaximum
The maximum valid double value for Isis pixels.
RegisterStatus
Enumeration of the Register() method's return status.
Selection class derived from the Pure Virtual Parent Class for all Selection classes ...
QString fileName() const
Returns the filename used to initialise the Pvl object.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
int setDNRange(double minimumDN, double maximumDN)
Set the range of the DNs.
double ChipSample() const
double GetValue(int sample, int line)
Loads a Chip with a value.
double ZScore(const double value) const
This method returns the better of the z-score of the given value.
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Contains Pvl Groups and Pvl Objects.
Reduce the pixel dimensions of an image.
double Average() const
Computes and returns the average.
int TackLine() const
This method returns a chip's fixed tack line; the middle of the chip.