Isis 3 Developer 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]);
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
std::vector< double > minimumBoundingElipse(std::vector< std::vector< int > > pts, Ellipse *ell)
Definition: Selection.cpp:242
double majorAxis[2]
Definition: Selection.h:34
int centerOfMassWeighted(Chip *inputChip, Chip *selectionChip, double *sample, double *line)
Definition: Selection.cpp:201
virtual ~Selection()
Definition: Selection.cpp:42
double semiMajor
Definition: Selection.h:32
A small chip of data used for pattern matching.
Definition: Chip.h:102
double minorAxis[2]
Definition: Selection.h:35
bool bestFitEllipse(Ellipse *ell, std::vector< std::vector< int > > *pts, double play, unsigned int max_iter)
Definition: Selection.cpp:430
bool ellipseAxesAreaFromMatrix(Ellipse *ell)
Definition: Selection.cpp:595
void selectionEdge(Chip *selectionChip, std::vector< std::vector< int > > *pts)
Definition: Selection.cpp:567
double elipsePercentSelected(Chip *selectionChip, Ellipse *ell)
Definition: Selection.cpp:306
virtual int elipticalReduction(Chip *selectionChip, double percent_selected, double play, int patience_limit)
Definition: Selection.cpp:46
bool ellipseFromCubic(Ellipse *ell, double cubic[6])
Definition: Selection.cpp:399
bool ellipseFromCenterAxesAngle(Ellipse *ell, double centerSample, double centerLine, double semiMajor, double semiMinor, double theta)
Definition: Selection.cpp:767
bool ellipseInChip(Ellipse *ell, Chip *chip)
Definition: Selection.cpp:646
Pure Virtual Parent Class for all Selection classes
Definition: Selection.h:59
double semiMinor
Definition: Selection.h:33
bool ellipseFrom5Pts(Ellipse *ell, double pts[5][2])
Definition: Selection.cpp:345
double area
Definition: Selection.h:37
struct Ellipse Ellipse
Selection()
Definition: Selection.cpp:41
Definition: Selection.h:29
int centerOfMass(Chip *selectionChip, double *sample, double *line)
Definition: Selection.cpp:178
double cen[2]
Definition: Selection.h:36
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool pointInEllipse(Ellipse *ell, double pt[2], double play)
Definition: Selection.cpp:744
double A[3]
Definition: Selection.h:31
virtual int select(Chip *inputChip, Chip *selectionChip)=0