Isis Developer Reference
Selection.h
Go to the documentation of this file.
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;
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]);
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
Ellipse::minorAxis
double minorAxis[2]
Definition: Selection.h:19
Ransac.h
Ellipse::area
double area
Definition: Selection.h:21
Isis::Selection::bestFitEllipse
bool bestFitEllipse(Ellipse *ell, std::vector< std::vector< int > > *pts, double play, unsigned int max_iter)
Definition: Selection.cpp:418
Isis::Selection::ellipseInChip
bool ellipseInChip(Ellipse *ell, Chip *chip)
Definition: Selection.cpp:634
Isis::Chip::GetValue
double GetValue(int sample, int line)
Loads a Chip with a value.
Definition: Chip.h:145
Isis::Selection::pointInEllipse
bool pointInEllipse(Ellipse *ell, double pt[2], double play)
Definition: Selection.cpp:732
Isis::Selection::Selection
Selection()
Definition: Selection.cpp:29
Isis::isymp
int isymp(int row, int col)
Definition: Ransac.h:20
Isis::Selection
Pure Virtual Parent Class for all Selection classes.
Definition: Selection.h:43
Isis::Selection::selectionEdge
void selectionEdge(Chip *selectionChip, std::vector< std::vector< int > > *pts)
Definition: Selection.cpp:555
Ellipse::semiMinor
double semiMinor
Definition: Selection.h:17
Isis::Selection::elipsePercentSelected
double elipsePercentSelected(Chip *selectionChip, Ellipse *ell)
Definition: Selection.cpp:294
Isis::Chip::SetValue
void SetValue(int sample, int line, const double &value)
Sets a value in the chip.
Definition: Chip.h:126
Isis::Selection::ellipseFromCubic
bool ellipseFromCubic(Ellipse *ell, double cubic[6])
Definition: Selection.cpp:387
Ellipse::majorAxis
double majorAxis[2]
Definition: Selection.h:18
GSLUtility.h
Isis::Selection::minimumBoundingElipse
std::vector< double > minimumBoundingElipse(std::vector< std::vector< int > > pts, Ellipse *ell)
Definition: Selection.cpp:230
Isis::Chip::Lines
int Lines() const
Definition: Chip.h:106
Ellipse::semiMajor
double semiMajor
Definition: Selection.h:16
Isis::Selection::centerOfMass
int centerOfMass(Chip *selectionChip, double *sample, double *line)
Definition: Selection.cpp:166
Ellipse::cen
double cen[2]
Definition: Selection.h:20
Isis::Selection::ellipseAxesAreaFromMatrix
bool ellipseAxesAreaFromMatrix(Ellipse *ell)
Definition: Selection.cpp:583
Isis::choleski_solve
int choleski_solve(double *a, double *b, int nsize, int flag)
Definition: Ransac.h:131
Selection.h
Isis::Selection::ellipseFromCenterAxesAngle
bool ellipseFromCenterAxesAngle(Ellipse *ell, double centerSample, double centerLine, double semiMajor, double semiMinor, double theta)
Definition: Selection.cpp:755
Ellipse
struct Ellipse Ellipse
This is free and unencumbered software released into the public domain.
Isis::Selection::~Selection
virtual ~Selection()
Definition: Selection.cpp:30
Statistics.h
std
Namespace for the standard library.
Isis::Selection::select
virtual int select(Chip *inputChip, Chip *selectionChip)=0
Isis::Selection::elipticalReduction
virtual int elipticalReduction(Chip *selectionChip, double percent_selected, double play, int patience_limit)
Definition: Selection.cpp:34
Isis::Chip
A small chip of data used for pattern matching.
Definition: Chip.h:86
Isis::Chip::Samples
int Samples() const
Definition: Chip.h:99
Ellipse::A
double A[3]
Definition: Selection.h:15
Isis::Selection::centerOfMassWeighted
int centerOfMassWeighted(Chip *inputChip, Chip *selectionChip, double *sample, double *line)
Definition: Selection.cpp:189
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
Chip.h
Isis::Selection::ellipseFrom5Pts
bool ellipseFrom5Pts(Ellipse *ell, double pts[5][2])
Definition: Selection.cpp:333