USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Equalization Class Reference

This class can be used to calculate, read in, and/or apply equalization statistics for a list of files. More...

#include <Equalization.h>

Inheritance diagram for Isis::Equalization:
Inheritance graph
Collaboration diagram for Isis::Equalization:
Collaboration graph

Classes

class  ApplyFunctor
 
class  CalculateFunctor
 
class  ImageAdjustment
 

Public Member Functions

 Equalization (OverlapNormalization::SolutionType sType, QString fromListName)
 
void addHolds (QString holdListName)
 
void calculateStatistics (double sampPercent, int mincnt, bool wtopt, LeastSquares::SolveMethod methodType)
 
void importStatistics (QString instatsFileName)
 
void applyCorrection (QString toListName)
 
PvlGroup getResults ()
 
void write (QString outstatsFileName)
 
double evaluate (double dn, int imageIndex, int bandIndex) const
 

Protected Member Functions

void loadInputs (QString fromListName)
 
void setInput (int index, QString value)
 
const FileListgetInputs () const
 
virtual void fillOutList (FileList &outList, QString toListName)
 
virtual void errorCheck (QString fromListName)
 
void generateOutputs (FileList &outList)
 
void loadOutputs (FileList &outList, QString toListName)
 
void loadHolds (OverlapNormalization *oNorm)
 
void setResults (std::vector< OverlapStatistics > &overlapStats)
 
void setResults ()
 
void clearAdjustments ()
 
void addAdjustment (ImageAdjustment *adjustment)
 
void addValid (int count)
 
void addInvalid (int count)
 

Private Member Functions

void init ()
 
std::vector< int > validateInputStatistics (QString instatsFileName)
 

Private Attributes

FileList m_imageList
 
std::vector< ImageAdjustment * > m_adjustments
 
std::vector< int > m_holdIndices
 
int m_validCnt
 
int m_invalidCnt
 
int m_mincnt
 
bool m_wtopt
 
int m_maxCube
 
int m_maxBand
 
OverlapNormalization::SolutionType m_sType
 
Pvlm_results
 

Detailed Description

This class can be used to calculate, read in, and/or apply equalization statistics for a list of files.

  • Calculating equalization statistics
    • An optional list of images to hold may be given before calculations.
    • In order to calculate statistics, the class will need to know the following:
      • percentage of lines to be used for calculations,
      • the minimum number of points in overlapping area to be used,
      • whether overlapping areas should be weighted based on number of valid pixels,
      • whether to calculate gain, offset, or both
      • which LeastSquares solve method.
    • Once calculated, these statistics can be returned as a PvlGroup, written to a text file, and/or applied to the images in the input file list.
  • Importing equalization statistics
    • Statistics may be imported from a given file name and then applied to the images in the input file list.
  • Applying equalization statistics
    • Statistics must be calculated or imported before they can be applied to the images in the input file list.

Code example for calculating statistics, writing results to a Pvl, writing results to a file, and applying results: Equalization eq(inputCubeListFileName); // calculate eq.addHolds(holdListFileName); eq.calculateStatistics(sampPercent, mincnt, wtopt, sType, methodType); // write to PvlGroup PvlGroup resultsGroup = eq.getResults(); // write to file eq.write(outputStatisticsFileName); // apply corrections to cubes in input list eq.applyCorrection();

Code example for importing statistics and applying them. Equalization eq(listFileName); eq.importStatistics(inputStatisticsFileName); // create new output cubes from equalized cube list and apply corrections eq.applyCorrection(equalizedCubeListFileName);

This class contains the classes ImageAdjustment, CalculateFunctor, and ApplyFunctor.

Author
????-??-?? Unknown
History:

2012-04-26 Jeannie Backer - Added includes to Filelist, Pvl, PvlGroup, and Statistics classes to the implementation file.

2013-01-29 Jeannie Backer - Added input parameter to calculateStatistics() method. Added error catch to improve thrown message. Fixes #962.

2013-01-29 Jeannie Backer - Fixed bugs from previous checkin. Improved test coverage by more than 23% for each coverage type.

2013-02-06 Steven Lambright - Made the OverlapNormalization::SolutionType into a member required upon instantiation in order to support gain adjustments without normalization, which uses a separate formula in evaluate() instead of just modifying how statistics are computed. Implemented the GainsWithoutNormalization solution type. References #911.

Definition at line 124 of file Equalization.h.

Constructor & Destructor Documentation

Isis::Equalization::Equalization ( OverlapNormalization::SolutionType  sType,
QString  fromListName 
)
Parameters
sTypeAn integer value corresponding to the enumerated value of the OverlapNormalization::SolutionType to be used.

Definition at line 34 of file Equalization.cpp.

Member Function Documentation

void Isis::Equalization::calculateStatistics ( double  percent,
int  mincnt,
bool  wtopt,
LeastSquares::SolveMethod  methodType 
)
Parameters
percentPercentage of the lines to consider when gathering overall cube statistics and overlap statistics
mincntMinimum number of points in overlapping area required to be used in the solution
wtoptIndicates whether overlaps should be weighted
methodTypeAn integer value corresponding to the enumerated value of the desired LeastSquares::SolveMethod to be used.

Definition at line 91 of file Equalization.cpp.

References _FILEINFO_, Isis::ProcessByBrick::EndProcess(), Isis::OverlapStatistics::GetMStats(), Isis::OverlapStatistics::HasOverlap(), Isis::Cube::open(), Isis::ProcessByLine::ProcessCubeInPlace(), Isis::Process::Progress(), Isis::ProcessByLine::SetInputCube(), Isis::OverlapStatistics::SetMincount(), Isis::Progress::SetText(), Isis::toString(), Isis::MultivariateStatistics::ValidPixels(), Isis::MultivariateStatistics::X(), and Isis::MultivariateStatistics::Y().


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