Isis Developer Reference
Selection.h
Go to the documentation of this file.
1#ifndef Selection_h
2#define Selection_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include "Chip.h"
11#include "Statistics.h"
12
13typedef 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
24namespace 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
struct Ellipse Ellipse
This is free and unencumbered software released into the public domain.
A small chip of data used for pattern matching.
Definition Chip.h:86
Pure Virtual Parent Class for all Selection classes.
Definition Selection.h:43
virtual int select(Chip *inputChip, Chip *selectionChip)=0
bool bestFitEllipse(Ellipse *ell, std::vector< std::vector< int > > *pts, double play, unsigned int max_iter)
Definition Selection.cpp:416
virtual int elipticalReduction(Chip *selectionChip, double percent_selected, double play, int patience_limit)
Definition Selection.cpp:32
bool ellipseFromCubic(Ellipse *ell, double cubic[6])
Definition Selection.cpp:385
virtual ~Selection()
Definition Selection.cpp:28
int centerOfMass(Chip *selectionChip, double *sample, double *line)
Definition Selection.cpp:164
bool ellipseFromCenterAxesAngle(Ellipse *ell, double centerSample, double centerLine, double semiMajor, double semiMinor, double theta)
Definition Selection.cpp:753
void selectionEdge(Chip *selectionChip, std::vector< std::vector< int > > *pts)
Definition Selection.cpp:553
bool ellipseFrom5Pts(Ellipse *ell, double pts[5][2])
Definition Selection.cpp:331
bool ellipseInChip(Ellipse *ell, Chip *chip)
Definition Selection.cpp:632
std::vector< double > minimumBoundingElipse(std::vector< std::vector< int > > pts, Ellipse *ell)
Definition Selection.cpp:228
bool pointInEllipse(Ellipse *ell, double pt[2], double play)
Definition Selection.cpp:730
bool ellipseAxesAreaFromMatrix(Ellipse *ell)
Definition Selection.cpp:581
Selection()
Definition Selection.cpp:27
int centerOfMassWeighted(Chip *inputChip, Chip *selectionChip, double *sample, double *line)
Definition Selection.cpp:187
double elipsePercentSelected(Chip *selectionChip, Ellipse *ell)
Definition Selection.cpp:292
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
This is free and unencumbered software released into the public domain.
Definition Selection.h:14
double A[3]
Definition Selection.h:15
double minorAxis[2]
Definition Selection.h:19
double semiMinor
Definition Selection.h:17
double semiMajor
Definition Selection.h:16
double area
Definition Selection.h:21
double cen[2]
Definition Selection.h:20
double majorAxis[2]
Definition Selection.h:18