Isis 3 Programmer Reference
Isis::HiEqualization Class Reference

#include <HiEqualization.h>

Inheritance diagram for Isis::HiEqualization:
Inheritance graph
Collaboration diagram for Isis::HiEqualization:
Collaboration graph

Classes

class  HiCalculateFunctor
 

Public Member Functions

 HiEqualization (QString fromListName)
 
void calculateStatistics ()
 
void addHolds (QString holdListName)
 Adds a list of images to be held in the equalization. More...
 
void calculateStatistics (double samplingPercent, int mincnt, bool wtopt, LeastSquares::SolveMethod methodType)
 Calculates the image and overlap statistics, and then determines corrective factors if possible. More...
 
void recalculateStatistics (QString inStatsFileName)
 Recalculates statistics for any new input images. More...
 
void importStatistics (QString instatsFileName)
 Imports statistics for applying correction. More...
 
void applyCorrection (QString toListName)
 Equalizes the input images. More...
 
PvlGroup getResults ()
 Returns general information about the equalization. More...
 
void write (QString outstatsFileName)
 Write the equalization information (results) to a file. More...
 
double evaluate (double dn, int imageIndex, int bandIndex) const
 

Protected Member Functions

virtual void fillOutList (FileList &outList, QString toListName)
 
virtual void errorCheck (QString fromListName)
 Checks that the input images have the same mapping groups and same number of bands. More...
 
void loadInputs (QString fromListName)
 Loads in the input images. More...
 
void setInput (int index, QString value)
 
const FileListgetInputs () const
 
void calculateBandStatistics ()
 Calculates the image statistics on a band-by-band basis. More...
 
void calculateOverlapStatistics ()
 Calculates the overlap statistics for each pair of input images. More...
 
void generateOutputs (FileList &outList)
 Generates the names of the equalized cubes if no output list is provided. More...
 
void loadOutputs (FileList &outList, QString toListName)
 Checks that the output image list is correct. More...
 
void loadHolds (OverlapNormalization *oNorm)
 
void setResults ()
 Creates the results pvl containing statistics and corrective factors. More...
 
void clearAdjustments ()
 Frees image adjustments. More...
 
void addAdjustment (ImageAdjustment *adjustment)
 Adds an image adjustment. More...
 
void clearNormalizations ()
 Frees overlap normalizations. More...
 
void clearOverlapStatistics ()
 Frees overlap statistics. More...
 
void addValid (int count)
 Increments the number of valid overlaps by a given amount. More...
 
void addInvalid (int count)
 Increments the number of invalid overlaps by a given amount. More...
 
void fromPvl (const PvlObject &inStats)
 Loads a previous Equalization state from an input pvl object. More...
 
void setSolved (bool solved)
 Sets solved state indicating if OverlapNormalizations (corrective factors) were solved. More...
 
bool isSolved () const
 Indicates if the corrective factors were solved. More...
 

Private Member Functions

int getCCDType (int ccd)
 

Private Attributes

std::vector< int > movedIndices
 

Detailed Description

Author
????-??-?? Unknown

Definition at line 48 of file HiEqualization.h.

Member Function Documentation

◆ addAdjustment()

void Isis::Equalization::addAdjustment ( ImageAdjustment adjustment)
protectedinherited

Adds an image adjustment.

This method adds an image adjustment to be used for equalizing.

Parameters
adjustment- ImageAdjustment pointer to add.

Definition at line 713 of file Equalization.cpp.

◆ addHolds()

void Isis::Equalization::addHolds ( QString  holdListName)
inherited

Adds a list of images to be held in the equalization.

Parameters
holdListNameName of the file containing a list of images to hold.
Exceptions
IException::User"The list of identifiers to be held must be less than or equal to the total number of identifiers."
IException::User"The hold list file does not match a file in the from list"

Definition at line 78 of file Equalization.cpp.

References _FILEINFO_, and Isis::FileList::read().

◆ addInvalid()

void Isis::Equalization::addInvalid ( int  count)
protectedinherited

Increments the number of invalid overlaps by a given amount.

Parameters
countAn integer value to increment the internally stored number of invalid overlaps

Definition at line 755 of file Equalization.cpp.

◆ addValid()

void Isis::Equalization::addValid ( int  count)
protectedinherited

Increments the number of valid overlaps by a given amount.

Parameters
countAn integer value to increment the internally stored number of valid overlaps

Definition at line 745 of file Equalization.cpp.

◆ applyCorrection()

void Isis::Equalization::applyCorrection ( QString  toListName = "")
inherited

Equalizes the input images.

This method applies corretive factors to the input images, thereby equalizing them.

Parameters
toListName(Default value is "") List of cube names to save the equalized images as
Exceptions
IException::User"Corrective factors have not yet been determined. Fix any " "non-overlapping images and recalculate the image statistics."

Definition at line 461 of file Equalization.cpp.

References _FILEINFO_, Isis::Cube::bandCount(), Isis::ProcessByBrick::EndProcess(), Isis::Cube::lineCount(), Isis::ProcessByLine::ProcessCube(), Isis::Process::Progress(), Isis::Cube::sampleCount(), Isis::ProcessByLine::SetInputCube(), Isis::ProcessByBrick::SetOutputCube(), Isis::Progress::SetText(), and Isis::toString().

◆ calculateBandStatistics()

void Isis::Equalization::calculateBandStatistics ( )
protectedinherited

Calculates the image statistics on a band-by-band basis.

This method calculates statistics by band for the input images. Each set of band statistics is used to initialize the OverlapNormalizations that will be used to determine gains and offsets for equalization.

Definition at line 206 of file Equalization.cpp.

References Isis::ProcessByBrick::EndProcess(), Isis::ProcessByLine::ProcessCubeInPlace(), Isis::Process::Progress(), Isis::ProcessByLine::SetInputCube(), Isis::Progress::SetText(), and Isis::toString().

◆ calculateOverlapStatistics()

void Isis::Equalization::calculateOverlapStatistics ( )
protectedinherited

Calculates the overlap statistics for each pair of input images.

This method calculates any overlap statistics that have not been previously calculated for the input images.

Definition at line 246 of file Equalization.cpp.

References Isis::OverlapStatistics::GetMStats(), Isis::OverlapStatistics::HasOverlap(), Isis::Cube::open(), Isis::OverlapStatistics::SetMincount(), Isis::toString(), Isis::MultivariateStatistics::ValidPixels(), Isis::MultivariateStatistics::X(), and Isis::MultivariateStatistics::Y().

◆ calculateStatistics()

void Isis::Equalization::calculateStatistics ( double  percent,
int  mincnt,
bool  wtopt,
LeastSquares::SolveMethod  methodType 
)
inherited

Calculates the image and overlap statistics, and then determines corrective factors if possible.

This method calculates image statistics on a band-by-band basis and calculates overlap statistics for the input images. Overlaps are considered valid if the number of valid pixels in the overlapping area is greater than or equal to the provided mincnt parameter. Corrective factors will only be determined if all of the input images have at least one valid overlap.

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.
Exceptions
IException::User"There are input images that do not overlap with enough valid pixels." "See application log or Nonoverlaps keyword in output statistics file"
IException::Unknown"Calculation for equalization statistics failed. Gain = 0."
IException::Unknown"Unable to calculate the equalization statistics. You may " "want to try another LeastSquares::SolveMethod."

Definition at line 130 of file Equalization.cpp.

References _FILEINFO_.

◆ clearAdjustments()

void Isis::Equalization::clearAdjustments ( )
protectedinherited

Frees image adjustments.

Definition at line 698 of file Equalization.cpp.

◆ clearNormalizations()

void Isis::Equalization::clearNormalizations ( )
protectedinherited

Frees overlap normalizations.

Definition at line 721 of file Equalization.cpp.

◆ clearOverlapStatistics()

void Isis::Equalization::clearOverlapStatistics ( )
protectedinherited

Frees overlap statistics.

Definition at line 732 of file Equalization.cpp.

◆ errorCheck()

void Isis::HiEqualization::errorCheck ( QString  fromListName)
protectedvirtual

Checks that the input images have the same mapping groups and same number of bands.

Exceptions
IException::User"Number of bands do not match between cubes"
IException::User"Mapping groups do not match between cubes"

Reimplemented from Isis::Equalization.

Definition at line 107 of file HiEqualization.cpp.

References _FILEINFO_, Isis::Cube::group(), Isis::Cube::open(), Isis::toString(), and Isis::IException::User.

◆ fromPvl()

void Isis::Equalization::fromPvl ( const PvlObject inStats)
protectedinherited

Loads a previous Equalization state from an input pvl object.

This method will unserialize Equalization data from an input pvl, obtaining any previously calculated overlap statistics and corrective factors (if solved).

Parameters
constPvlObject& Input pvl object containing previous Equalization state

Definition at line 768 of file Equalization.cpp.

References Isis::OverlapStatistics::Bands(), Isis::PvlObject::beginObject(), Isis::PvlObject::endObject(), Isis::OverlapStatistics::FileNameX(), Isis::OverlapStatistics::FileNameY(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::OverlapStatistics::GetMStats(), Isis::MultivariateStatistics::ValidPixels(), Isis::MultivariateStatistics::X(), and Isis::MultivariateStatistics::Y().

◆ generateOutputs()

void Isis::Equalization::generateOutputs ( FileList outList)
protectedinherited

Generates the names of the equalized cubes if no output list is provided.

Definition at line 649 of file Equalization.cpp.

References Isis::FileName::baseName(), Isis::FileName::extension(), and Isis::FileName::path().

◆ getResults()

PvlGroup Isis::Equalization::getResults ( )
inherited

Returns general information about the equalization.

This method returns general information about the equalization, including number of valid and invalid overlaps, any non-overlapping images, the LeastSquares solution type, the type of equalization adjustmnet, and corrective factors (if solved).

Definition at line 514 of file Equalization.cpp.

References Isis::toString().

◆ importStatistics()

void Isis::Equalization::importStatistics ( QString  instatsFileName)
inherited

Imports statistics for applying correction.

This method obtains corrective factors from an input statistics pvl file so that input images can be equalized. These corrective factors are obtained from Normalization groups within the EqualizationInformation object in the input pvl.

See also
Equalization::applyCorrection()
Parameters
instatsFileNameName of the input statistics pvl file

Definition at line 412 of file Equalization.cpp.

References Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::group(), Isis::PvlContainer::hasKeyword(), Isis::PvlContainer::keywords(), and Isis::toDouble().

◆ isSolved()

bool Isis::Equalization::isSolved ( ) const
protectedinherited

Indicates if the corrective factors were solved.

Returns
bool Returns true if corrective factors were solved

Definition at line 874 of file Equalization.cpp.

◆ loadInputs()

void Isis::Equalization::loadInputs ( QString  fromListName)
protectedinherited

Loads in the input images.

This method loads in the input images contained in the provided file name.

Parameters
fromListNameName of the file containing the input images
Exceptions
IException::User"The input file must contain at least 2 file names"

Definition at line 567 of file Equalization.cpp.

References _FILEINFO_, Isis::Cube::bandCount(), Isis::Cube::open(), and Isis::toString().

◆ loadOutputs()

void Isis::Equalization::loadOutputs ( FileList outList,
QString  toListName 
)
protectedinherited

Checks that the output image list is correct.

Exceptions
IException::User"Each input file in the FROM LIST must have a corresponding output file in the TO LIST."
IException::User"The to list file has the same name as its corresponding from list fil."

Definition at line 667 of file Equalization.cpp.

References _FILEINFO_, Isis::FileList::read(), and Isis::toString().

◆ recalculateStatistics()

void Isis::Equalization::recalculateStatistics ( QString  instatsFileName)
inherited

Recalculates statistics for any new input images.

This method loads a previous Equalization state from an input pvl file and calculates overlap statistics for any new input images. Corrective factors will also be calculated if there are no non-overlapping images and there are enough valid overlaps.

Parameters
instatsFileNameName of input pvl file containing previously calculated statistics

Definition at line 393 of file Equalization.cpp.

◆ setResults()

void Isis::Equalization::setResults ( )
protectedinherited

Creates the results pvl containing statistics and corrective factors.

This method creates the results pvl containing what is essentially serialized Equalization data, which can be unserialized via the fromPvl() method. Note that the overlap statistics in the results pvl may not be ordered if recalculating statistics with a modified input image list.

Definition at line 318 of file Equalization.cpp.

References Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), and Isis::toString().

◆ setSolved()

void Isis::Equalization::setSolved ( bool  solved)
protectedinherited

Sets solved state indicating if OverlapNormalizations (corrective factors) were solved.

Parameters
boolIndiciates if corrective factors were solved

Definition at line 864 of file Equalization.cpp.

◆ write()

void Isis::Equalization::write ( QString  outstatsFileName)
inherited

Write the equalization information (results) to a file.

Parameters
outstatsFileNameThe name of the file to write the results to

Definition at line 547 of file Equalization.cpp.


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