15#include <tnt/tnt_array1d.h>
16#include <tnt/tnt_array2d.h>
17#include <tnt/tnt_array2d_utils.h>
58 m_x(chip.CubeSample()){ }
62 void setLatLon(
const double &latitude,
const double &longitude) {
77 if (
isValid() && other.isValid()) {
89 if (
isValid() && other.isValid() ) {
101 double yd = pntA.m_y -
m_y;
102 double xd = pntA.m_x -
m_x;
103 return (std::sqrt((xd * xd) + (yd * yd)));
266 trans[1][2] = offset.
getLine();
285 void clone(
const GVector &alpha) {
286 if ( alpha.dim1() != 8 ) {
287 QString mess =
"Alpha array for AffineRadio must have 8 elements "
288 " but has " +
toString(alpha.dim1());
323 const double &shearTol) :
m_transTol(transTol),
352 m_thresh[0] = tolerance.m_scaleTol / (((double)(chip.
Samples() - 1)) / 2.0);
353 m_thresh[1] = tolerance.m_shearTol / (((double)(chip.
Lines() - 1)) / 2.0);
356 m_thresh[3] = tolerance.m_shearTol / (((double)(chip.
Samples() - 1)) / 2.0);
357 m_thresh[4] = tolerance.m_scaleTol / (((double)(chip.
Lines() - 1)) / 2.0);
365 const double *alpha = Malpha[0];
366 for (
int i = 0 ; i <
m_thresh.dim1() ; i++ ) {
367 if ( std::fabs(alpha[i]) >=
m_thresh[i] )
return (
false);
386 for (
int i = 0 ; i < 2 ; i++ ) {
404 for (
int i = 0 ; i < 2 ; i++ ) {
#define _FILEINFO_
Macro for the filename and line number.
Definition IException.h:24
Affine basis function.
Definition Affine.h:65
static AMatrix getIdentity()
Return an Affine identity matrix.
Definition Affine.cpp:61
TNT::Array2D< double > AMatrix
Affine Matrix.
Definition Affine.h:67
Container for affine and radiometric parameters.
Definition GruenTypes.h:242
Coordinate getPoint(const Coordinate &location) const
Applies the affine transfrom to a point and returns result.
Definition GruenTypes.h:272
AffineRadio & operator+=(const AffineRadio &other)
Define update procedure for accumulating Gruen iterations.
Definition GruenTypes.h:256
AffineRadio(const GMatrix &M, const double &shift, const double &gain)
Definition GruenTypes.h:246
AffineRadio(const Radiometric &radio)
Definition GruenTypes.h:251
GMatrix m_affine
Definition GruenTypes.h:280
void Translate(const Coordinate &offset)
Apply a translation to the given offset.
Definition GruenTypes.h:263
~AffineRadio()
Definition GruenTypes.h:253
AffineRadio(const GVector &alpha)
Definition GruenTypes.h:248
AffineRadio()
Definition GruenTypes.h:244
AffineRadio(const GMatrix &A)
Definition GruenTypes.h:245
Radiometric m_radio
Definition GruenTypes.h:281
A small chip of data used for pattern matching.
Definition Chip.h:86
int Samples() const
Definition Chip.h:99
int Lines() const
Definition Chip.h:106
Define a generic Y/X container.
Definition GruenTypes.h:53
double getSample() const
Definition GruenTypes.h:114
double getLine() const
Definition GruenTypes.h:113
Coordinate(const Chip &chip)
Definition GruenTypes.h:57
Coordinate()
Definition GruenTypes.h:55
double getLongitude() const
Definition GruenTypes.h:112
Coordinate & operator-=(const Coordinate &other)
Subtract a point from this point.
Definition GruenTypes.h:88
bool isValid() const
Check for goodness.
Definition GruenTypes.h:107
void setLatLon(const double &latitude, const double &longitude)
Use Latitude/Longitude interface.
Definition GruenTypes.h:62
Coordinate & operator+=(const Coordinate &other)
Add a point to this point.
Definition GruenTypes.h:76
void setLineSamp(const double &line, const double &sample)
Use the Line/Sample interface.
Definition GruenTypes.h:69
double getLatitude() const
Definition GruenTypes.h:111
~Coordinate()
Definition GruenTypes.h:59
Coordinate(double y, double x)
Definition GruenTypes.h:56
double getDistance(const Coordinate &pntA=Coordinate(0.0, 0.0)) const
Computes the distance from this point and the point provided.
Definition GruenTypes.h:100
double m_x
Definition GruenTypes.h:117
double m_y
Definition GruenTypes.h:116
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
Structure containing comprehensive registration info/results.
Definition GruenTypes.h:433
int m_status
Definition GruenTypes.h:461
MatchPoint(const AffineRadio &radio)
Definition GruenTypes.h:436
int getStatus() const
Definition GruenTypes.h:442
double getEigen() const
Definition GruenTypes.h:449
Coordinate getAffinePoint(const Coordinate &coord=Coordinate(0.0, 0.0)) const
Return registration offset of a given chip coordinate from center
Definition GruenTypes.h:452
Analysis m_analysis
Definition GruenTypes.h:459
PointPair m_point
Definition GruenTypes.h:457
int m_nIters
Definition GruenTypes.h:460
bool isValid() const
Definition GruenTypes.h:448
const MatchPoint & setStatus(int status)
Definition GruenTypes.h:443
AffineRadio m_affine
Definition GruenTypes.h:458
MatchPoint(const PointPair &point)
Definition GruenTypes.h:438
MatchPoint()
Definition GruenTypes.h:435
~MatchPoint()
Definition GruenTypes.h:440
Define a point set of left, right and geometry at that location.
Definition GruenTypes.h:171
double getLeftSample() const
Definition GruenTypes.h:190
double getRightSample() const
Definition GruenTypes.h:192
bool isValid() const
Left, right and geometry coordinates must all be good data.
Definition GruenTypes.h:181
Coordinate m_left
Definition GruenTypes.h:194
double getLeftLine() const
Definition GruenTypes.h:189
double getRightLine() const
Definition GruenTypes.h:191
PointPair()
Definition GruenTypes.h:173
double getSample() const
Definition GruenTypes.h:188
PointPair(const double &line, const double &sample)
Definition GruenTypes.h:174
PointPair(const Coordinate &left, const Coordinate &right=Coordinate())
Definition GruenTypes.h:176
const Coordinate & getRight() const
Definition GruenTypes.h:185
const Coordinate & getLeft() const
Definition GruenTypes.h:184
double getLine() const
Definition GruenTypes.h:187
Coordinate m_right
Definition GruenTypes.h:195
Store for radiometric gain and shift parameters.
Definition GruenTypes.h:206
double m_gain
Definition GruenTypes.h:224
double m_shift
Definition GruenTypes.h:223
Radiometric(const double &shift, const double &gain)
Definition GruenTypes.h:209
Radiometric & operator+=(const Radiometric &B)
Add radiometric parameters from another set of parameters.
Definition GruenTypes.h:217
Radiometric()
Definition GruenTypes.h:208
double Gain() const
Definition GruenTypes.h:213
double Shift() const
Definition GruenTypes.h:212
Compute/test the Affine convergence from given parameters/chip.
Definition GruenTypes.h:348
~Threshold()
Definition GruenTypes.h:360
bool hasConverged(const AffineRadio &affine) const
Determines convergence from an affine/radiometric fit.
Definition GruenTypes.h:363
Threshold()
Definition GruenTypes.h:350
Threshold(const Chip &chip, const AffineTolerance &tolerance)
Definition GruenTypes.h:351
GVector m_thresh
Definition GruenTypes.h:372
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
Affine::AMatrix GMatrix
Definition GruenTypes.h:29
@ NCONSTR
Definition GruenTypes.h:33
TNT::Array1D< double > GVector
Definition GruenTypes.h:30
const double Null
Value for an Isis Null pixel.
Definition SpecialPixel.h:95
long long int BigInt
Big int.
Definition Constants.h:49
Coordinate operator+(const Coordinate &A, const Coordinate &B)
Summation operator for Coordinate.
Definition GruenTypes.h:130
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition SpecialPixel.h:197
Coordinate operator-(const Coordinate &A, const Coordinate &B)
Subtraction operator for Coordinate.
Definition GruenTypes.h:148
Container for Affine limits parameters.
Definition GruenTypes.h:319
double m_shearTol
Definition GruenTypes.h:330
double m_transTol
Definition GruenTypes.h:328
AffineTolerance(const double &transTol, const double &scaleTol, const double &shearTol)
Definition GruenTypes.h:322
double m_scaleTol
Definition GruenTypes.h:329
~AffineTolerance()
Definition GruenTypes.h:326
AffineTolerance()
Definition GruenTypes.h:321
Error analysis of Gruen match point solution.
Definition GruenTypes.h:383
bool isValid() const
Definition GruenTypes.h:393
void setZeroState()
Resets eigenvalues to 0.
Definition GruenTypes.h:403
Analysis()
Definition GruenTypes.h:384
double getEigen() const
Returns the square of the of sum of the squares of eigenvalues.
Definition GruenTypes.h:396
double m_kmat[2]
Definition GruenTypes.h:415
int m_status
Definition GruenTypes.h:416
BigInt m_npts
Definition GruenTypes.h:412
~Analysis()
Definition GruenTypes.h:391
double m_variance
Definition GruenTypes.h:413
double m_sevals[2]
Definition GruenTypes.h:414