Isis 3 Programmer Reference
Isis::AlphaCube Class Reference

This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group. More...

#include <AlphaCube.h>

Collaboration diagram for Isis::AlphaCube:
Collaboration graph

Public Member Functions

 AlphaCube (Cube &cube)
 Constructs an AlphaCube object using a PVL object. More...
 
 AlphaCube (int alphaSamples, int alphaLines, int betaSamples, int betaLines)
 Constructs an AlphaCube object given alphaSamples, alphaLines, betaSamples and betaLines. More...
 
 AlphaCube (int alphaSamples, int alphaLines, int betaSamples, int betaLines, double alphaSs, double alphaSl, double alphaEs, double alphaEl)
 Constructs an AlphaCube object with a basic mapping from corner-to-corner, beta 0.5,0.5 maps to alpha 0.5,0.5 and beta ns+0.5,nl+0.5 maps to alpha ns+0.5, nl+0.5. More...
 
 ~AlphaCube ()
 Destroys the AlphaCube object. More...
 
int AlphaLines () const
 Returns the number of lines in the alpha cube. More...
 
int AlphaSamples () const
 Returns the number of samples in the alpha cube. More...
 
int BetaLines () const
 Returns the number of lines in the beta cube. More...
 
int BetaSamples () const
 Returns the number of samples in the beta cube. More...
 
double AlphaLine (double betaLine)
 Returns an alpha line given a beta line. More...
 
double AlphaSample (double betaSample)
 Returns an alpha sample given a beta sample. More...
 
double BetaLine (double alphaLine)
 Returns a beta line given an alpha line. More...
 
double BetaSample (double alphaSample)
 Returns a beta sample given an alpha sample. More...
 
void UpdateGroup (Cube &cube)
 Writes or update the Alpha keywords (AlphaLines, AlphaSamples, AlphaStartingSamples, etc) in the proper group in a PVL object. More...
 
void Rehash (AlphaCube &alphaCube)
 Merges two AlphaCube objects. More...
 

Private Member Functions

void ComputeSlope ()
 Computes the line and sample slopes. More...
 

Private Attributes

int p_alphaLines
 The number of alpha lines in the cube. More...
 
int p_alphaSamples
 The number of alpha samples in the cube. More...
 
int p_betaLines
 The number of beta lines in the cube. More...
 
int p_betaSamples
 The number of beta samples in the cube. More...
 
double p_alphaStartingLine
 The starting alpha line. More...
 
double p_alphaStartingSample
 The starting alpha sample. More...
 
double p_alphaEndingLine
 The ending alpha line. More...
 
double p_alphaEndingSample
 The ending alpha sample. More...
 
double p_lineSlope
 The slope of the line. More...
 
double p_sampSlope
 The slope of the sample set. More...
 

Detailed Description

This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group.

This class allows programmers to map cube pixel positions back to the first cube they came from.This is critical for camera models or radiometric models in order to map input cube pixels to camera detector position. The alpha keywords are automatically generated in programs like crop, pad, reduce, and enlarge.

Author
2004-02-13 Jeff Anderson
History:

2004-02-13 Jeff Anderson - Added another constructor and refactored UpdateGroup method.

2004-06-03 Jeff Anderson - Fixed bug in UpdateGroup which occured when a cube label did not already have a AlphaCube group.

2005-02-14 Leah Dahmer - Modified file to support Doxygen documentation.

2012-09-06 Steven Lambright - Changed the Pvl constructor to take a Cube instead. This was to prevent duplicating complicated label parsing code. This should eventually be refactored into a CubeLabel or similar object so that an actual cube isn't required in the future, but for now this enables the control net GUI to create a camera from a cube with no dimensions in the label.

2017-07-03 Makayla Shepherd - Updated documentation. References #4807.

Todo:
2005-04-06 Add coded example.

Definition at line 62 of file AlphaCube.h.

Constructor & Destructor Documentation

◆ AlphaCube() [1/3]

Isis::AlphaCube::AlphaCube ( Cube cube)

Constructs an AlphaCube object using a PVL object.

Parameters
cubeThe cube to write to

Definition at line 35 of file AlphaCube.cpp.

References Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::Cube::label(), Isis::Cube::lineCount(), and Isis::Cube::sampleCount().

◆ AlphaCube() [2/3]

Isis::AlphaCube::AlphaCube ( int  alphaSamples,
int  alphaLines,
int  betaSamples,
int  betaLines 
)

Constructs an AlphaCube object given alphaSamples, alphaLines, betaSamples and betaLines.

Parameters
alphaSamplesNumber of alpha samples in the cube
alphaLinesNumber of alpha lines in the cube
betaSamplesNumber of beta samples in the cube
betaLinesNumber of beta lines in the cube

Definition at line 102 of file AlphaCube.cpp.

◆ AlphaCube() [3/3]

Isis::AlphaCube::AlphaCube ( int  alphaSamples,
int  alphaLines,
int  betaSamples,
int  betaLines,
double  alphaSs,
double  alphaSl,
double  alphaEs,
double  alphaEl 
)

Constructs an AlphaCube object with a basic mapping from corner-to-corner, beta 0.5,0.5 maps to alpha 0.5,0.5 and beta ns+0.5,nl+0.5 maps to alpha ns+0.5, nl+0.5.

Parameters
alphaSamplesNumber of alpha samples in the cube
alphaLinesNumber of alpha lines in the cube
betaSamplesNumber of beta samples in the cube
betaLinesNumber of beta lines in the cube
alphaSsStarting alpha sample
alphaSlStarting alpha line
alphaEsEnding alpha sample
alphaElEnding alpha line

Definition at line 76 of file AlphaCube.cpp.

◆ ~AlphaCube()

Isis::AlphaCube::~AlphaCube ( )
inline

Destroys the AlphaCube object.

Definition at line 76 of file AlphaCube.h.

Member Function Documentation

◆ AlphaLine()

double Isis::AlphaCube::AlphaLine ( double  betaLine)
inline

Returns an alpha line given a beta line.

Parameters
betaLineThe beta line
Returns
double Beta line

Definition at line 125 of file AlphaCube.h.

References p_alphaStartingLine, and p_lineSlope.

Referenced by Rehash(), and Isis::Camera::SetImage().

◆ AlphaLines()

int Isis::AlphaCube::AlphaLines ( ) const
inline

Returns the number of lines in the alpha cube.

Returns
int Number of lines in the alpha cube

Definition at line 83 of file AlphaCube.h.

References p_alphaLines.

Referenced by Isis::Camera::ParentLines(), and Isis::MocLabels::ReadLabels().

◆ AlphaSample()

double Isis::AlphaCube::AlphaSample ( double  betaSample)
inline

Returns an alpha sample given a beta sample.

Parameters
betaSampleThe beta sample
Returns
double Beta sample

Definition at line 137 of file AlphaCube.h.

References p_alphaStartingSample, and p_sampSlope.

Referenced by Rehash(), and Isis::Camera::SetImage().

◆ AlphaSamples()

int Isis::AlphaCube::AlphaSamples ( ) const
inline

Returns the number of samples in the alpha cube.

Returns
int Number of samples in the alpha cube

Definition at line 93 of file AlphaCube.h.

References p_alphaSamples.

Referenced by Isis::Camera::ParentSamples(), and Isis::MocLabels::ReadLabels().

◆ BetaLine()

double Isis::AlphaCube::BetaLine ( double  alphaLine)
inline

Returns a beta line given an alpha line.

Parameters
alphaLineThe alpha line
Returns
double Alpha line

Definition at line 149 of file AlphaCube.h.

References p_alphaStartingLine, and p_lineSlope.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

◆ BetaLines()

int Isis::AlphaCube::BetaLines ( ) const
inline

Returns the number of lines in the beta cube.

Returns
int Number of lines in the beta cube

Definition at line 103 of file AlphaCube.h.

References p_betaLines.

Referenced by Isis::Camera::CacheSize(), Isis::Camera::LoadCache(), Rehash(), and Isis::Camera::StartEndEphemerisTimes().

◆ BetaSample()

double Isis::AlphaCube::BetaSample ( double  alphaSample)
inline

Returns a beta sample given an alpha sample.

Parameters
alphaSampleThe alpha sample
Returns
double Alpha sample

Definition at line 161 of file AlphaCube.h.

References p_alphaStartingSample, and p_sampSlope.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

◆ BetaSamples()

int Isis::AlphaCube::BetaSamples ( ) const
inline

Returns the number of samples in the beta cube.

Returns
int Number of samples in the beta cube

Definition at line 113 of file AlphaCube.h.

References p_betaSamples.

Referenced by Isis::Camera::LoadCache(), Rehash(), and Isis::Camera::StartEndEphemerisTimes().

◆ ComputeSlope()

void Isis::AlphaCube::ComputeSlope ( )
private

Computes the line and sample slopes.

(Starting and ending alpha lines/samples divided by the number of beta lines/samples).

Todo:
Why the +0.5 and -0.5?

Definition at line 193 of file AlphaCube.cpp.

◆ Rehash()

void Isis::AlphaCube::Rehash ( AlphaCube add)

Merges two AlphaCube objects.

This facilities combinations of programs crop-enlarge, crop-crop, reduce-pad, etc.

Parameters
addThe AlphaCube object to be merged.

Definition at line 123 of file AlphaCube.cpp.

References AlphaLine(), AlphaSample(), BetaLines(), and BetaSamples().

Referenced by UpdateGroup().

◆ UpdateGroup()

void Isis::AlphaCube::UpdateGroup ( Isis::Cube cube)

Writes or update the Alpha keywords (AlphaLines, AlphaSamples, AlphaStartingSamples, etc) in the proper group in a PVL object.

It chooses first to write and AlphaGroup if the Mapping group exists. If not then is will write the keywords in the Instrument group if it exists. Otherwise it will write to the AlphaCube group.

Parameters
&cubeThe cube to write to.

Definition at line 149 of file AlphaCube.cpp.

References Isis::PvlObject::addGroup(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::Cube::label(), Rehash(), and Isis::toString().

Referenced by Isis::SubArea::UpdateLabel().

Member Data Documentation

◆ p_alphaEndingLine

double Isis::AlphaCube::p_alphaEndingLine
private

The ending alpha line.

Definition at line 177 of file AlphaCube.h.

◆ p_alphaEndingSample

double Isis::AlphaCube::p_alphaEndingSample
private

The ending alpha sample.

Definition at line 178 of file AlphaCube.h.

◆ p_alphaLines

int Isis::AlphaCube::p_alphaLines
private

The number of alpha lines in the cube.

Definition at line 171 of file AlphaCube.h.

Referenced by AlphaLines().

◆ p_alphaSamples

int Isis::AlphaCube::p_alphaSamples
private

The number of alpha samples in the cube.

Definition at line 172 of file AlphaCube.h.

Referenced by AlphaSamples().

◆ p_alphaStartingLine

double Isis::AlphaCube::p_alphaStartingLine
private

The starting alpha line.

Definition at line 175 of file AlphaCube.h.

Referenced by AlphaLine(), and BetaLine().

◆ p_alphaStartingSample

double Isis::AlphaCube::p_alphaStartingSample
private

The starting alpha sample.

Definition at line 176 of file AlphaCube.h.

Referenced by AlphaSample(), and BetaSample().

◆ p_betaLines

int Isis::AlphaCube::p_betaLines
private

The number of beta lines in the cube.

Definition at line 173 of file AlphaCube.h.

Referenced by BetaLines().

◆ p_betaSamples

int Isis::AlphaCube::p_betaSamples
private

The number of beta samples in the cube.

Definition at line 174 of file AlphaCube.h.

Referenced by BetaSamples().

◆ p_lineSlope

double Isis::AlphaCube::p_lineSlope
private

The slope of the line.

Definition at line 179 of file AlphaCube.h.

Referenced by AlphaLine(), and BetaLine().

◆ p_sampSlope

double Isis::AlphaCube::p_sampSlope
private

The slope of the sample set.

Definition at line 180 of file AlphaCube.h.

Referenced by AlphaSample(), and BetaSample().


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