USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Gruen Class Reference
[Pattern Matching]

#include <Gruen.h>

Inheritance diagram for Isis::Gruen:

Inheritance graph
[legend]
Collaboration diagram for Isis::Gruen:

Collaboration graph
[legend]
List of all members.

Detailed Description

Gruen pattern matching algorithm.

This class provides adaptive image (chip) registration using the AutoReg factory architecture. This algorithm uses an Affine transform to iteratively adjust the search chip at each iteration. Each iteration solves for new adjustments to the Affine transform until the 6 affine parameters fall below the tolerances as specified in AffineThreshHold1 and AffineThreshHold2.

This class minimizes the 6 specifiable Affine transform components of a 3x3 matrix. The three Affine components for X (sample) and Y (line) are scale, shear and translation. Gruen provides control over the maximum values these three components should attain in order for the registration to converge to a successful match. These limits are specified by AffineScaleTolerance, AffineShearTolerance and AffineTranslationTolerance. AffineShearTolerance is optional and if not specified, it defaults to the value of AffineScaleTolerance. These tolerances specify the maximum amount of translation pixels can be shifted between one Gruen iteration and another. For example, AffineTranslationTolerance = 0.2 means that a subsearch chip cannot move in sample or line direction more than 0.2 pixels in order to satisfy convergence. AffineScaleTolerance constrains the sample and line scale elements of the Affine transformation. And AffineShearTolerance constrains the sample and line shear elements of the Affine transformation. The scale and shear parameters are scaled by size of the Chip. The sample scale and shear Affine components maximum limit is computed as AffineScaleTolerance/((Samples-1)/2) and AffineShearTolerance/((Samples-1)/2). Likewise, the line scale and shear maximums are computed using Lines in the preceding equation.

See also:
MinimumGruen AdaptiveGruen AutoReg
Author:
2009-09-09 Kris Becker

For internal use only.

History:
2009-09-10 Kris Becker Changed AffineThreshHold1 to AffineTranslationTolerance and AffineThreshHold2 to AffineScaleTolerance. Added AffineShearTolerance. Added logging of Gruen parameters.
History:
2009-09-11 Kris Becker Minor error in computation of radiometric shift

Definition at line 83 of file Gruen.h.

Public Types

 Success
 Success.
 PatternChipNotEnoughValidData
 Not enough valid data in pattern chip.
 FitChipNoData
 Fit chip did not have any valid data.
 FitChipToleranceNotMet
 Goodness of fit tolerance not satisfied.
 SurfaceModelNotEnoughValidData
 Not enough points to fit a surface model for sub-pixel accuracy.
 SurfaceModelSolutionInvalid
 Could not model surface for sub-pixel accuracy.
 SurfaceModelDistanceInvalid
 Surface model moves registration more than one pixel.
 PatternZScoreNotMet
 Pattern data max or min does not pass the z-score test.
 SurfaceModelEccentricityRatioNotMet
 Ellipse eccentricity of the surface model not satisfied.
 AdaptiveAlgorithmFailed
 Error occured in Adaptive algorithm.
enum  RegisterStatus {
  Success, PatternChipNotEnoughValidData, FitChipNoData, FitChipToleranceNotMet,
  SurfaceModelNotEnoughValidData, SurfaceModelSolutionInvalid, SurfaceModelDistanceInvalid, PatternZScoreNotMet,
  SurfaceModelEccentricityRatioNotMet, AdaptiveAlgorithmFailed
}

Public Member Functions

 Gruen (Pvl &pvl)
 Basic Gruen algorithm constructor.
virtual ~Gruen ()
 Destructor.
virtual bool IsAdaptive ()
 Gruen default mode is adaptive.
double Gain () const
 Returns the radiometric gain value from the last solution.
double Shift () const
 Returns the radiometric shift value from the last solution.
void SetRadiometrics (const double &gain=0.0, const double &shift=0.0)
 Sets established radiometric parameters for registration processes.
double SpiceTolerance () const
 Returns the SPICE tolerance constraint as read from config file.
double AffineTolerance () const
 Returns the Affine tolerance constraint as read from config file.
GruenResult algorithm (Chip &pattern, Chip &subsearch)
 Real workhorse of the computational Gruen algorithm.
const GruenResultResults () const
 Returns the results container from the last solution.
bool IsGood () const
 Returns status of the last registration result.
bool IsGood (const GruenResult &result) const
 Returns the status of the given Gruen result container.
ChipPatternChip ()
 Return pointer to pattern chip.
ChipSearchChip ()
 Return pointer to search chip.
ChipFitChip ()
 Return pointer to search chip.
ChipReducedPatternChip ()
 Return pointer to reduced pattern chip.
ChipReducedSearchChip ()
 Return pointer to reduced search chip.
ChipReducedFitChip ()
 Return pointer to reduced fix chip.
void SetSubPixelAccuracy (bool on)
 If the sub-accuracy is enable the Register() method will attempt to match the pattern chip to the search chip at sub-pixel accuracy, otherwise it will be registered at whole pixel accuracy.
void SetPatternValidPercent (const double percent)
 Set the amount of data in the pattern chip that must be valid.
void SetTolerance (double tolerance)
 Set the tolerance for an acceptable goodness of fit.
void SetSurfaceModelWindowSize (int size)
 Set the surface model window size.
void SetSurfaceModelDistanceTolerance (double distance)
 Set a distance the surface model solution is allow to move away from the best whole pixel fit in the fit chip.
void SetReductionFactor (int reductionFactor)
 Set the reduction factor used to speed up the pattern matching algorithm.
void SetPatternZScoreMinimum (double minimum)
 Set the minimum pattern zscore.
void SetSurfaceModelEccentricityRatio (double ratioTolerance)
 A 1:1 ratio represents a perfect circle.
double PatternValidPercent () const
 Return pattern valid percent.
double Tolerance () const
 Return match algorithm tolerance.
AutoReg::RegisterStatus Register ()
 Walk the pattern chip through the search chip to find the best registration.
double GoodnessOfFit () const
 Return the goodness of fit of the match algorithm.
bool IsIdeal (double fit)
double ChipSample () const
 Return the search chip sample that best matched.
double ChipLine () const
 Return the search chip line that best matched.
double CubeSample () const
 Return the search chip cube sample that best matched.
double CubeLine () const
 Return the search chip cube line that best matched.
void ZScores (double &score1, double &score2) const
 Return the ZScores of the pattern chip.
Pvl RegistrationStatistics ()
 This returns the cumulative registration statistics.
PvlGroup RegTemplate ()
 This function returns the keywords that this object was created from.

Protected Types

typedef GSL::GSLUtility::GSLMatrix GSLMatrix
typedef GSL::GSLUtility::GSLVector GSLVector

Protected Member Functions

virtual std::string AlgorithmName () const
 Returns the default name of the algorithm as Gruen.
bool solve (GruenResult &result)
 Computes solution and error analysis using Cholesky/Jacobi methods.
virtual double MatchAlgorithm (Chip &pattern, Chip &subsearch)
 Minimization of data set using Gruen algorithm.
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.
virtual double IdealFit () const
 Returns the ideal fit for a perfect Gruen result.
virtual AutoReg::RegisterStatus AdaptiveRegistration (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.
virtual Pvl AlgorithmStatistics (Pvl &pvl)
 Create Gruen error and processing statistics Pvl output.
void SetChipSample (double sample)
 Sets the search chip subpixel sample that matches the pattern tack sample.
void SetChipLine (double line)
 Sets the search chip subpixel line that matches the pattern tack line.
void SetGoodnessOfFit (double fit)
 Sets the goodness of fit for adaptive algorithms.
void Parse (Pvl &pvl)
 Initialize parameters in the AutoReg class using a PVL specification.
bool ModelSurface (std::vector< double > &x, std::vector< double > &y, std::vector< double > &z)
 We will model a 2-d surface as:.
Chip Reduce (Chip &chip, int reductionFactor)
 This method reduces the given chip by the given reduction factor.

Protected Attributes

PvlObject p_template
 AutoRegistration object that created this projection.

Private Types

typedef CollectorMap< int,
ErrorCounter
ErrorList
 Declaration of error count list.
 NotEnoughPoints = 1
 CholeskyFailed = 2
 EigenSolutionFailed = 3
 AffineNotInvertable = 4
 MaxIterationsExceeded = 5
 RadShiftExceeded = 6
 RadGainExceeded = 7
 MaxEigenExceeded = 8
 AffineDistExceeded = 9
enum  GruenErrors {
  NotEnoughPoints = 1, CholeskyFailed = 2, EigenSolutionFailed = 3, AffineNotInvertable = 4,
  MaxIterationsExceeded = 5, RadShiftExceeded = 6, RadGainExceeded = 7, MaxEigenExceeded = 8,
  AffineDistExceeded = 9
}
 Error enumeration values. More...

Private Member Functions

template<typename T>
ConfKey (const DbProfile &conf, const std::string &keyname, const T &defval, int index=0) const
 Helper method to initialize parameters.
template<typename T>
PvlKeyword ParameterKey (const std::string &keyname, const T &value, const std::string &unit="") const
 Keyword formatter for Gruen parameters.
PvlKeyword ValidateKey (const std::string keyname, const double &value, const std::string &unit="") const
 Checks value of key, produces appropriate value.
ErrorList initErrorList () const
 Creates an error list from know Gruen errors.
void logError (int gerrno, const std::string &gerrmsg)
 Logs a Gruen error.
PvlGroup StatsLog () const
 Create a PvlGroup with the Gruen specific statistics.
PvlGroup ParameterLog () const
 Create a PvlGroup with the Gruen specific parameters.
void init (Pvl &pvl)
 Initialize the object.
double getDefaultGain () const
 Returns the default radiometric gain value.
double getDefaultShift () const
 Returns the default radiometric shift value.
void reset ()
 Reset registration-dependant counters only.
void resetStats ()
 Reset Gruen statistics as needed.
GSLVector getThreshHold (const Chip &chip) const
 Compute the Affine convergence parameters.
bool HasConverged (const GSLVector &alpha, const GSLVector &thresh, const GruenResult &results) const
 Tests Affine parameters for convergence.
BigInt MinValidPoints (BigInt totalPoints) const
 Computes the number of minimum valid points.
bool ValidPoints (BigInt totalPoints, BigInt nPoints) const
 Determines if number of points is valid percentage of all points.
void ErrorAnalysis (GruenResult &result)
 Computes/determines error analysis after the solution converges.
bool TestConstraints (const bool &done, GruenResult &result)
 Test user limits/contraints after the algorithm has converged.
Affine UpdateAffine (GruenResult &result, const Affine &gtrans)
 Updates the affine transform with the final iterative solution.
void UpdateChip (Chip &sChip, const Affine &affine)
 Updates the (search) chip with the final Affine transform.
bool CheckAffineTolerance ()
 Check affine tolerance for validity.
AutoReg::RegisterStatus Status (const GruenResult &result) const
 Returns the proper status given a Gruen result container.
AutoReg::RegisterStatus Status () const
 Returns status of the last Gruen registration result.

Private Attributes

DbProfile _prof
int _maxIters
double _transTol
double _scaleTol
double _shearTol
double _affineTol
double _spiceTol
double _rgainMinTol
double _rgainMaxTol
double _rshiftTol
double _fitChipScale
int _nIters
GruenResult _result
 last result, cummulative
BigInt _totalIterations
ErrorList _errors
BigInt _unclassified
double _defGain
double _defShift
Statistics _eigenStat
Statistics _iterStat
Statistics _shiftStat
Statistics _gainStat

Classes

struct  ErrorCounter
 Structure that maintains error counts. More...


Member Typedef Documentation

typedef CollectorMap<int, ErrorCounter> Isis::Gruen::ErrorList [private]

Declaration of error count list.

Definition at line 179 of file Gruen.h.


Member Enumeration Documentation

enum Isis::Gruen::GruenErrors [private]

Error enumeration values.

Definition at line 158 of file Gruen.h.

enum Isis::AutoReg::RegisterStatus [inherited]

Enumerator:
Success  Success.
PatternChipNotEnoughValidData  Not enough valid data in pattern chip.
FitChipNoData  Fit chip did not have any valid data.
FitChipToleranceNotMet  Goodness of fit tolerance not satisfied.
SurfaceModelNotEnoughValidData  Not enough points to fit a surface model for sub-pixel accuracy.
SurfaceModelSolutionInvalid  Could not model surface for sub-pixel accuracy.
SurfaceModelDistanceInvalid  Surface model moves registration more than one pixel.
PatternZScoreNotMet  Pattern data max or min does not pass the z-score test.
SurfaceModelEccentricityRatioNotMet  Ellipse eccentricity of the surface model not satisfied.
AdaptiveAlgorithmFailed  Error occured in Adaptive algorithm.

Definition at line 126 of file AutoReg.h.


Constructor & Destructor Documentation

Isis::Gruen::Gruen ( Pvl pvl  ) 

Basic Gruen algorithm constructor.

This will construct a minimum difference search algorith. It is recommended that you use a AutoRegFactory class as opposed to this constructor

Parameters:
pvl A Pvl object that contains a valid automatic registration definition

Definition at line 41 of file Gruen.cpp.

References init(), and pvl().

virtual Isis::Gruen::~Gruen (  )  [inline, virtual]

Destructor.

Definition at line 98 of file Gruen.h.


Member Function Documentation

AutoReg::RegisterStatus Isis::Gruen::AdaptiveRegistration ( Chip sChip,
Chip pChip,
Chip fChip,
int  startSamp,
int  startLine,
int  endSamp,
int  endLine,
int  bestSamp,
int  bestLine 
) [protected, virtual]

Applies the adaptive Gruen algorithm to pattern and search chips.

This method computes the adaptive Gruen algorithm for a pattern chip and search chip. The search chip is assumed to be of a larger size than the pattern chip as dictated by the contents of the registration definition file.

This algorithm can be used with or without "fast geoming" the search chip. It works quite well where the two images are assumed to be nearly spatially registered. Its real intent is to compute parallax angles between two images taken at different viewing geometry. This provides an efficient process for deriving a digital elevation model (DEM) from two datasets.

The Gruen algorithm is applied to the chips until the algorithm converges (current iteration yields a detla affine within tolerance limits), an error is encountered, or the maximum number of iterations is exceeded.

Note that bestSamp and bestLine may not be the original center of the search chip. It is subject to chip reduction matching as specified by the user. All distance tolerances are compute from this postion. The process of chip reduction processing is handled by AutoReg prior to calling this routine.

See also:
getThreshHold() for Affine limit information
Parameters:
sChip Full search chip as rendered from the search image
pChip Full pattern chip as rendered from the pattern/match image
fChip Maintains the solution vector at each chip location
startSamp Starting sample of the search image range
startLine Starting line of the search image range
endSamp Ending sample of the search image range
endLine Ending line of the search image range
bestSamp Best registering sample of search chip
bestLine best registering line of search chip
Returns:
AutoReg::RegisterStatus Returns AutoReg::Success if the chip is successfully registered, otherwise returns AutoReg::AdaptiveAlgorithmFailed.

Reimplemented from Isis::AutoReg.

Definition at line 359 of file Gruen.cpp.

References _fitChipScale, _maxIters, _nIters, _result, algorithm(), Isis::GruenResult::Alpha(), CheckAffineTolerance(), Isis::Chip::ChipLine(), Isis::Chip::ChipSample(), Isis::iException::Clear(), Isis::GruenResult::Constraints(), Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), Isis::GruenResult::Eigen(), ErrorAnalysis(), Isis::Chip::Extract(), Isis::GruenResult::gerrmsg, Isis::GruenResult::gerrno, getThreshHold(), Isis::Chip::getTransform(), HasConverged(), Isis::GruenResult::isGood, Isis::GruenResult::IsGood(), Isis::Chip::IsInsideChip(), Isis::Chip::Lines(), logError(), Isis::Null, reset(), Isis::Chip::Samples(), Isis::Affine::Scale(), Isis::Chip::SetAllValues(), Isis::AutoReg::SetChipLine(), Isis::Chip::SetChipPosition(), Isis::AutoReg::SetChipSample(), Isis::GruenResult::setChipTransform(), Isis::Chip::SetCubePosition(), Isis::GruenResult::setFinalImage(), Isis::AutoReg::SetGoodnessOfFit(), Isis::Chip::SetSize(), Isis::GruenResult::setStartImage(), Isis::Chip::setTransform(), Isis::Chip::SetValue(), ss, Status(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), TestConstraints(), Isis::Affine::Translate(), UpdateAffine(), UpdateChip(), and Isis::Chip::Write().

double Isis::Gruen::AffineTolerance (  )  const [inline]

Returns the Affine tolerance constraint as read from config file.

Definition at line 116 of file Gruen.h.

References _affineTol.

Referenced by CheckAffineTolerance().

GruenResult Isis::Gruen::algorithm ( Chip pattern,
Chip subsearch 
)

Real workhorse of the computational Gruen algorithm.

This method is called for all registration requests and actually performs the registration of two chips.

The pattern chip is deemed constant. The subsearch chip is generally an extraction from the search chip that has had an affine transform applied to fill it.

At each iteration of the Gruen algorithm, the affine transform is incrementally updated based upon the results from this method. There are six affine parameters and two radiometric (shift and gain) parameters that are solved/computed here.

The algorithm itself is a first derivative computation of the subsearch chip with small radiometric adjustments applied to better tone match the two chips. This is intended to minimize the affine variability.

Parameters:
pattern Fixed pattern chip which subsearch is trying to match
subsearch Affined extraction of the search chip
Returns:
GruenResult Container storing the results and helper methods of the solution

Definition at line 101 of file Gruen.cpp.

References _nIters, _totalIterations, a, Isis::GruenResult::ata, Isis::GruenResult::atl, Gain(), Isis::GruenResult::gerrmsg, Isis::GruenResult::gerrno, Isis::Chip::GetValue(), Isis::GruenResult::isGood, Isis::Chip::IsValid(), line, Isis::Chip::Lines(), logError(), MinValidPoints(), Isis::GruenResult::nIters, Isis::GruenResult::npts, Isis::GruenResult::resid, Isis::Chip::Samples(), Shift(), solve(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), and ValidPoints().

Referenced by AdaptiveRegistration(), and MatchAlgorithm().

virtual std::string Isis::Gruen::AlgorithmName (  )  const [inline, protected, virtual]

Returns the default name of the algorithm as Gruen.

Implements Isis::AutoReg.

Reimplemented in Isis::AdaptiveGruen.

Definition at line 132 of file Gruen.h.

Referenced by AlgorithmStatistics().

Pvl Isis::Gruen::AlgorithmStatistics ( Pvl pvl  )  [protected, virtual]

Create Gruen error and processing statistics Pvl output.

This method generates two groups specific to the Gruen algorithm: The GruenFailures group which logs all the errors enountered during processing and the GruenStatistics group which logs selected statistics gathered during a registration run.

These groups are added to the AutoReg log output Pvl container for reporting to user/log files.

Parameters:
pvl Input AutoReg Pvl container to add results to
Returns:
Pvl Output Pvl container with Gruen information

Reimplemented from Isis::AutoReg.

Definition at line 479 of file Gruen.cpp.

References _errors, _unclassified, AlgorithmName(), e, Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::getNth(), IsAdaptive(), ParameterLog(), pvl(), Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::size(), and StatsLog().

bool Isis::Gruen::CheckAffineTolerance (  )  [private]

Check affine tolerance for validity.

This method checks for a convergent solution that travels to far from the original tack point (best point in most cases). The user can control this tolerance with the AffineTolerance parameter in the registration config file. The check is a sample/line magnitude check from the original starting pixel location to the one after the affine transform has converged to match to a new cube pixel coordinate.

Note this check is independant of TestConstraints() method since the update of the chip only occurs after other limits pass. The chip must be updated and the new tack point cube pixel location must be determined prior to calling this method.

Returns:
bool True if the new pixel location does not exceed the defined tolerance, otherwise returns false.

Definition at line 949 of file Gruen.cpp.

References _result, AffineTolerance(), Isis::GruenResult::ErrorMagnitude(), Isis::GruenResult::gerrmsg, Isis::GruenResult::gerrno, Isis::GruenResult::isGood, and logError().

Referenced by AdaptiveRegistration().

double Isis::AutoReg::ChipLine (  )  const [inline, inherited]

Return the search chip line that best matched.

Definition at line 183 of file AutoReg.h.

References Isis::AutoReg::p_chipLine.

double Isis::AutoReg::ChipSample (  )  const [inline, inherited]

Return the search chip sample that best matched.

Definition at line 180 of file AutoReg.h.

References Isis::AutoReg::p_chipSample.

bool Isis::Gruen::CompareFits ( double  fit1,
double  fit2 
) [protected, virtual]

This virtual method must return if the 1st fit is equal to or better than the second fit.

Parameters:
fit1 1st goodness of fit
fit2 2nd goodness of fit

Reimplemented from Isis::AutoReg.

Definition at line 314 of file Gruen.cpp.

template<typename T>
T Isis::Gruen::ConfKey ( const DbProfile conf,
const std::string &  keyname,
const T &  defval,
int  index = 0 
) const [inline, private]

Helper method to initialize parameters.

This method will check the existance of a keyword and extract the value

if it exists to the passed parameter (type). If it doesn't exist, the default values is returned.

Parameters:
T Templated variable type
conf Parameter profile container
keyname Name of keyword to get a value from
defval Default value it keyword/value doesn't exist
index Optional index of the value for keyword arrays
Returns:
T Return type

Definition at line 230 of file Gruen.h.

References Isis::DbProfile::count(), Isis::DbProfile::exists(), value, and Isis::DbProfile::value().

Referenced by init().

double Isis::AutoReg::CubeLine (  )  const [inline, inherited]

Return the search chip cube line that best matched.

Definition at line 189 of file AutoReg.h.

References Isis::AutoReg::p_cubeLine.

Referenced by Qisis::ControlPointEdit::registerPoint().

double Isis::AutoReg::CubeSample (  )  const [inline, inherited]

Return the search chip cube sample that best matched.

Definition at line 186 of file AutoReg.h.

References Isis::AutoReg::p_cubeSample.

Referenced by Qisis::ControlPointEdit::registerPoint().

void Isis::Gruen::ErrorAnalysis ( GruenResult result  )  [private]

Computes/determines error analysis after the solution converges.

This method maintains the error analysis computed from the Gruen algorithm when a convergent condition is encountered. This essentially is a copy of the iterative analysis that takes place at each application of the Gruen algorithm. It ensures the error analysis is current by making a copy of the last error analysis perform as found in the results container.

It moves the iterative error analysis to the cummulative result container.

Parameters:
result Iterative solution container with last error analysis that is to be preserved

Definition at line 804 of file Gruen.cpp.

References _result, and Isis::GruenResult::setErrorAnalysis().

Referenced by AdaptiveRegistration().

Chip* Isis::AutoReg::FitChip (  )  [inline, inherited]

Return pointer to search chip.

Definition at line 146 of file AutoReg.h.

References Isis::AutoReg::p_fitChip.

Referenced by Qisis::ControlPointEdit::saveChips().

double Isis::Gruen::Gain (  )  const [inline]

Returns the radiometric gain value from the last solution.

Definition at line 106 of file Gruen.h.

References _result, and Isis::GruenResult::Gain().

Referenced by algorithm().

double Isis::Gruen::getDefaultGain (  )  const [inline, private]

Returns the default radiometric gain value.

Definition at line 293 of file Gruen.h.

References _defGain.

Referenced by reset().

double Isis::Gruen::getDefaultShift (  )  const [inline, private]

Returns the default radiometric shift value.

Definition at line 295 of file Gruen.h.

References _defShift.

Referenced by reset().

Gruen::GSLVector Isis::Gruen::getThreshHold ( const Chip chip  )  const [private]

Compute the Affine convergence parameters.

This method should be invoked using either the subsearch or pattern chip since they are both the same size. The six Affine convergence parameters are computed from the size of the chip and the AffineThreshHold1 and AffineThreshHold2 registration parameters.

AffineThreshHold1 governs the shift in line and sample and is used directly as specified in the registration config file.

AffineThreshHold2 governs scaling of sample and line as a function of the number of lines and samples in the chip provided. The value from the registration config file is divided by half the samples for the X Affine component; the Y Affine component is divided by half the number of lines in the chip.

Parameters:
chip Chip to use to compute affine convergence threshholds
See also:
HasConverged().
Returns:
Gruen::GSLVector Returns a vector of convergence thresholds that coincides with the linear order of the affine transform components.

Definition at line 718 of file Gruen.cpp.

References _scaleTol, _shearTol, _transTol, Isis::Chip::Lines(), and Isis::Chip::Samples().

Referenced by AdaptiveRegistration().

double Isis::AutoReg::GoodnessOfFit (  )  const [inline, inherited]

Return the goodness of fit of the match algorithm.

Definition at line 175 of file AutoReg.h.

References Isis::AutoReg::p_goodnessOfFit.

Referenced by Qisis::ControlPointEdit::registerPoint().

bool Isis::Gruen::HasConverged ( const GSLVector alpha,
const GSLVector thresh,
const GruenResult results 
) const [private]

Tests Affine parameters for convergence.

This method is invoked after the first iteration to test for convergence of the affine transform components of the Gruen registration algorithm. When the absolute value of all the affine components are less than or equal to its coinciding limit, convergence has been reached.

This method does not consider the radiometric shift and gain parameters in its determination of convergence.

Parameters:
alpha Affine transform change from last iteration to test
thresh Six element array of affine threshholds to test against
results Results container should any information be needed from it
Returns:
bool True if we have converged, false if convergence is not yet reached.

Definition at line 747 of file Gruen.cpp.

Referenced by AdaptiveRegistration().

virtual double Isis::Gruen::IdealFit (  )  const [inline, protected, virtual]

Returns the ideal fit for a perfect Gruen result.

Implements Isis::AutoReg.

Definition at line 140 of file Gruen.h.

void Isis::Gruen::init ( Pvl pvl  )  [private]

Initialize the object.

This method reads from the Algorithm group (if it exists) to set variables used in this object. If not all the keywords are present, then appropriate values are provided.

Parameters:
PvlObject &pvl PVL object/groups that contain algorithm parameters

Definition at line 623 of file Gruen.cpp.

References _affineTol, _defGain, _defShift, _errors, _fitChipScale, _maxIters, _nIters, _prof, _rgainMaxTol, _rgainMinTol, _rshiftTol, _scaleTol, _shearTol, _spiceTol, _totalIterations, _transTol, _unclassified, ConfKey(), initErrorList(), Isis::DbProfile::Name(), pvl(), reset(), Isis::DbProfile::setName(), SetRadiometrics(), and Isis::PvlObject::Traverse.

Referenced by Gruen().

Gruen::ErrorList Isis::Gruen::initErrorList (  )  const [private]

Creates an error list from know Gruen errors.

This method creates the list of known/expected Gruen errors that might occur during processing. This should be closely maintained with the GruenErrors enum list.

Returns:
Gruen::ErrorList Error list container

Definition at line 578 of file Gruen.cpp.

References Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::add().

Referenced by init().

virtual bool Isis::Gruen::IsAdaptive (  )  [inline, virtual]

Gruen default mode is adaptive.

Reimplemented from Isis::AutoReg.

Reimplemented in Isis::AdaptiveGruen.

Definition at line 103 of file Gruen.h.

Referenced by AlgorithmStatistics().

bool Isis::Gruen::IsGood ( const GruenResult result  )  const [inline]

Returns the status of the given Gruen result container.

Definition at line 125 of file Gruen.h.

References Isis::GruenResult::IsGood().

bool Isis::Gruen::IsGood (  )  const [inline]

Returns status of the last registration result.

Definition at line 123 of file Gruen.h.

References _result.

Referenced by MatchAlgorithm().

void Isis::Gruen::logError ( int  gerrno,
const std::string &  gerrmsg 
) [private]

Logs a Gruen error.

A running count of errors that occur is maintained through this method. If an error occurs that is not in the list, it will also be counted. This would indicate that a new error condition has occured and needs to be added to the list.

Parameters:
gerrno One of the errors as defined by GruenError enum
gerrmsg Optional message although it is ignored in this context

Definition at line 604 of file Gruen.cpp.

References _errors, _unclassified, Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::exists(), and Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::get().

Referenced by AdaptiveRegistration(), algorithm(), CheckAffineTolerance(), solve(), and TestConstraints().

double Isis::Gruen::MatchAlgorithm ( Chip pattern,
Chip subsearch 
) [protected, virtual]

Minimization of data set using Gruen algorithm.

This is a very minimal application of the Gruen algorithm that provides the ability to use it in a non-adaptive capacity. This method processes two chips of the same size, pattern and subsearch. The subsearch has typically been extracted in the same manner as the MinimumDifference or MaximumCorrelation routines are utilized.

It simply applies the algorithm to the current state of the two chips, computes the error analysis on it and returns the eigen vector solution as an indication of chip registration integrity.

Note that in this mode, most all the parameters found in the definition file that apply to the adaptive mode are ignored when utilizing the algorithm in this fashion.

Parameters:
pattern [in] A Chip object usually containing an nxm area of a cube. Must be the same diminsions as subsearch.
subsearch [in] A Chip object usually containing an nxm area of a cube. Must be the same diminsions as pattern. This is normally a subarea of a larger portion of the image.
Returns:
The square root of the eigen values of DN differences OR Isis::NULL if the Gruen algorithm fails.

Implements Isis::AutoReg.

Definition at line 299 of file Gruen.cpp.

References _result, algorithm(), Isis::GruenResult::Eigen(), IsGood(), Isis::Null, reset(), and Isis::GruenResult::update().

BigInt Isis::Gruen::MinValidPoints ( BigInt  totalPoints  )  const [private]

Computes the number of minimum valid points.

This method uses the pattern valid percent as specified in the registration config file (or the programmer) to compute the minimum number of valid points from the total.

Parameters:
totalPoints Assumed to be total number of relavent pixels in a chip
Returns:
BigInt Minimum number of valid points determined from the percentage specified by user/programmer.

Definition at line 769 of file Gruen.cpp.

References Isis::AutoReg::PatternValidPercent().

Referenced by algorithm(), and ValidPoints().

bool Isis::AutoReg::ModelSurface ( std::vector< double > &  x,
std::vector< double > &  y,
std::vector< double > &  z 
) [protected, inherited]

We will model a 2-d surface as:.

z = a + b*x + c*y + d*x**2 + e*x*y + f*y**2

Then the partial derivatives are two lines:

dz/dx = b + 2dx + ey dz/dy = c + ex + 2fy

We will have a local min/max where dz/dx and dz/dy = 0. Solve using that condition using linear algebra yields:

xlocal = (ce - 2bf) / (4df - ee) ylocal = (be - 2cd) / (4df - ee)

These will be stored in p_chipSample and p_chipLine respectively.

Parameters:
x vector of x (sample) values
y vector of y (line) values
z vector of z (goodness-of-fit) values

Definition at line 745 of file AutoReg.cpp.

References a, Isis::LeastSquares::AddKnown(), b, c, Isis::BasisFunction::Coefficient(), d, delta, Isis::Matrix::Determinant(), e, Isis::LeastSquares::Evaluate(), Isis::AutoReg::p_chipLine, Isis::AutoReg::p_chipSample, Isis::AutoReg::p_goodnessOfFit, Isis::AutoReg::p_status, Isis::AutoReg::p_surfaceModelEccentricity, Isis::AutoReg::p_SurfaceModelEccentricityRatioNotMet, Isis::AutoReg::p_surfaceModelEccentricityTolerance, Isis::AutoReg::p_SurfaceModelSolutionInvalid, Isis::LeastSquares::Solve(), Isis::AutoReg::SurfaceModelEccentricityRatioNotMet, and Isis::AutoReg::SurfaceModelSolutionInvalid.

Referenced by Isis::AutoReg::Register().

template<typename T>
PvlKeyword Isis::Gruen::ParameterKey ( const std::string &  keyname,
const T &  value,
const std::string &  unit = "" 
) const [inline, private]

Keyword formatter for Gruen parameters.

Constructs a keyword with actual user/programmer values if provided, otherwise sets the value to "Unbounded".

Parameters:
T Type of value to record
keyname Name of keyword to create
value Value to set keyword to if in profile
unit Optional unit value
Returns:
PvlKeyword Constructed keyword for key/value

Definition at line 253 of file Gruen.h.

References _prof, Isis::DbProfile::exists(), and ValidateKey().

Referenced by ParameterLog().

PvlGroup Isis::Gruen::ParameterLog (  )  const [private]

Create a PvlGroup with the Gruen specific parameters.

This method generates a PvlGroup of Gruen algorithm parameters. This routine is called from the AutoReg algorithm specific statistics routine and augments the AutoReg log output.

Returns:
PvlGroup Group containing Pvl keywords of Gruen parameters

Definition at line 545 of file Gruen.cpp.

References _affineTol, _defGain, _defShift, _fitChipScale, _maxIters, _rgainMaxTol, _rgainMinTol, _rshiftTol, _scaleTol, _shearTol, _spiceTol, _transTol, ParameterKey(), and ValidateKey().

Referenced by AlgorithmStatistics().

void Isis::AutoReg::Parse ( Pvl pvl  )  [protected, inherited]

Initialize parameters in the AutoReg class using a PVL specification.

An example of the PVL required for this is:

 Object = AutoRegistration
   Group = Algorithm
     Name      = MaximumCorrelation
     Tolerance = 0.7
   EndGroup

   Group = PatternChip
     Samples = 21
     Lines   = 21
   EndGroup

   Group = SearchChip
     Samples = 51
     Lines = 51
   EndGroup
 EndObject

There are many other options that can be set via the pvl and are described in other documentation (see below).

See also:
automaticRegistration.doc
Parameters:
pvl The pvl object containing the specification

Definition at line 136 of file AutoReg.cpp.

References _FILEINFO_, e, Isis::PvlContainer::Filename(), Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), maximum, Isis::iException::Message(), minimum, Isis::AutoReg::PatternChip(), pvl(), Isis::AutoReg::SearchChip(), Isis::AutoReg::SetPatternValidPercent(), Isis::AutoReg::SetPatternZScoreMinimum(), Isis::AutoReg::SetReductionFactor(), Isis::Chip::SetSize(), Isis::AutoReg::SetSubPixelAccuracy(), Isis::AutoReg::SetSurfaceModelDistanceTolerance(), Isis::AutoReg::SetSurfaceModelEccentricityRatio(), Isis::AutoReg::SetSurfaceModelWindowSize(), Isis::AutoReg::SetTolerance(), Isis::Chip::SetValidRange(), Isis::PvlObject::Traverse, Isis::ValidMaximum, and Isis::ValidMinimum.

Referenced by Isis::AutoReg::AutoReg().

Chip* Isis::AutoReg::PatternChip (  )  [inline, inherited]

Return pointer to pattern chip.

Definition at line 140 of file AutoReg.h.

References Isis::AutoReg::p_patternChip.

Referenced by Isis::AutoReg::Parse(), Qisis::ControlPointEdit::registerPoint(), and Qisis::ControlPointEdit::saveChips().

double Isis::AutoReg::PatternValidPercent (  )  const [inline, inherited]

Return pattern valid percent.

Definition at line 167 of file AutoReg.h.

References Isis::AutoReg::p_patternValidPercent.

Referenced by MinValidPoints().

Chip Isis::AutoReg::Reduce ( Chip chip,
int  reductionFactor 
) [protected, inherited]

This method reduces the given chip by the given reduction factor.

Used to speed up the match algorithm.

Parameters:
reductionFactor 
Returns:
Chip

Definition at line 348 of file AutoReg.cpp.

References Isis::Statistics::AddData(), Isis::Statistics::Average(), Isis::Chip::GetValue(), line, Isis::Chip::Lines(), Isis::Null, Isis::Statistics::Reset(), sample, Isis::Chip::Samples(), Isis::Chip::SetValue(), and stats.

Referenced by Isis::AutoReg::Register().

Chip* Isis::AutoReg::ReducedFitChip (  )  [inline, inherited]

Return pointer to reduced fix chip.

Definition at line 155 of file AutoReg.h.

References Isis::AutoReg::p_reducedFitChip.

Chip* Isis::AutoReg::ReducedPatternChip (  )  [inline, inherited]

Return pointer to reduced pattern chip.

Definition at line 149 of file AutoReg.h.

References Isis::AutoReg::p_reducedPatternChip.

Chip* Isis::AutoReg::ReducedSearchChip (  )  [inline, inherited]

Return pointer to reduced search chip.

Definition at line 152 of file AutoReg.h.

References Isis::AutoReg::p_reducedSearchChip.

AutoReg::RegisterStatus Isis::AutoReg::Register (  )  [inherited]

Walk the pattern chip through the search chip to find the best registration.

Returns:
Returns the status of the registration.

Definition at line 392 of file AutoReg.cpp.

References _FILEINFO_, Isis::AutoReg::AdaptiveRegistration(), Isis::AutoReg::CompareFits(), Isis::AutoReg::ComputeChipZScore(), Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), Isis::AutoReg::FitChipNoData, Isis::AutoReg::FitChipToleranceNotMet, Isis::Chip::GetValue(), Isis::AutoReg::Init(), Isis::AutoReg::IsAdaptive(), Isis::AutoReg::IsIdeal(), Isis::Chip::IsValid(), line, Isis::Chip::Lines(), Isis::AutoReg::Match(), Isis::iException::Message(), Isis::AutoReg::ModelSurface(), Isis::Null, Isis::AutoReg::p_bestFit, Isis::AutoReg::p_bestLine, Isis::AutoReg::p_bestSamp, Isis::AutoReg::p_chipLine, Isis::AutoReg::p_chipSample, Isis::AutoReg::p_cubeLine, Isis::AutoReg::p_cubeSample, Isis::AutoReg::p_distanceTolerance, Isis::AutoReg::p_fitChip, Isis::AutoReg::p_FitChipNoData, Isis::AutoReg::p_FitChipToleranceNotMet, Isis::AutoReg::p_goodnessOfFit, Isis::AutoReg::p_patternChip, Isis::AutoReg::p_PatternChipNotEnoughValidData, Isis::AutoReg::p_patternValidPercent, Isis::AutoReg::p_PatternZScoreNotMet, Isis::AutoReg::p_reducedFitChip, Isis::AutoReg::p_reducedPatternChip, Isis::AutoReg::p_reducedSearchChip, Isis::AutoReg::p_reduceFactor, Isis::AutoReg::p_searchChip, Isis::AutoReg::p_status, Isis::AutoReg::p_subpixelAccuracy, Isis::AutoReg::p_Success, Isis::AutoReg::p_SurfaceModelDistanceInvalid, Isis::AutoReg::p_SurfaceModelNotEnoughValidData, Isis::AutoReg::p_Total, Isis::AutoReg::p_windowSize, Isis::AutoReg::PatternChipNotEnoughValidData, Isis::AutoReg::PatternZScoreNotMet, Isis::AutoReg::Reduce(), Isis::Chip::Samples(), Isis::Chip::SetChipPosition(), Isis::Chip::SetSize(), Isis::Chip::SetValue(), sl, ss, Isis::AutoReg::Success, Isis::AutoReg::SurfaceModelDistanceInvalid, Isis::AutoReg::SurfaceModelNotEnoughValidData, Isis::Chip::TackLine(), Isis::Chip::TackSample(), and Isis::AutoReg::Tolerance().

Referenced by Qisis::ControlPointEdit::registerPoint().

Pvl Isis::AutoReg::RegistrationStatistics (  )  [inherited]

This returns the cumulative registration statistics.

That is, the Register() method accumulates statistics regard the errors each time is called. Invoking this method returns a PVL summary of those statisitics

Author:
janderson (3/26/2009)
Returns:
Pvl

Definition at line 920 of file AutoReg.cpp.

References Isis::AutoReg::AlgorithmStatistics(), Isis::AutoReg::p_FitChipNoData, Isis::AutoReg::p_FitChipToleranceNotMet, Isis::AutoReg::p_PatternChipNotEnoughValidData, Isis::AutoReg::p_PatternZScoreNotMet, Isis::AutoReg::p_Success, Isis::AutoReg::p_SurfaceModelDistanceInvalid, Isis::AutoReg::p_SurfaceModelEccentricityRatioNotMet, Isis::AutoReg::p_SurfaceModelNotEnoughValidData, Isis::AutoReg::p_SurfaceModelSolutionInvalid, Isis::AutoReg::p_Total, pvl(), and stats.

PvlGroup Isis::AutoReg::RegTemplate (  )  [inherited]

This function returns the keywords that this object was created from.

Returns:
PvlGroup The keywords this object used in initialization

Definition at line 1002 of file AutoReg.cpp.

References Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), Isis::AutoReg::p_template, Isis::AutoReg::SetPatternValidPercent(), and Isis::PvlObject::Traverse.

void Isis::Gruen::reset (  )  [private]

Reset registration-dependant counters only.

This method is intended to be invoked to reset interal variables that track or govern behavior pertaining to the registration of two chips. It should be invoked as the first call prior to calling the algorithm method for a new registration.

Definition at line 673 of file Gruen.cpp.

References _nIters, _result, getDefaultGain(), getDefaultShift(), Isis::GruenResult::setGain(), and Isis::GruenResult::setShift().

Referenced by AdaptiveRegistration(), init(), and MatchAlgorithm().

void Isis::Gruen::resetStats (  )  [private]

Reset Gruen statistics as needed.

Definition at line 685 of file Gruen.cpp.

References _eigenStat, _gainStat, _iterStat, _shiftStat, and Isis::Statistics::Reset().

const GruenResult& Isis::Gruen::Results (  )  const [inline]

Returns the results container from the last solution.

Definition at line 120 of file Gruen.h.

References _result.

Chip* Isis::AutoReg::SearchChip (  )  [inline, inherited]

Return pointer to search chip.

Definition at line 143 of file AutoReg.h.

References Isis::AutoReg::p_searchChip.

Referenced by Isis::AutoReg::Parse(), Qisis::ControlPointEdit::registerPoint(), and Qisis::ControlPointEdit::saveChips().

void Isis::AutoReg::SetChipLine ( double  line  )  [inline, protected, inherited]

Sets the search chip subpixel line that matches the pattern tack line.

Parameters:
line 

Definition at line 237 of file AutoReg.h.

References Isis::AutoReg::p_chipLine.

Referenced by AdaptiveRegistration().

void Isis::AutoReg::SetChipSample ( double  sample  )  [inline, protected, inherited]

Sets the search chip subpixel sample that matches the pattern tack sample.

Parameters:
sample 

Definition at line 228 of file AutoReg.h.

References Isis::AutoReg::p_chipSample.

Referenced by AdaptiveRegistration().

void Isis::AutoReg::SetGoodnessOfFit ( double  fit  )  [inline, protected, inherited]

Sets the goodness of fit for adaptive algorithms.

Parameters:
Fit Fit value to set

Definition at line 244 of file AutoReg.h.

References Isis::AutoReg::p_bestFit.

Referenced by AdaptiveRegistration().

void Isis::AutoReg::SetPatternValidPercent ( const double  percent  )  [inherited]

Set the amount of data in the pattern chip that must be valid.

For example, a 21x21 pattern chip has 441 pixels. If percent is 75 then at least 330 pixels pairs must be valid in order for a comparision between the pattern and search sub-region to occur. That is, both the pattern pixel and search pixel must be valid to be counted. Pixels are considered valid based on the min/max range specified on each of the Chips (see Chip::SetValidRange method).

If the pattern chip reduction option is used this percentage will apply to all reduced patterns. Additionally, the pattern sampling effects the pixel count. For example if pattern sampling is 50% then only 220 pixels in the 21x21 pattern are considered so 165 must be valid.

Parameters:
percent Percentage of valid data between 0 and 100, default is 50% if never invoked

Definition at line 234 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_patternValidPercent.

Referenced by Isis::AutoReg::AutoReg(), Isis::AutoReg::Parse(), and Isis::AutoReg::RegTemplate().

void Isis::AutoReg::SetPatternZScoreMinimum ( double  minimum  )  [inherited]

Set the minimum pattern zscore.

This option is used to ignore pattern chips which are bland (low standard deviation). If the minimum or maximum pixel value in the pattern chip does not meet the minimum zscore value (see a statisitcs book for definition of zscore) then invalid registration will occur.

Parameters:
minimum The minimum zscore value for the pattern chip. Default is 1.0

Definition at line 255 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_minimumPatternZScore.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::Gruen::SetRadiometrics ( const double &  gain = 0.0,
const double &  shift = 0.0 
)

Sets established radiometric parameters for registration processes.

This method provides a mechanism for establishing predetermined values for registration activities. This is intended to be used for the DEM generation processing where points are grown around seed points. This is intended to lead to rapid convergence of points surrounding established seed points.

This should be used in conjuction with the resulting Affine transform as determined from the seed point.

Note that once this is established, it remains constant for all subsequent registration processes. To reset the default, all this method with no arguments.

Also note that these defaults can be established in the input AutoReg definition file.

These values are set when reset() is called - typically at the start of any adaptive application of the Gruen algorithm.

Parameters:
gain Precomputed radiometric gain value to use as default
shift Precomputed radiometric shift value to use as default

Definition at line 70 of file Gruen.cpp.

References _defGain, and _defShift.

Referenced by init().

void Isis::AutoReg::SetReductionFactor ( int  factor  )  [inherited]

Set the reduction factor used to speed up the pattern matching algorithm.

Parameters:
factor 

Definition at line 331 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_reduceFactor.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::AutoReg::SetSubPixelAccuracy ( bool  on  )  [inherited]

If the sub-accuracy is enable the Register() method will attempt to match the pattern chip to the search chip at sub-pixel accuracy, otherwise it will be registered at whole pixel accuracy.

Parameters:
on Set the state of registration accuracy. The default is sub-pixel accuracy is on

Definition at line 212 of file AutoReg.cpp.

References Isis::AutoReg::p_subpixelAccuracy.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::AutoReg::SetSurfaceModelDistanceTolerance ( double  distance  )  [inherited]

Set a distance the surface model solution is allow to move away from the best whole pixel fit in the fit chip.

Parameters:
distance The distance allowed to move in pixels. Must be greater than zero.

Definition at line 316 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_distanceTolerance.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::AutoReg::SetSurfaceModelEccentricityRatio ( double  eccentricityRatio  )  [inherited]

A 1:1 ratio represents a perfect circle.

Allowing the user to set this ratio lets them determine which points to throw out if the surface model gets too elliptical.

Parameters:
eccentricityRatio 

Definition at line 300 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_surfaceModelEccentricityTolerance.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::AutoReg::SetSurfaceModelWindowSize ( int  size  )  [inherited]

Set the surface model window size.

The pixels in this window will be used to fit a surface model in order to compute sub-pixel accuracy. In some cases the default (3x3) and produces erroneous sub-pixel accuracy values.

Parameters:
size The size of the window must be three or greater and odd.

Definition at line 284 of file AutoReg.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::AutoReg::p_windowSize.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

void Isis::AutoReg::SetTolerance ( double  tolerance  )  [inherited]

Set the tolerance for an acceptable goodness of fit.

Parameters:
tolerance This tolerance is used to test against the goodness of fit returned by the MatchAlgorith method after a surface model has been fit. See TestGoodnessOfFit

Definition at line 271 of file AutoReg.cpp.

References Isis::AutoReg::p_tolerance.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::Parse().

double Isis::Gruen::Shift (  )  const [inline]

Returns the radiometric shift value from the last solution.

Definition at line 108 of file Gruen.h.

References _result, and Isis::GruenResult::Shift().

Referenced by algorithm().

bool Isis::Gruen::solve ( GruenResult result  )  [protected]

Computes solution and error analysis using Cholesky/Jacobi methods.

This method computes the affine and radiometric parameter solution and associated errors/uncertainty from the algorithm() processing.

The affine parameters are solved using Cholesky decomposition. Error analysis is computed using Jacobian eigenvector methods. The GNU Scientific Library (GSL) is used to apply these routines.

See http://www.gnu.org/software/gsl/ for additional details on the GNU Scientific Library.

Parameters:
result Input parameters provided to compute solution. This container is also updated by this method with the solution and error analysis.
Returns:
bool True if successful, false if an error occurs

Definition at line 203 of file Gruen.cpp.

References Isis::GruenResult::alpha, Isis::GruenResult::ata, Isis::GruenResult::atl, c, Isis::GSL::GSLUtility::check(), Isis::iException::Clear(), Isis::GSL::GSLUtility::Columns(), Isis::GruenResult::eigen, Isis::iException::Errors(), Isis::GSL::GSLUtility::free(), Isis::GruenResult::gerrmsg, Isis::GruenResult::gerrno, Isis::GSL::GSLUtility::getInstance(), Isis::GSL::GSLUtility::GSLTogsl(), Isis::GSL::GSLUtility::identity(), Isis::GruenResult::isGood, Isis::GruenResult::kmat, logError(), Isis::GSL::GSLUtility::Rows(), Isis::GruenResult::skmat, Isis::GruenResult::Variance(), and x.

Referenced by algorithm().

double Isis::Gruen::SpiceTolerance (  )  const [inline]

Returns the SPICE tolerance constraint as read from config file.

Definition at line 113 of file Gruen.h.

References _spiceTol.

PvlGroup Isis::Gruen::StatsLog (  )  const [private]

Create a PvlGroup with the Gruen specific statistics.

This method generates a PvlGroup from statistics collected for a particular Gruen algorithm application. This routine is called from the AutoReg algorithm specific statistics routine and augments the AutoReg statistics log output.

Returns:
PvlGroup Group containing Pvl keywords with collected statistics

Definition at line 508 of file Gruen.cpp.

References _eigenStat, _gainStat, _iterStat, _shiftStat, _totalIterations, Isis::Statistics::Average(), Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::Statistics::StandardDeviation(), stats, and ValidateKey().

Referenced by AlgorithmStatistics().

AutoReg::RegisterStatus Isis::Gruen::Status (  )  const [inline, private]

Returns status of the last Gruen registration result.

Definition at line 311 of file Gruen.h.

References _result.

Referenced by AdaptiveRegistration().

AutoReg::RegisterStatus Isis::Gruen::Status ( const GruenResult result  )  const [private]

Returns the proper status given a Gruen result container.

This method will return registration status consistant with AutoReg::RegisterStatus return codes.

Parameters:
result Gruen result container used to determine status
Returns:
AutoReg::RegisterStatus Returns AutoReg::Success if the Gruen registration is successful, otherwise returns AutoReg::AdaptiveAlgorithmFailed.

Definition at line 971 of file Gruen.cpp.

References Isis::AutoReg::AdaptiveAlgorithmFailed, Isis::GruenResult::IsGood(), and Isis::AutoReg::Success.

bool Isis::Gruen::TestConstraints ( const bool &  done,
GruenResult result 
) [private]

Test user limits/contraints after the algorithm has converged.

This method is invoked immediately after the Gruen algorithm has converged to test against user specified limits. This call is only valid in the adaptive context as much of the error checking is handled by AutoReg when using the non-adaptive algorithm.

This method tests for convergence, maximum iterations exceeded, tolerance limits of radiometric shift and gain and whether the eigenvalue of the solution exceeds the limit.

The result container is altered should a constraint not be meet which indicates the registration failed.

Parameters:
done Input parameter that indicates convergence has occurred
result Container with results update by status of contraint check
Returns:
bool Returns true if all constraints tests are valid, otherwise returns false indicating an error.

Definition at line 830 of file Gruen.cpp.

References _eigenStat, _gainStat, _iterStat, _maxIters, _rgainMaxTol, _rgainMinTol, _rshiftTol, _shiftStat, Isis::Statistics::AddData(), Isis::GruenResult::Eigen(), Isis::GruenResult::Gain(), Isis::GruenResult::gerrmsg, Isis::GruenResult::gerrno, Isis::GruenResult::IsGood(), Isis::GruenResult::isGood, Isis::GruenResult::Iterations(), logError(), Isis::GruenResult::Shift(), and Isis::AutoReg::Tolerance().

Referenced by AdaptiveRegistration().

double Isis::AutoReg::Tolerance (  )  const [inline, inherited]

Return match algorithm tolerance.

Definition at line 170 of file AutoReg.h.

References Isis::AutoReg::p_tolerance.

Referenced by Isis::AutoReg::Register(), and TestConstraints().

Affine Isis::Gruen::UpdateAffine ( GruenResult result,
const Affine gtrans 
) [private]

Updates the affine transform with the final iterative solution.

This method is called at the end of each iteration that updates the affine transform with the sum of all prior affine changes. The affine for the current result is added to the cummulative result container and the incremental affine is added to the cummulate transform.

Parameters:
result Container representing the last iteration solution
gtrans Accumulating affine transform for search chip
Returns:
Affine Returns the newly updated Affine transform

Definition at line 897 of file Gruen.cpp.

References _result, a, Isis::GruenResult::Alpha(), Isis::Affine::Forward(), and Isis::GruenResult::update().

Referenced by AdaptiveRegistration().

void Isis::Gruen::UpdateChip ( Chip chip,
const Affine affine 
) [private]

Updates the (search) chip with the final Affine transform.

This method applies the convergent Affine transform parameters to the chip provided. The accummulated transform only represents the result of the Gruen algorithm. Therefore, any existing Affine transform used to load the orginal chip will be added to it for the final resulting solution.

When completed, in theory, the chip can be used to reload from the file and it should match well with the original pattern chip on the final iteration of the Gruen algorithm which converged.

Parameters:
chip Chip to update with accummulated Affine transform
affine Gruen accummulated Affine transform to add to chip

Definition at line 924 of file Gruen.cpp.

References c, Isis::Affine::Forward(), Isis::Affine::getIdentity(), Isis::Chip::getTransform(), and Isis::Chip::setTransform().

Referenced by AdaptiveRegistration().

PvlKeyword Isis::Gruen::ValidateKey ( const std::string  keyname,
const double &  value,
const std::string &  unit = "" 
) const [inline, private]

Checks value of key, produces appropriate value.

This function checks the value of the keyword for specialness and will create the appropriate keyword if it is special.

Parameters:
keyname Name of keyword to create
value Keyword value
unit Optional unit qualifer with value
Returns:
PvlKeyword Returns newly created keyword/value

Definition at line 275 of file Gruen.h.

References Isis::IsSpecial().

Referenced by ParameterKey(), ParameterLog(), and StatsLog().

bool Isis::Gruen::ValidPoints ( BigInt  totalPoints,
BigInt  nPoints 
) const [private]

Determines if number of points is valid percentage of all points.

Computes the number of minimum valid points from user specified percentage and tests the acutal number used.

Parameters:
totalPoints Total number of possible valid points in chip
nPoints Actual number of valid points used in chips
Returns:
bool True if number of actual points exceeds percent mimimum valid, otherwise returns false.

Definition at line 786 of file Gruen.cpp.

References MinValidPoints().

Referenced by algorithm().

void Isis::AutoReg::ZScores ( double &  score1,
double &  score2 
) const [inline, inherited]

Return the ZScores of the pattern chip.

Parameters:
score1 First Z Score
score2 Second Z Score

Definition at line 197 of file AutoReg.h.

References Isis::AutoReg::p_ZScore1, and Isis::AutoReg::p_ZScore2.


Member Data Documentation

GruenResult Isis::Gruen::_result [private]

last result, cummulative

Definition at line 197 of file Gruen.h.

Referenced by AdaptiveRegistration(), CheckAffineTolerance(), ErrorAnalysis(), Gain(), IsGood(), MatchAlgorithm(), reset(), Results(), Shift(), Status(), and UpdateAffine().

PvlObject Isis::AutoReg::p_template [protected, inherited]

AutoRegistration object that created this projection.

Definition at line 284 of file AutoReg.h.

Referenced by Isis::AutoReg::AutoReg(), and Isis::AutoReg::RegTemplate().


The documentation for this class was generated from the following files: