|
Isis 3 Programmer Reference
|
12 #include "tnt/tnt_array2d.h"
13 #include "tnt/tnt_array1d.h"
15 #include "DbProfile.h"
16 #include "GruenTypes.h"
17 #include "CollectorMap.h"
18 #include "Statistics.h"
129 BigInt &ptsUsed,
double &resid, GMatrix &atai,
133 const GMatrix &atai);
137 virtual bool CompareFits(
double fit1,
double fit2);
158 EigenSolutionFailed = 3, AffineNotInvertable = 4,
159 MaxIterationsExceeded = 5, RadShiftExceeded = 6,
160 RadGainExceeded = 7, MaxEigenExceeded = 8,
161 AffineDistExceeded = 9
167 ErrorCounter() : m_gerrno(0), m_keyname(
"Unknown"), m_count(0) { }
168 ErrorCounter(
int gerrno,
const QString &keyname) : m_gerrno(gerrno),
169 m_keyname(keyname), m_count(0) { }
171 inline int Errno()
const {
return (m_gerrno); }
172 inline BigInt Count()
const {
return (m_count); }
173 inline void BumpIt() { m_count++; }
186 QString m_filePattern;
204 double m_rgainMinTol;
205 double m_rgainMaxTol;
242 const QString &defval,
int index = 0)
const {
243 if(!conf.
exists(keyname)) {
246 if(conf.
count(keyname) < index) {
249 QString iValue(conf.
value(keyname, index));
251 QString value = tmp.
ToQt();
271 template <
typename T>
273 const T &defval,
int index = 0)
const {
274 if(!conf.
exists(keyname)) {
277 if(conf.
count(keyname) < index) {
280 QString iValue(conf.
value(keyname, index));
300 template <
typename T>
303 const QString &unit =
"")
const {
304 if(m_prof.
exists(keyname)) {
325 const QString &unit =
"")
const {
335 int logError(
int gerrno,
const QString &gerrmsg);
348 return ((
double) (npts - NCONSTR));
353 GMatrix Identity(
const int &ndiag = 3)
const;
354 GMatrix
Choldc(
const GMatrix &a, GVector &p)
const;
355 GMatrix
Cholsl(
const GMatrix &a,
const GVector &p,
356 const GMatrix &b,
const GMatrix &x)
const;
357 int Jacobi(
const GMatrix &a, GVector &evals, GMatrix &evecs,
358 const int &MaxIters = 50)
const;
359 void EigenSort(GVector &evals, GMatrix &evecs)
const;
GMatrix Choldc(const GMatrix &a, GVector &p) const
Compute Cholesky solution.
double getAffineConstraint() const
Returns the Affine tolerance constraint as read from config file.
PvlKeyword ParameterKey(const QString &keyname, const T &value, const QString &unit="") const
Keyword formatter for Gruen parameters.
This class is used to accumulate statistics on double arrays.
virtual double MatchAlgorithm(Chip &pattern, Chip &subsearch)
Minimization of data set using Gruen algorithm.
void WriteSubsearchChips(const QString &pattern="SubChip")
Set up for writing subsearch for a a given registration call.
Store for radiometric gain and shift parameters.
Gruen()
Default constructor.
bool exists(const QString &key) const
Checks for the existance of a keyword.
A single keyword-value pair.
virtual Pvl AlgorithmStatistics(Pvl &pvl)
Create Gruen error and processing statistics Pvl output.
T ConfKey(const DbProfile &conf, const QString &keyname, const T &defval, int index=0) const
Helper method to initialize parameters.
virtual bool CompareFits(double fit1, double fit2)
This virtual method must return if the 1st fit is equal to or better than the second fit.
const AffineRadio & getAffineRadio() const
Return current state of Affine/Radio state
Radiometric getDefaultRadio() const
Returns the default radiometric gain value.
ErrorTypes
Error enumeration values.
void resetStats()
Reset Gruen statistics as needed.
QString ConfKey(const DbProfile &conf, const QString &keyname, const QString &defval, int index=0) const
Helper method to initialize parameters.
int count(const QString &key) const
Report number of values in keyword.
AffineTolerance getAffineTolerance() const
Return set of tolerances for affine convergence.
PvlKeyword ValidateKey(const QString keyname, const double &value, const QString &unit="") const
Checks value of key, produces appropriate value.
void init(Pvl &pvl)
Initialize the object.
Container for affine and radiometric parameters.
int logError(int gerrno, const QString &gerrmsg)
Logs a Gruen error.
BigInt CallCount() const
Returns the current call count.
Container for cube-like labels.
BigInt MinValidPoints(BigInt totalPoints) const
Computes the number of minimum valid points.
PvlGroup ParameterLog() const
Create a PvlGroup with the Gruen specific parameters.
Define a generic Y/X container.
Analysis errorAnalysis(const BigInt &npts, const double &resid, const GMatrix &atai)
Compute the error analysis of convergent Gruen matrix.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
virtual double IdealFit() const
Returns the ideal fit for a perfect Gruen result.
bool IsSpecial(const double d)
Returns if the input pixel is special.
ErrorList initErrorList() const
Creates an error list from know Gruen errors.
Struct that maintains error counts.
MatchPoint getLastMatch() const
Returns the register state of the last successful Gruen match.
CollectorMap< int, ErrorCounter > ErrorList
Declaration of error count list.
const AffineRadio & getDefaultAffineRadio() const
Returns default settings for Affine/Radiometric parameters.
virtual AutoReg::RegisterStatus Registration(Chip &sChip, Chip &pChip, Chip &fChip, int startSamp, int startLine, int endSamp, int endLine, int bestSamp, int bestLine)
Applies the adaptive Gruen algorithm to pattern and search chips.
double getSpiceConstraint() const
Returns the SPICE tolerance constraint as read from config file.
virtual ~Gruen()
Destructor.
Contains multiple PvlContainers.
int Jacobi(const GMatrix &a, GVector &evals, GMatrix &evecs, const int &MaxIters=50) const
Compute the Jacobian of a covariance matrix.
Error analysis of Gruen match point solution.
void EigenSort(GVector &evals, GMatrix &evecs) const
Sort eigenvectors from highest to lowest.
long long int BigInt
Big int.
A DbProfile is a container for access parameters to a database.
bool ValidPoints(BigInt totalPoints, BigInt nPoints) const
Determines if number of points is valid percentage of all points.
RegisterStatus
Enumeration of the Register() method's return status.
Structure containing comprehensive registration info/results.
Coordinate getChipUpdate(Chip &sChip, MatchPoint &point) const
Compute the chip coordinate of the registered pixel.
virtual QString AlgorithmName() const
Returns the default name of the algorithm as Gruen.
void setAffineRadio()
Set affine parameters to defaults.
Container for Affine limits parameters.
A small chip of data used for pattern matching.
static Pvl & getDefaultParameters()
Load default Gruen parameter file in $ISISROOT/appdata/templates.
GMatrix Cholsl(const GMatrix &a, const GVector &p, const GMatrix &b, const GMatrix &x) const
Compute Cholesky solution matrix from correlation.
Adds specific functionality to C++ strings.
Gruen pattern matching algorithm.
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
PvlGroup StatsLog() const
Create a PvlGroup with the Gruen specific statistics.
This is free and unencumbered software released into the public domain.
QString ToQt() const
Retuns the object string as a QString.
double DegreesOfFreedom(const int npts) const
Returns number of degrees of freedom of points.
int algorithm(Chip &pattern, Chip &subsearch, const Radiometric &radio, BigInt &ptsUsed, double &resid, GMatrix &atai, AffineRadio &affrad)
Real workhorse of the computational Gruen algorithm.
AutoReg::RegisterStatus Status(const MatchPoint &result)
Returns the proper status given a Gruen result container.
int CheckConstraints(MatchPoint &point)
Test user limits/contraints after the algorithm has converged.