Isis 3 Programmer Reference
ControlNetFilter.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "ControlNetFilter.h"
10
11#include <QVector>
12
13#include "Angle.h"
14#include "Camera.h"
15#include "CameraFactory.h"
16#include "ControlMeasure.h"
17#include "ControlMeasureLogData.h"
18#include "ControlNet.h"
19#include "ControlPoint.h"
20#include "FileName.h"
21#include "IString.h"
22#include "Latitude.h"
23#include "Longitude.h"
24#include "PvlGroup.h"
25#include "SerialNumberList.h"
26#include "Statistics.h"
27
28// for double precision
29#include <limits>
30typedef std::numeric_limits< double > dbl;
31
32using namespace std;
33
34#define UNDEFINED_STATUS 2
35
36namespace Isis {
37
39 extern QString sPointType[];
40
42 extern QString sBoolean[];
43
53 ControlNetFilter::ControlNetFilter(ControlNet *pCNet, QString &psSerialNumFile, Progress *pProgress) :
54 ControlNetStatistics(pCNet, psSerialNumFile, pProgress) {
55 mSerialNumFilter = SerialNumberList(psSerialNumFile);
56 }
57
66 void ControlNetFilter::SetOutputFile(QString psPrintFile) {
67 Isis::FileName outFile(psPrintFile);
68 QString outName(outFile.expanded());
69 mOstm.open(outName.toLatin1().data(), std::ios::out);
70 mOstm.precision(dbl::digits10);
71 }
72
81
82
92 if ( mCNet->GetPoint(pindex)->IsEditLocked() ) {
93 mCNet->GetPoint(pindex)->SetEditLock(false);
94 }
95 mCNet->DeletePoint(pindex);
96 }
97
109 QList< ControlMeasure * > measures = mCNet->GetMeasuresInCube(serialNum);
110
111 foreach(ControlMeasure * measure, measures) {
112 bool pointEditFlag = false;
113 QString ptId(measure->Parent()->GetId());
114 ControlPoint * point = mCNet->GetPoint(ptId);
115 if (point->IsEditLocked()) {
116 point->SetEditLock(false);
117 pointEditFlag = true;
118 }
119 ControlMeasure *msr = point->GetMeasure(serialNum);
120 msr->SetEditLock(false);
121 point->Delete(serialNum);
122 if (pointEditFlag) {
123 point->SetEditLock(true);
124 }
125 }
126 }
127
134 mOstm << "PointID, PointType, PointIgnored, PointEditLocked, TotalMeasures, MeasuresIgnored, MeasuresEditLocked, ";
135 }
136
145 mOstm << pcPoint.GetId() << ", " << sPointType[(int)pcPoint.GetType()]
146 << ", " << sBoolean[(int)pcPoint.IsIgnored()] << ", "
147 << sBoolean[(int)pcPoint.IsEditLocked()] << ", "
148 << pcPoint.GetNumMeasures() << ", "
149 << pcPoint.GetNumMeasures() - pcPoint.GetNumValidMeasures() << ", "
150 << pcPoint.GetNumLockedMeasures() << ", ";
151 }
152
161 mOstm << mSerialNumList.fileName(pcMeasure.GetCubeSerialNumber()) << ", ";
162 mOstm << pcMeasure.GetCubeSerialNumber();
163 }
164
171 mOstm << "FileName, SerialNumber, ImageTotalPoints, ImagePointsIgnored, ImagePointsEditLocked, ImagePointsFixed, ImagePointsConstrained, ImagePointsFree, ImageConvexHullRatio";
172 }
173
182 void ControlNetFilter::PointPixelShiftFilter(const PvlGroup &pvlGrp, bool pbLastFilter){
183 double dLesser = Isis::ValidMaximum;
184 double dGreater = 0;
185
186 if (pvlGrp.hasKeyword("LessThan")) {
187 dLesser = fabs((double)pvlGrp["LessThan"]);
188 }
189
190 if (pvlGrp.hasKeyword("GreaterThan")) {
191 dGreater = fabs((double)pvlGrp["GreaterThan"]);
192 }
193
194 if (dLesser < 0 || dGreater < 0 || dLesser <= dGreater) {
195 string sErrMsg = "Invalid Deffile - Check Point_PixelShift Group\n";
196 throw IException(IException::User, sErrMsg, _FILEINFO_);
197 return;
198 }
199
200 if (pbLastFilter) {
201 mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, PixelShift, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
202 mOstm << endl;
203 }
204
205 int iNumPoints = mCNet->GetNumPoints();
206 for (int i = (iNumPoints - 1); i >= 0; i--) {
207 ControlPoint *cPoint = mCNet->GetPoint(i);
208 int iNumMeasures = cPoint->GetNumMeasures();
209 bool bFilter = true;
210 for (int j = 0; j < iNumMeasures; j++){
211 const ControlMeasure *measure = cPoint->GetMeasure(j);
212 double dPixelShift = measure->GetPixelShift();
213 if (dPixelShift <= dLesser && dPixelShift >= dGreater) {
214 bFilter = false;
215 break;
216 }
217 }
218 if (bFilter) {
220 continue;
221 }
222
223 // Print into output, if it is the last Filter
224 if (pbLastFilter) {
225 for (int j = 0; j < iNumMeasures; j++) {
226 mOstm << cPoint->GetId() << ", " << sPointType[cPoint->GetType()] << ", "
227 << sBoolean[cPoint->IsIgnored()] << ", "
228 << sBoolean[cPoint->IsEditLocked()] << ", ";
229
230 const ControlMeasure *measure = cPoint->GetMeasure(j);
231 PrintCubeFileSerialNum(*measure);
232 double dPixelShift = measure->GetPixelShift();
233 mOstm << ", " << (dPixelShift == Null ? "Null" : toString(dPixelShift)) << ", "
234 << measure->GetMeasureTypeString() << ", "
235 << sBoolean[measure->IsIgnored()] << ", "
236 << sBoolean[measure->IsEditLocked()] << ", "
237 << sBoolean[cPoint->GetRefMeasure() == measure]
238 << endl;
239 }
240 }
241 }
242
243 // update the image stats with the changes
245 }
246
257 void ControlNetFilter::PointNumMeasuresEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter){
258 int iLesser = VALID_MAX2;
259 int iGreater = 0;
260
261 if (pvlGrp.hasKeyword("LessThan")) {
262 iLesser = toInt(pvlGrp["LessThan"][0]);
263 }
264
265 if (pvlGrp.hasKeyword("GreaterThan")) {
266 iGreater = toInt(pvlGrp["GreaterThan"][0]);
267 }
268
269 if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) {
270 string sErrMsg = "Invalid Deffile - Check Point_MeasureEditLock Group\n";
271 throw IException(IException::User, sErrMsg, _FILEINFO_);
272 return;
273 }
274
275 if (pbLastFilter) {
277 mOstm << "FileName, SerialNumber, MeasureType, MeasureIgnored, MeasureEditLocked, Reference" << endl;
278 }
279
280 int iNumPoints = mCNet->GetNumPoints();
281 for (int i = (iNumPoints - 1); i >= 0; i--) {
282 ControlPoint *cPoint = mCNet->GetPoint(i);
283 int iNumLockedMsr = cPoint->GetNumLockedMeasures();
284 //cerr << cPoint->GetId() << " NumMsrs=" << iNumLockedMsr << endl;
285 if (iNumLockedMsr > iLesser || iNumLockedMsr < iGreater) {
287 continue;
288 }
289
290 int iNumMeasures = cPoint->GetNumMeasures();
291 if (pbLastFilter) {
292 for (int j = 0; j < iNumMeasures; j++) {
293 const ControlMeasure *cm = cPoint->GetMeasure(j);
294 PointStats(*cPoint);
296 mOstm << ", " << cm->GetMeasureTypeString() << ", "
297 << sBoolean[cm->IsIgnored()] << ", "
298 << sBoolean[cm->IsEditLocked()] << ", "
299 << sBoolean[cm == cPoint->GetRefMeasure()]
300 << endl;
301 }
302 }
303 }
304
305 // update the image stats with the changes
307 }
308
319 void ControlNetFilter::PointEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter){
320 bool editLock = false;
321
322 if (pvlGrp.hasKeyword("EditLock")) {
323 if(pvlGrp["EditLock"][0] == "1" || IString(pvlGrp["EditLock"][0]).DownCase() == "true")
324 editLock = true;
325 }
326
327 if (pbLastFilter) {
329 mOstm << endl;
330 }
331
332 int iNumPoints = mCNet->GetNumPoints();
333 for (int i = (iNumPoints - 1); i >= 0; i--) {
334 ControlPoint *cPoint = mCNet->GetPoint(i);
335 if (cPoint->IsEditLocked() != editLock) {
337 continue;
338 }
339
340 if (pbLastFilter) {
341 int iNumMeasures = cPoint->GetNumMeasures();
342 mOstm << cPoint->GetId() << ", " << sPointType[cPoint->GetType()] << ", "
343 << sBoolean[cPoint->IsIgnored()] << ", "
344 << sBoolean[cPoint->IsEditLocked()] << ", "
345 << iNumMeasures << ", "
346 << (iNumMeasures - cPoint->GetNumValidMeasures()) << ", "
347 << cPoint->GetNumLockedMeasures() << endl;
348 }
349 }
350
351 // update the image stats with the changes
353 }
354
366 void ControlNetFilter::PointResMagnitudeFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
367 double dLesser = Isis::ValidMaximum;
368 double dGreater = 0;
369
370 if (pvlGrp.hasKeyword("LessThan")) {
371 if (pvlGrp["LessThan"][0] != "") {
372 dLesser = fabs((double)pvlGrp["LessThan"]);
373 }
374 }
375
376 if (pvlGrp.hasKeyword("GreaterThan")) {
377 if (pvlGrp["GreaterThan"][0] != "") {
378 dGreater = fabs((double)pvlGrp["GreaterThan"]);
379 }
380 }
381
382 if (dLesser < 0 || dGreater < 0 || dLesser < dGreater) {
383 string sErrMsg = "Invalid Deffile - Check Point_ResidualMagnitude Group\n";
384 throw IException(IException::User, sErrMsg, _FILEINFO_);
385 return;
386 }
387
388 if (pbLastFilter) {
389 mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, ResidualMagnitude, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
390 mOstm << endl;
391 }
392
393 int iNumPoints = mCNet->GetNumPoints();
394 for (int i = (iNumPoints - 1); i >= 0; i--) {
395 bool bFilter = true;
396 ControlPoint *cPoint = mCNet->GetPoint(i);
397 int iNumMeasures = cPoint->GetNumMeasures();
398 for (int j = 0; j < iNumMeasures; j++) {
399 const ControlMeasure *measure = cPoint->GetMeasure(j);
400 double dResMag = measure->GetResidualMagnitude();
401 if (dResMag <= dLesser && dResMag >= dGreater) {
402 bFilter = false;
403 break;
404 }
405 }
406
407 if (bFilter) {
409 continue;
410 }
411 // Print into output, if it is the last Filter
412 else if (pbLastFilter) {
413
414 for (int j = 0; j < iNumMeasures; j++) {
415 mOstm << cPoint->GetId() << ", " << sPointType[cPoint->GetType()] << ", "
416 << sBoolean[cPoint->IsIgnored()] << ", "
417 << sBoolean[cPoint->IsEditLocked()] << ", ";
418
419 const ControlMeasure *measure = cPoint->GetMeasure(j);
420 PrintCubeFileSerialNum(*measure);
421 double dResMag = measure->GetResidualMagnitude();
422 mOstm << ", " << (dResMag == Null ? "Null" : IString(dResMag) ) << ", "
423 << measure->GetMeasureTypeString() << ", "
424 << sBoolean[measure->IsIgnored()] << ", "
425 << sBoolean[measure->IsEditLocked()] << ", "
426 << sBoolean[cPoint->GetRefMeasure() == measure]
427 << endl;
428 }
429 }
430 }
431
432 // update the image stats with the changes
434 }
435
445 void ControlNetFilter::PointIDFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
446 QString sPointIDExpr = pvlGrp["Expression"][0];
447 QString sSeparator("*");
448 QStringList strTokens = sPointIDExpr.split(sSeparator, QString::SkipEmptyParts);
449
450 int iTokenSize = (int)strTokens.size();
451 int iNumPoints = mCNet->GetNumPoints();
452#ifdef _DEBUG_
453 odb << "Net Size=" << iNumPoints << endl;
454#endif
455
456 if (pbLastFilter) {
458 mOstm << endl;
459 }
460
461 for (int i = (iNumPoints - 1); i >= 0; i--) {
462 const ControlPoint *cPoint = mCNet->GetPoint(i);
463 QString sPointID = cPoint->GetId();
464 int iPosition = 0;
465 for (int j = (iTokenSize - 1); j >= 0; j--) {
466 int iLen = strTokens[j].length();
467 if (iLen > 0) {
468 int found = sPointID.indexOf(strTokens[j], iPosition);
469 if (found != -1) {
470 iPosition = found + iLen;
471 // End of the expression
472 if (pbLastFilter && j == (iTokenSize - 1)) {
473 // Log into the output file
474 PointStats(*cPoint);
475 mOstm << endl;
476 }
477 }
478 else {
480 break;
481 }
482 }
483 }
484 }
485
486 // update the image stats with the changes
488 }
489
499 void ControlNetFilter::PointMeasuresFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
500 int iLesser = VALID_MAX2, iGreater = 0;
501
502 if (pvlGrp.hasKeyword("LessThan")) {
503 if (pvlGrp["LessThan"][0] != "") {
504 iLesser = toInt(pvlGrp["LessThan"][0]);
505 }
506 }
507
508 if (pvlGrp.hasKeyword("GreaterThan")) {
509 if (pvlGrp["GreaterThan"][0] != "") {
510 iGreater = toInt(pvlGrp["GreaterThan"][0]);
511 }
512 }
513
514 if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) {
515 string sErrMsg = "Invalid Deffile - Check Point_NumMeasures Group\n";
516 throw IException(IException::User, sErrMsg, _FILEINFO_);
517 return;
518 }
519
520 if (pbLastFilter) {
522 mOstm << "FileName, SerialNum, MeasureType, MeasureIgnore, MeasureEditLock, Reference" << endl;
523 }
524
525 int iNumPoints = mCNet->GetNumPoints();
526
527 for (int i = (iNumPoints - 1); i >= 0; i--) {
528 const ControlPoint *cPoint = mCNet->GetPoint(i);
529 int iNumMeasures = cPoint->GetNumMeasures();
530 if (iNumMeasures > iLesser || iNumMeasures < iGreater) {
532 continue;
533 }
534 if (pbLastFilter) {
535 for (int j = 0; j < iNumMeasures; j++) {
536 const ControlMeasure *cm = cPoint->GetMeasure(j);
537 PointStats(*cPoint);
539 mOstm << ", " << cm->GetMeasureTypeString() << ", "
540 << sBoolean[cm->IsIgnored()] << ", "
541 << sBoolean[cm->IsEditLocked()] << ", "
542 << sBoolean[cm == cPoint->GetRefMeasure()]
543 << endl;
544 }
545 }
546 }
547
548 // update the image stats with the changes
550 }
551
561 void ControlNetFilter::PointPropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
562 bool bIgnoredFlag = false;
563 int iSetIgnoreFlag = 0;
564 IString sType = "";
565 IString sTemp = "";
566
567 if (pvlGrp.hasKeyword("PointType")) {
568 if (pvlGrp["PointType"][0] != "") {
569 sType = pvlGrp["PointType"][0];
570 sType = sType.DownCase(sType);
571 }
572 }
573
574 if (pvlGrp.hasKeyword("Ignore")) {
575 iSetIgnoreFlag = 1;
576 sTemp = pvlGrp["Ignore"][0];
577 if (sTemp == "1" || sTemp.DownCase() == "true") {
578 bIgnoredFlag = true;
579 }
580 }
581
582 if (pbLastFilter) {
584 mOstm << endl;
585 }
586
587 int iNumPoints = mCNet->GetNumPoints();
588
589 for (int i = (iNumPoints - 1); i >= 0; i--) {
590 const ControlPoint *cPoint = mCNet->GetPoint(i);
591 bool bPointFound = false;
592 bool bIgnored = cPoint->IsIgnored();
593 bool bFixed = (cPoint->GetType() == ControlPoint::Fixed ? true : false);
594 bool bConstrained = (cPoint->GetType() == ControlPoint::Constrained ? true : false);
595 bool bFree = (cPoint->GetType() == ControlPoint::Free ? true : false);
596
597 if (!iSetIgnoreFlag || bIgnoredFlag == bIgnored) {
598 if (sType == "all" || sType=="") {
599 bPointFound = true;
600 }
601 else if (sType == "fixed" && bFixed) {
602 bPointFound = true;
603 }
604 else if (sType == "constrained" && bConstrained) {
605 bPointFound = true;
606 }
607 else if (sType == "free" && bFree) {
608 bPointFound = true;
609 }
610 }
611
612 if(!bPointFound) {
614 continue;
615 }
616
617 // Output the Point Stats
618 if (pbLastFilter) {
619 PointStats(*cPoint);
620 mOstm << endl;
621 }
622 }
623
624 // update the image stats with the changes
626 }
627
637 void ControlNetFilter::PointLatLonFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
638 double dMinLat = Isis::ValidMinimum, dMaxLat = Isis::ValidMaximum;
639 double dMinLon = Isis::ValidMinimum, dMaxLon = Isis::ValidMaximum;
640
641 if (pvlGrp.hasKeyword("MinLat")) {
642 if (pvlGrp["MinLat"][0] != "") {
643 dMinLat = pvlGrp["MinLat"];
644 }
645 }
646
647 if (pvlGrp.hasKeyword("MaxLat")) {
648 if (pvlGrp["MaxLat"][0] != "") {
649 dMaxLat = pvlGrp["MaxLat"];
650 }
651 }
652
653 if (pvlGrp.hasKeyword("MinLon")) {
654 if (pvlGrp["MinLon"][0] != "") {
655 dMinLon = pvlGrp["MinLon"];
656 }
657 }
658
659 if (pvlGrp.hasKeyword("MaxLon")) {
660 if (pvlGrp["MaxLon"][0] != "") {
661 dMaxLon = pvlGrp["MaxLon"];
662 }
663 }
664
665 if (dMinLat > dMaxLat || dMinLon > dMaxLon) {
666 string sErrMsg = "Invalid Deffile - Check Point_LatLon Group\n";
667 throw IException(IException::User, sErrMsg, _FILEINFO_);
668 return;
669 }
670
671 if (pbLastFilter) {
673 mOstm << "Latitude, Longitude, Radius" << endl;
674 }
675
676 int iNumPoints = mCNet->GetNumPoints();
677
678 for (int i = (iNumPoints - 1); i >= 0; i--) {
679 const ControlPoint *cPoint = mCNet->GetPoint(i);
680 SurfacePoint cPointSurfPt = cPoint->GetAdjustedSurfacePoint();
681
682 if (!cPointSurfPt.Valid()) {
683 const ControlMeasure *cm = cPoint->GetRefMeasure();
684
685 QString sn = cm->GetCubeSerialNumber();
686 QString filename = mSerialNumList.fileName(sn);
687 Cube cube(filename, "r");
688
689 Camera *camera = CameraFactory::Create(cube);
690 if (camera->SetImage(cm->GetSample(), cm->GetLine())) {
691 cPointSurfPt.SetSpherical(
694 Distance(camera->LocalRadius()));
695 }
696 delete camera;
697 camera = NULL;
698 }
699 double latitude = cPointSurfPt.GetLatitude().degrees();
700 double longitude = cPointSurfPt.GetLongitude().degrees();
701
702 if ((latitude < dMinLat || latitude > dMaxLat) ||
703 (longitude < dMinLon ||longitude > dMaxLon)) {
705 continue;
706 }
707
708 if (pbLastFilter) {
709 PointStats(*cPoint);
710 mOstm << latitude << ", " << longitude << ", " <<
711 cPointSurfPt.GetLocalRadius().meters() << endl;
712 }
713 }
714
715 // update the image stats with the changes
717 }
718
728 void ControlNetFilter::PointDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
729 double dMaxDistance = 0;
730 QString sUnits = "pixels";
731
732 if (pvlGrp.hasKeyword("MaxDistance")) {
733 if (pvlGrp["MaxDistance"][0] != "") {
734 dMaxDistance = pvlGrp["MaxDistance"];
735 }
736 }
737
738 if (pvlGrp.hasKeyword("Units")) {
739 sUnits = pvlGrp["Units"][0];
740 }
741
742 if (pbLastFilter) {
744 mOstm << "Point#Distance >>, " << endl;
745 }
746
747 bool bMinDistance = false;
748 int iNumPoints = mCNet->GetNumPoints();
749 for (int i = (iNumPoints - 1); i >= 0; i--) {
750 const ControlPoint *cp1 = mCNet->GetPoint(i);
751 const ControlMeasure *cp1RefMeasure = cp1->GetRefMeasure();
752 SurfacePoint surfacePt1;
753 Camera *cam1;
754
755 double dSample1 = Isis::Null, dLine1 = Isis::Null;
756
757 if (sUnits == "meters") {
758 surfacePt1 = cp1->GetAdjustedSurfacePoint();
759
760 if (!surfacePt1.Valid()) {
761 QString sn1 = cp1RefMeasure->GetCubeSerialNumber();
762 QString filename1 = mSerialNumList.fileName(sn1);
763 Cube cube1(filename1, "r");
764 cam1 = CameraFactory::Create(cube1);
765 if (cam1->SetImage(cp1RefMeasure->GetSample(),
766 cp1RefMeasure->GetLine())) {
767 surfacePt1.SetSpherical(
768 Latitude(cam1->UniversalLatitude(), Angle::Degrees),
769 Longitude(cam1->UniversalLongitude(), Angle::Degrees),
770 Distance(cam1->LocalRadius())
771 );
772 }
773 delete cam1;
774 cam1 = NULL;
775 }
776 }
777 else
778 // pixels
779 {
780 dSample1 = cp1RefMeasure->GetSample();
781 dLine1 = cp1RefMeasure->GetLine();
782 }
783
784 for (int j = (mCNet->GetNumPoints() - 1); j >= 0; j--) {
785 if (i == j) {
786 continue;
787 }
788 const ControlPoint *cp2 = mCNet->GetPoint(j);
789 const ControlMeasure *cp2RefMeasure = cp2->GetRefMeasure();
790
791 SurfacePoint surfacePt2;
792 Camera *cam2;
793 double dDist = 0;
794
795 double dSample2 = Isis::Null, dLine2 = Isis::Null;
796
797 if (sUnits == "meters") {
798 surfacePt2 = cp2->GetAdjustedSurfacePoint();
799
800 if (!surfacePt2.Valid()) {
801 QString sn2 = cp2RefMeasure->GetCubeSerialNumber();
802 QString filename2 = mSerialNumList.fileName(sn2);
803 Cube cube2(filename2, "r");
804 cam2 = CameraFactory::Create(cube2);
805
806 if (cam2->SetImage(cp2RefMeasure->GetSample(),
807 cp2RefMeasure->GetLine())) {
808 surfacePt2.SetSpherical(
809 Latitude(cam2->UniversalLatitude(), Angle::Degrees),
810 Longitude(cam2->UniversalLongitude(), Angle::Degrees),
811 Distance(cam2->LocalRadius())
812 );
813 }
814 delete cam2;
815 cam2 = NULL;
816 }
817
818 dDist = surfacePt1.GetDistanceToPoint(surfacePt2,
819 surfacePt1.GetLocalRadius()).meters();
820 }
821 else
822 // pixels
823 {
824 dSample2 = cp2RefMeasure->GetSample();
825 dLine2 = cp2RefMeasure->GetLine();
826
827 double dDeltaSamp = dSample1 - dSample2;
828 double dDeltaLine = dLine1 - dLine2;
829 // use the distance formula for cartesian coordinates
830 dDist = sqrt((dDeltaSamp * dDeltaSamp) + (dDeltaLine * dDeltaLine));
831 }
832
833 if (dDist <= dMaxDistance) {
834 if (pbLastFilter) {
835 if (!bMinDistance) {
836 PointStats(*cp1);
837 }
838 mOstm << cp2->GetId() << "#" << dDist << ", ";
839 }
840 bMinDistance = true;
841 }
842 else
843 continue;
844 }
845 if (!bMinDistance) {
847 }
848 if (pbLastFilter && bMinDistance) {
849 mOstm << endl;
850 }
851 bMinDistance = false;
852 }
853
854 // update the image stats with the changes
856 }
857
871 void ControlNetFilter::PointGoodnessOfFitFilter(const PvlGroup & pvlGrp, bool pbLastFilter){
872 double dLesser=Isis::ValidMaximum, dGreater=0;
873
874 if (pvlGrp.hasKeyword("LessThan")){
875 if (pvlGrp["LessThan"][0] != "") {
876 dLesser = fabs((double)(pvlGrp["LessThan"]));
877 }
878 }
879
880 if (pvlGrp.hasKeyword("GreaterThan")){
881 if (pvlGrp["GreaterThan"][0] != "") {
882 dGreater = fabs((double)pvlGrp["GreaterThan"]);
883 }
884 }
885
886 if (pbLastFilter) {
888 mOstm << "FileName, SerialNumber, GoodnessOfFit, MeasureType, MeasureIgnored, MeasureEditLocked, Reference" << endl;
889 }
890
891 int iNumPoints = mCNet->GetNumPoints();
892 for (int i=(iNumPoints-1); i>=0; i--) {
893 ControlPoint *cPoint = mCNet->GetPoint(i);
894 int iNumMeasures = cPoint->GetNumMeasures();
895 bool bMatchFlag=false;
896
897 for (int j=0; j<iNumMeasures; j++) {
898 const ControlMeasure *measure = cPoint->GetMeasure(j);
899 double dMsrGFit= measure->GetLogData(ControlMeasureLogData::GoodnessOfFit).GetNumericalValue();
900 if (dMsrGFit >= dGreater && dMsrGFit <= dLesser) {
901 bMatchFlag = true;
902 break;
903 }
904 }
905
906 if (!bMatchFlag) {
908 }
909 else {
910 // Print into output, if it is the last Filter
911 if (pbLastFilter) {
912 int iNumMeasures = cPoint->GetNumMeasures();
913 int iNumMsIgnored = iNumMeasures - cPoint->GetNumValidMeasures();
914 for (int j = 0; j < iNumMeasures; j++) {
915 const ControlMeasure *measure = cPoint->GetMeasure(j);
916 double dMsrGFit= measure->GetLogData(ControlMeasureLogData::GoodnessOfFit).GetNumericalValue();
917
918 mOstm << cPoint->GetId() << ", " << sPointType[cPoint->GetType()] << ", "
919 << sBoolean[cPoint->IsIgnored()] << ", " << sBoolean[cPoint->IsEditLocked()] << ", "
920 << iNumMeasures << ", " << iNumMsIgnored << ", " << cPoint->GetNumLockedMeasures() << ", ";
921 PrintCubeFileSerialNum(*measure);
922 mOstm << ", " << (dMsrGFit == Null ? "NA" : IString(dMsrGFit)) << ", "
923 << measure->GetMeasureTypeString() << ", "
924 << sBoolean[measure->IsIgnored()] << ", "
925 << sBoolean[measure->IsEditLocked()] << ", "
926 << sBoolean[cPoint->GetRefMeasure() == measure]
927 << endl;
928 }
929 }
930 }
931 }
932
933 // update the image stats with the changes
935 }
945 void ControlNetFilter::PointMeasurePropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
946 int iIgnoredFlag = -1;
947 string sType = "";
948 IString isType;
949
950 if (pvlGrp.hasKeyword("Ignore")) {
951 iIgnoredFlag = 0;
952 if (IString(pvlGrp["Ignore"][0]).DownCase() == "true")
953 iIgnoredFlag = 1;
954 }
955
956 if (pvlGrp.hasKeyword("MeasureType")) {
957 sType = IString(pvlGrp["MeasureType"][0]).DownCase();
958 }
959
960 if (pbLastFilter) {
962 mOstm << "FileName, SerialNumber, MeasureIgnored, MeasureType, MeasureEditLocked, Reference," << endl;
963 }
964
965 int iNumPoints = mCNet->GetNumPoints();
966 for (int i = (iNumPoints - 1); i >= 0; i--) {
967 const ControlPoint *cPoint = mCNet->GetPoint(i);
968
969 int iNumMeasures = cPoint->GetNumMeasures();
970 int iNotMeasureType = 0;
971 for (int j = 0; j < iNumMeasures; j++) {
972 const ControlMeasure *cMeasure = cPoint->GetMeasure(j);
973 bool bMeasureIgnored = cMeasure->IsIgnored();
974 bool bMeasureFound = false;
975
976 if (iIgnoredFlag == -1 || bMeasureIgnored == iIgnoredFlag) {
977 if (sType == "all" || sType == "") {
978 bMeasureFound = true;
979 }
980 else if (sType == "candidate" && cMeasure->GetType() == ControlMeasure::Candidate) {
981 bMeasureFound = true;
982 }
983 else if (sType == "manual" && cMeasure->GetType() == ControlMeasure::Manual) {
984 bMeasureFound = true;
985 }
986 else if (sType == "registeredpixel" && cMeasure->GetType() == ControlMeasure::RegisteredPixel) {
987 bMeasureFound = true;
988 }
989 else if (sType == "registeredsubpixel" && cMeasure->GetType() == ControlMeasure::RegisteredSubPixel) {
990 bMeasureFound = true;
991 }
992 }
993 if (bMeasureFound) {
994 if (pbLastFilter) {
995 PointStats(*cPoint);
996 QString sn = cMeasure->GetCubeSerialNumber();
997 mOstm << mSerialNumList.fileName(sn) << ", " << sn << ","
998 << sBoolean[(int) cMeasure->IsIgnored()] << ", "
999 << cMeasure->GetMeasureTypeString() << ", "
1000 << sBoolean[cMeasure->IsEditLocked()] << ", "
1001 << sBoolean[cPoint->GetRefMeasure() == cMeasure]
1002 << endl;
1003 }
1004 }
1005 else
1006 iNotMeasureType++;
1007 }
1008 //cerr << cPoint->GetId() << " NumMeasures=" << iNumMeasures << " NotFound=" << iNotMeasureType << endl;
1009 if (iNotMeasureType == iNumMeasures) {
1010 FilterOutPoint(i);
1011 continue;
1012 }
1013 }
1014
1015 // update the image stats with the changes
1017 }
1018
1027 void ControlNetFilter::PointCubeNamesFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
1028 QVector<QString> sCubeNames;
1029
1030 // Store the Cubenames from the PvlGroup
1031 for (int i = 0; i < pvlGrp.keywords(); i++) {
1032 sCubeNames.push_back(pvlGrp[i][0]);
1033 }
1034
1035 int size = sCubeNames.size();
1036
1037 if (pbLastFilter) {
1040 mOstm << ", ImageMeasureIgnored, ImageMeasureEditLocked";
1041 mOstm << endl;
1042 }
1043
1044 int iNumPoints = mCNet->GetNumPoints();
1045 for (int i = (iNumPoints - 1); i >= 0; i--) {
1046 const ControlPoint *cPoint = mCNet->GetPoint(i);
1047 int iNumMeasures = cPoint->GetNumMeasures();
1048 int iNumNoMatch = 0;
1049 bool bMatch = false;
1050 for (int j = 0; j < iNumMeasures; j++) {
1051 const ControlMeasure *cMeasure = cPoint->GetMeasure(j);
1052 for (int k = 0; k < size; k++) {
1053 if (cMeasure->GetCubeSerialNumber() == sCubeNames[k]) {
1054 bMatch = true;
1055 break;
1056 }
1057 }
1058 if (!bMatch) {
1059 iNumNoMatch++;
1060 }
1061 }
1062 if (iNumNoMatch == iNumMeasures) {
1063 FilterOutPoint(i);
1064 }
1065 } //end point loop
1066
1067 // update the image stats with the changes
1069
1070 // If Last filter print to the output file in the required format
1071 if (pbLastFilter) {
1072 iNumPoints = mCNet->GetNumPoints();
1073 for (int i = 0; i < iNumPoints; i++) {
1074 const ControlPoint *cPoint = mCNet->GetPoint(i);
1075 int iNumMeasures = cPoint->GetNumMeasures();
1076 for (int j = 0; j < iNumMeasures; j++) {
1077 const ControlMeasure *cMeasure = cPoint->GetMeasure(j);
1078
1079 // Point Details
1080 mOstm << cPoint->GetId() << ", " << sPointType[cPoint->GetType()] << ", "
1081 << sBoolean[cPoint->IsIgnored()] << ", "
1082 << sBoolean[cPoint->IsEditLocked()] << ", "
1083 << iNumMeasures << ", "
1084 << iNumMeasures - cPoint->GetNumValidMeasures() << ", "
1085 << cPoint->GetNumLockedMeasures() << ", ";
1086
1087 // Image Details
1088 QString sn = cMeasure->GetCubeSerialNumber();
1089 QVector<double> imgStats = GetImageStatsBySerialNum(sn);
1090 mOstm << mSerialNumList.fileName(sn) << ", " << sn << ", "
1091 << imgStats[imgTotalPoints] << ", " << imgStats[imgIgnoredPoints] << ", "
1092 << imgStats[imgLockedPoints] << ", " << imgStats[imgFixedPoints] << ", "
1093 << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", "
1094 << imgStats[imgConvexHullRatio] << ", "
1095 << sBoolean[cMeasure->IsIgnored()] << ", " << sBoolean[cMeasure->IsEditLocked()] << endl;
1096 }
1097 }
1098 }
1099 }
1100
1115 void ControlNetFilter::CubeConvexHullFilter(const PvlGroup &pvlGrp, bool pbLastFilter){
1116 double dLesser = Isis::ValidMaximum;
1117 double dGreater = 0;
1118
1119 if (pvlGrp.hasKeyword("LessThan")) {
1120 if (pvlGrp["LessThan"][0] != "") {
1121 dLesser = fabs((double)pvlGrp["LessThan"]);
1122 }
1123 }
1124
1125 if (pvlGrp.hasKeyword("GreaterThan")) {
1126 if (pvlGrp["GreaterThan"][0] != "") {
1127 dGreater = fabs((double)pvlGrp["GreaterThan"]);
1128 }
1129 }
1130
1131 if (dLesser < 0 || dGreater < 0 || dLesser <= dGreater) {
1132 string sErrMsg = "Invalid Deffile - Check Cube_ConvexHullRatio Group\n";
1133 throw IException(IException::User, sErrMsg, _FILEINFO_);
1134 return;
1135 }
1136
1137 if (pbLastFilter) {
1139 mOstm << endl;
1140 }
1141
1142 int iNumCubes = mSerialNumFilter.size();
1143
1144 for (int sn = (iNumCubes - 1); sn >= 0; sn--) {
1145 QString sSerialNum = mSerialNumFilter.serialNumber(sn);
1146 QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
1147 double convexHullRatio = imgStats[imgConvexHullRatio];
1148 if (convexHullRatio < dGreater || convexHullRatio > dLesser){
1149 FilterOutMeasuresBySerialNum(sSerialNum);
1150 mSerialNumFilter.remove(sSerialNum);
1151 }
1152 else if (pbLastFilter) {
1153 mOstm << mSerialNumFilter.fileName(sSerialNum) << ", " << sSerialNum << ", "
1154 << imgStats[imgTotalPoints] << ", " << imgStats[imgIgnoredPoints] << ", " << imgStats[imgLockedPoints] << ", "
1155 << imgStats[imgFixedPoints] << ", " << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", "
1156 << imgStats[imgConvexHullRatio]<< endl;
1157 }
1158 }
1159
1160 // update the image stats with the changes
1162 }
1163
1173 void ControlNetFilter::CubeNameExpressionFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
1174 QString sCubeExpr("");
1175 if (pvlGrp.hasKeyword("Expression")) {
1176 sCubeExpr = QString(pvlGrp["Expression"][0]);
1177 }
1178
1179 QString sSeparator("*");
1180 QStringList strTokens = sCubeExpr.split(sSeparator, QString::SkipEmptyParts);
1181
1182 int iTokenSize = (int)strTokens.size();
1183 int iNumCubes = mSerialNumFilter.size();
1184
1185 if (pbLastFilter) {
1187 mOstm << endl;
1188 }
1189
1190 for (int i = (iNumCubes - 1); i >= 0; i--) {
1191 QString sCubeName = mSerialNumFilter.fileName(i);
1192 QString sSerialNum = mSerialNumFilter.serialNumber(i);
1193 int iPosition = 0;
1194 for (int j = (iTokenSize - 1); j >= 0; j--) {
1195 int iLen = strTokens[j].length();
1196 if (iLen > 0) {
1197 int found = sSerialNum.indexOf(strTokens[j], iPosition);
1198 if (found != -1) {
1199 iPosition = found + iLen;
1200 // End of the expression - Found
1201 if (j == (iTokenSize - 1)) {
1202 break;
1203 }
1204 }
1205 else {
1206 FilterOutMeasuresBySerialNum(sSerialNum);
1207 mSerialNumFilter.remove(sSerialNum);
1208 break;
1209 }
1210 }
1211 }
1212 }
1213
1214 // update the image stats with the changes
1216
1217 if (pbLastFilter) {
1218 iNumCubes = mSerialNumFilter.size();
1219 for (int i = 0; i < iNumCubes; i++) {
1220 QString sSerialNum = mSerialNumFilter.serialNumber(i);
1221
1222 mOstm << mSerialNumFilter.fileName(i) << ", " << sSerialNum << ", ";
1223 QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
1224 mOstm << mSerialNumFilter.fileName(sSerialNum) << ", " << sSerialNum << ", "
1225 << imgStats[imgTotalPoints] << ", " << imgStats[imgIgnoredPoints] << ", " << imgStats[imgLockedPoints] << ", "
1226 << imgStats[imgFixedPoints] << ", " << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", "
1227 << imgStats[imgConvexHullRatio]<< endl;
1228 }
1229 }
1230 }
1231
1241 void ControlNetFilter::CubeNumPointsFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
1242 int iLessPoints = VALID_MAX2, iGreaterPoints = 0;
1243 if (pvlGrp.hasKeyword("LessThan")) {
1244 if (pvlGrp["LessThan"][0] != "") {
1245 iLessPoints = toInt(pvlGrp["LessThan"][0]);
1246 }
1247 }
1248 if (pvlGrp.hasKeyword("GreaterThan")) {
1249 if (pvlGrp["GreaterThan"][0] != "") {
1250 iGreaterPoints = toInt(pvlGrp["GreaterThan"][0]);
1251 }
1252 }
1253
1254 if (iLessPoints < 0 || iGreaterPoints < 0 || iLessPoints < iGreaterPoints) {
1255 QString sErrMsg = "Invalid Deffile - Check Cube_NumPoints Group\n";
1256 throw IException(IException::User, sErrMsg, _FILEINFO_);
1257 }
1258
1259 if (pbLastFilter) {
1261 mOstm << endl;
1262 }
1263
1264 int iNumCubes = mSerialNumFilter.size();
1265
1266 for (int sn = (iNumCubes - 1); sn >= 0; sn--) {
1267 QString sSerialNum = mSerialNumFilter.serialNumber(sn);
1268 QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
1269 double numPoints = imgStats[imgTotalPoints];
1270 if (numPoints < iGreaterPoints || numPoints > iLessPoints){
1271 FilterOutMeasuresBySerialNum(sSerialNum);
1272 mSerialNumFilter.remove(sSerialNum);
1273 }
1274 else if (pbLastFilter) {
1275 mOstm << mSerialNumFilter.fileName(sSerialNum) << ", " << sSerialNum << ", "
1276 << imgStats[imgTotalPoints] << ", " << imgStats[imgIgnoredPoints] << ", " << imgStats[imgLockedPoints] << ", "
1277 << imgStats[imgFixedPoints] << ", " << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", "
1278 << imgStats[imgConvexHullRatio] << endl;
1279 }
1280 }
1281
1282 // update the image stats with the changes
1284 }
1285
1295 void ControlNetFilter::CubeDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
1296 double dDistance = 0;
1297 QString sUnits = "pixels";
1298
1299 if (pvlGrp.hasKeyword("MaxDistance")) {
1300 if (pvlGrp["MaxDistance"][0] != "") {
1301 dDistance = pvlGrp["MaxDistance"];
1302 }
1303 }
1304
1305 if (pvlGrp.hasKeyword("Units")) {
1306 sUnits = pvlGrp["Units"][0];
1307 }
1308
1309 if (dDistance <= 0) {
1310 string sErrMsg = "Invalid Deffile - Check Cube_Distance Group\n";
1311 throw IException(IException::User, sErrMsg, _FILEINFO_);
1312 return;
1313 }
1314
1315 if (pbLastFilter) {
1317 mOstm << ", Distance_PointIDs >>, " << endl;
1318 }
1319
1320 int iNumCubes = mSerialNumFilter.size();
1321 for (int sn = (iNumCubes - 1); sn >= 0; sn--) {
1322 QString sSerialNum = mSerialNumFilter.serialNumber(sn);
1323 Cube cube(mSerialNumList.fileName(sSerialNum), "r");
1324 Camera *cam = CameraFactory::Create(cube);
1325 double dDist = 0;
1326 bool bMatchDistance = false;
1327
1328 QVector<int> sPointIndex1;
1329 QVector<int> sPointIndex2;
1330 QVector<double> dPointDistance;
1331
1332 // Point stats
1333 int iPointsTotal = 0;
1334 int iPointsIgnored = 0;
1335 int iPointsFixed = 0;
1336 int iPointsConstrained = 0;
1337 int iPointsFree = 0;
1338 int iPointsLocked = 0;
1339
1340 // Reset the vectors
1341 sPointIndex1.clear();
1342 sPointIndex2.clear();
1343 dPointDistance.clear();
1344
1345 int iNumPoints = mCNet->GetNumPoints();
1346 for (int i = 0; i < iNumPoints; i++) {
1347 const ControlPoint *cPoint1 = mCNet->GetPoint(i);
1348 const ControlMeasure *cMeasure1;
1349 bool bImageFound = false;
1350 int iNumMeasures1 = cPoint1->GetNumMeasures();
1351 for (int j = 0; j < iNumMeasures1; j++) {
1352 cMeasure1 = cPoint1->GetMeasure(j);
1353 if (cMeasure1->GetCubeSerialNumber() == sSerialNum) {
1354 iPointsTotal++;
1355 if (cPoint1->IsIgnored()) {
1356 iPointsIgnored++;
1357 }
1358 if (cPoint1->GetType() == ControlPoint::Fixed) {
1359 iPointsFixed++;
1360 }
1361 if (cPoint1->GetType() == ControlPoint::Constrained) {
1362 iPointsConstrained++;
1363 }
1364 if (cPoint1->GetType() == ControlPoint::Free) {
1365 iPointsFree++;
1366 }
1367 if (cPoint1->IsEditLocked()) {
1368 iPointsLocked++;
1369 }
1370 bImageFound = true;
1371 break;
1372 }
1373 }
1374 if (!bImageFound) {
1375 continue;
1376 }
1377
1378 //if(cMeasure1.Sample()==0 && cMeasure1.Line()==0) continue;
1379
1380 // if the user chooses distance in meters, create camera to find lat/lon for this measure
1381 double dRadius = 0, dLat1 = 0, dLon1 = 0;
1382 if (sUnits == "meters") {
1383 // try to set image using sample/line values
1384 if (cam->SetImage(cMeasure1->GetSample(), cMeasure1->GetLine())) {
1385 dRadius = cam->LocalRadius().meters();
1386 dLat1 = cam->UniversalLatitude();
1387 dLon1 = cam->UniversalLongitude();
1388 }
1389 else
1390 continue;
1391 }
1392
1393 for (int k = (i + 1); k < iNumPoints; k++) {
1394 const ControlPoint *cPoint2 = mCNet->GetPoint(k);
1395 int iNumMeasures2 = cPoint2->GetNumMeasures();
1396 const ControlMeasure *cMeasure2;
1397 bool bImageFound2 = false;
1398
1399 for (int j = 0; j < iNumMeasures2; j++) {
1400 if (cPoint2->GetMeasure(j)->GetCubeSerialNumber() == sSerialNum) {
1401 cMeasure2 = cPoint2->GetMeasure(j);
1402 bImageFound2 = true;
1403 break;
1404 }
1405 }
1406 if (!bImageFound2 ||
1407 (cMeasure2->GetSample() == 0 && cMeasure2->GetLine() == 0))
1408 continue;
1409
1410 if (sUnits == "pixels") {
1411 double dDeltaSamp = cMeasure1->GetSample() - cMeasure2->GetSample();
1412 double dDeltaLine = cMeasure1->GetLine() - cMeasure2->GetLine();
1413 // use the distance formula for cartesian coordinates
1414 dDist = sqrt((dDeltaSamp * dDeltaSamp) + (dDeltaLine * dDeltaLine));
1415 }
1416 else
1417 // calculate distance in meters
1418 {
1419 double dLat2 = 0, dLon2 = 0;
1420 if (cam->SetImage(cMeasure2->GetSample(), cMeasure2->GetLine())) {
1421 dLat2 = cam->UniversalLatitude();
1422 dLon2 = cam->UniversalLongitude();
1423 }
1424 else
1425 continue;
1426
1427 // Calculate the distance between the two points
1428 Latitude lat1(dLat1, Angle::Degrees);
1429 Longitude lon1(dLon1, Angle::Degrees);
1430 Latitude lat2(dLat2, Angle::Degrees);
1431 Longitude lon2(dLon2, Angle::Degrees);
1432 Distance radius(dRadius, Distance::Meters);
1433
1434 SurfacePoint point1(lat1, lon1, radius);
1435 SurfacePoint point2(lat2, lon2, radius);
1436
1437 dDist = point1.GetDistanceToPoint(point1, radius).meters();
1438 }
1439 if (!dDist || dDist >= dDistance) {
1440 continue;
1441 }
1442 else {
1443 bMatchDistance = true;
1444 sPointIndex1.push_back(i);
1445 sPointIndex2.push_back(k);
1446 dPointDistance.push_back(dDist);
1447 //break;
1448 }
1449 }// end Loop Point2
1450 //if (bMatchDistance) {
1451 // break;
1452 //}
1453 } //end Loop Point1
1454 if (!bMatchDistance) {
1455 FilterOutMeasuresBySerialNum(sSerialNum);
1456 mSerialNumFilter.remove(sSerialNum);
1457 }
1458 else if (pbLastFilter) {
1459 QVector<double> imgStats = GetImageStatsBySerialNum((sSerialNum));
1460 mOstm << mSerialNumList.fileName(sSerialNum) << ", " << sSerialNum << ", "
1461 << iPointsTotal << ", " << iPointsIgnored << ", " << iPointsLocked << ", "
1462 << iPointsFixed << ", " << iPointsConstrained << ", " << iPointsFree << ", "
1463 << imgStats[ imgConvexHullRatio] << ", ";
1464 for (int j = 0; j < (int)sPointIndex1.size(); j++) {
1465 QString sPointIDDist = toString(dPointDistance[j]);
1466 sPointIDDist += "#";
1467 sPointIDDist += (*mCNet)[sPointIndex1[j]]->GetId();
1468 sPointIDDist += "#";
1469 sPointIDDist += (*mCNet)[sPointIndex2[j]]->GetId();
1470
1471 mOstm << sPointIDDist << ",";
1472 }
1473 mOstm << endl;
1474 }
1475 delete(cam);
1476 } // end cube loop
1477
1478 // update the image stats with the changes
1480 }
1481}
double degrees() const
Get the angle in units of Degrees.
Definition Angle.h:232
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition Angle.h:56
static Camera * Create(Cube &cube)
Creates a Camera object using Pvl Specifications.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition Camera.cpp:156
a control measurement
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
@ Manual
Hand Measured (e.g., qnet)
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
double GetResidualMagnitude() const
Return Residual magnitude.
@ GoodnessOfFit
GoodnessOfFit is pointreg information for reference measures.
double GetNumericalValue() const
Get the value associated with this log data.
void CubeDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by Distance between points in a Cube.
void PointGoodnessOfFitFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by GoodnessOfFit.
void PointLatLonFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Lat Lon Range.
void SetOutputFile(QString psPrintFile)
Set the output print file.
void PointPropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by properties.
SerialNumberList mSerialNumFilter
Serial Number List file.
void PointPixelShiftFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Pixel Shift.
ControlNetFilter(ControlNet *pCNet, QString &psSerialNumFile, Progress *pProgress=0)
Constructor.
void PointDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by distance between points.
void PointMeasurePropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Measure properties.
void CubeNumPointsFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by number of points in the cube.
void PointNumMeasuresEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Measure Edit Lock number.
void CubeConvexHullFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by its ConvexHull Ratio.
void CubeNameExpressionFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by Cube name expression.
void PointCubeNamesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Cube names.
void PointStatsHeader(void)
Standard Point stats Header.
void CubeStatsHeader(void)
Print the standard cube stats Header.
void FilterOutPoint(int pindex)
Check the filtered point to be editlocked before removing from the current control network.
void PointMeasuresFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Number of measures.
void PointStats(const ControlPoint &pcPoint)
Standard Point Stats.
void PrintCubeFileSerialNum(const ControlMeasure &pcMeasure)
Print Cube's File and Serial Number into the Output File.
std::ofstream mOstm
output stream for printing to output file
void PointEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Edit Lock.
void PointIDFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Point ID Expression.
void FilterOutMeasuresBySerialNum(QString serialNum)
Delete the network for an Image given Serial Number for all the Points in the network....
void PointResMagnitudeFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Residual Magnitude.
a control network
Definition ControlNet.h:258
int GetNumPoints() const
Return the number of control points in the network.
QList< ControlMeasure * > GetMeasuresInCube(QString serialNumber)
Get all the measures pertaining to a given cube serial number.
int DeletePoint(ControlPoint *point)
Delete a ControlPoint from the network by the point's address.
ControlNet * mCNet
Control Network.
QVector< double > GetImageStatsBySerialNum(QString psSerialNum) const
Returns the Image Stats by Serial Number.
void GenerateImageStats()
Generate stats like Total, Ignored, Fixed Points in an Image.
SerialNumberList mSerialNumList
Serial Number List.
A single control point.
Status SetEditLock(bool editLock)
Set the EditLock state.
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
IO Handler for Isis Cubes.
Definition Cube.h:168
Distance measurement, usually in meters.
Definition Distance.h:34
@ Meters
The distance is being specified in meters.
Definition Distance.h:43
File name manipulation and expansion.
Definition FileName.h:100
Isis exception class.
Definition IException.h:91
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition IException.h:126
Adds specific functionality to C++ strings.
Definition IString.h:165
IString DownCase()
Converts all upper case letters in the object IString into lower case characters.
Definition IString.cpp:644
This class is designed to encapsulate the concept of a Latitude.
Definition Latitude.h:51
This class is designed to encapsulate the concept of a Longitude.
Definition Longitude.h:40
Program progress reporter.
Definition Progress.h:42
Contains multiple PvlContainers.
Definition PvlGroup.h:41
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Definition Sensor.cpp:212
Latitude GetLatitude() const
Returns a planetocentric latitude object at the surface intersection point in body fixed.
Definition Sensor.cpp:223
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Definition Sensor.cpp:235
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition Sensor.cpp:269
Serial Number list generator.
void remove(const QString &sn)
Remove the specified serial number from the list.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
int size() const
How many serial number / filename combos are in the list.
QString fileName(const QString &sn)
Return a filename given a serial number.
This class defines a body-fixed surface point.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition IString.cpp:93
const double ValidMaximum
The maximum valid double value for Isis pixels.
QString sPointType[]
String names for Point Type.
const double Null
Value for an Isis Null pixel.
const double ValidMinimum
The minimum valid double value for Isis pixels.
QString sBoolean[]
String values for Boolean.
Namespace for the standard library.