Isis 3 Programmer Reference
Selection.h
Go to the documentation of this file.
1 #ifndef Selection_h
2 #define Selection_h
3 
26 #include "Chip.h"
27 #include "Statistics.h"
28 
29 typedef struct Ellipse
30 {
31  double A[3];
32  double semiMajor;
33  double semiMinor;
34  double majorAxis[2];
35  double minorAxis[2];
36  double cen[2];
37  double area;
38 }Ellipse;
39 
40 namespace Isis {
59  class Selection {
60  public:
61  Selection();
62  virtual ~Selection();
63 
64  virtual int select(Chip *inputChip,Chip *selectionChip)=0; //pure virtual function to be redefined in each child class
65 
66  //Reduction methods--methods used to trim off outliers in the selection based on aprior knowledge of the expected shape
67  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
68 
69  //Observation Methods--methods used to reduce a selection to a single sub-pixel observation
70  int centerOfMass(Chip *selectionChip, double *sample, double *line);
71  int centerOfMassWeighted(Chip *inputChip, Chip *selectionChip, double *sample, double *line);
72 
73  //Sub-tasks for elliptical trimming and ellipse fitting
74  bool ellipseFrom5Pts(Ellipse *ell,double pts[5][2]);
75  double elipsePercentSelected(Chip *selectionChip,Ellipse *ell);
76  std::vector<double> minimumBoundingElipse( std::vector< std::vector<int> > pts,Ellipse *ell);
77  bool ellipseFromCubic(Ellipse *ell, double cubic[6]);
78  bool ellipseAxesAreaFromMatrix(Ellipse *ell);
79  bool bestFitEllipse(Ellipse *ell, std::vector < std::vector<int> > *pts,double play,unsigned int max_iter);
80  bool pointInEllipse(Ellipse *ell, double pt[2],double play);
81  bool ellipseInChip(Ellipse *ell, Chip *chip);
82  bool ellipseFromCenterAxesAngle(Ellipse *ell, double centerSample, double centerLine, double semiMajor, double semiMinor, double theta);
83 
84  void selectionEdge(Chip *selectionChip, std::vector < std::vector <int> > *pts);
85  };
86 };
87 
88 #endif
A small chip of data used for pattern matching.
Definition: Chip.h:102
Pure Virtual Parent Class for all Selection classes
Definition: Selection.h:59
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31