Isis 3 Programmer Reference
Selection.h
1 #ifndef Selection_h
2 #define Selection_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include "Chip.h"
11 #include "Statistics.h"
12 
13 typedef struct Ellipse
14 {
15  double A[3];
16  double semiMajor;
17  double semiMinor;
18  double majorAxis[2];
19  double minorAxis[2];
20  double cen[2];
21  double area;
22 }Ellipse;
23 
24 namespace Isis {
43  class Selection {
44  public:
45  Selection();
46  virtual ~Selection();
47 
48  virtual int select(Chip *inputChip,Chip *selectionChip)=0; //pure virtual function to be redefined in each child class
49 
50  //Reduction methods--methods used to trim off outliers in the selection based on aprior knowledge of the expected shape
51  virtual int elipticalReduction(Chip *selectionChip, double percent_selected, double play, int patience_limit); //a general, but slow elliptical trimming is provided, it is virtual so it can redefined to take advantage of differing levels of apriori knowlege of the characteristics of the ellipse
52 
53  //Observation Methods--methods used to reduce a selection to a single sub-pixel observation
54  int centerOfMass(Chip *selectionChip, double *sample, double *line);
55  int centerOfMassWeighted(Chip *inputChip, Chip *selectionChip, double *sample, double *line);
56 
57  //Sub-tasks for elliptical trimming and ellipse fitting
58  bool ellipseFrom5Pts(Ellipse *ell,double pts[5][2]);
59  double elipsePercentSelected(Chip *selectionChip,Ellipse *ell);
60  std::vector<double> minimumBoundingElipse( std::vector< std::vector<int> > pts,Ellipse *ell);
61  bool ellipseFromCubic(Ellipse *ell, double cubic[6]);
62  bool ellipseAxesAreaFromMatrix(Ellipse *ell);
63  bool bestFitEllipse(Ellipse *ell, std::vector < std::vector<int> > *pts,double play,unsigned int max_iter);
64  bool pointInEllipse(Ellipse *ell, double pt[2],double play);
65  bool ellipseInChip(Ellipse *ell, Chip *chip);
66  bool ellipseFromCenterAxesAngle(Ellipse *ell, double centerSample, double centerLine, double semiMajor, double semiMinor, double theta);
67 
68  void selectionEdge(Chip *selectionChip, std::vector < std::vector <int> > *pts);
69  };
70 };
71 
72 #endif
Isis::Selection
Pure Virtual Parent Class for all Selection classes.
Definition: Selection.h:43
Isis::Chip
A small chip of data used for pattern matching.
Definition: Chip.h:86
Ellipse
This is free and unencumbered software released into the public domain.
Definition: Selection.h:14
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16