Isis 3 Programmer Reference
Isis::Reduce Class Reference

Reduce the pixel dimensions of an image. More...

#include <Reduce.h>

Inheritance diagram for Isis::Reduce:
Inheritance graph
Collaboration diagram for Isis::Reduce:
Collaboration graph

Public Member Functions

 Reduce (Isis::Cube *pInCube, const double sampleScale, const double lineScale)
 Constructor.
 
 ~Reduce ()
 Destructor.
 
Isis::PvlGroup UpdateOutputLabel (Isis::Cube *pOutCube)
 Create label for the reduced output image.
 
void setInputBoundary (int startSample, int endSample, int startLine, int endLine)
 Parameters to input image sub area.
 

Protected Attributes

Isis::CubemInCube
 Input image.
 
double mdSampleScale
 Sample scale.
 
double mdLineScale
 Line scale.
 
int miStartSample
 Input start sample.
 
int miEndSample
 Input end sample.
 
int miStartLine
 Input start line.
 
int miEndLine
 Input end line.
 
double mdLine
 Line index.
 
int miOutputSamples
 Output Samples.
 
int miOutputLines
 Output Lines.
 
int miInputSamples
 Input Samples.
 
int miInputLines
 Input Lines.
 
int miInputBands
 Input Bands.
 
int miBandIndex
 Band Index.
 
Isis::Portalm_iPortal
 Input portal.
 

Detailed Description

Reduce the pixel dimensions of an image.

Reduce the pixel dimensions of an image. Has the functionality to reduce only a sub area in input image to output

Author
1995-11-06 Jeff Anderson
History

2011-04-15 Sharmila Prasad - Ported the class from "reduce" app to base object class.

2011-05-10 Sharmila Prasad - Fixed error while setting input bands and moved static members to data members in Average class.

2011-05-11 Sharmila Prasad - Use Portal instead of LineMgr to read Line & added API setInputBoundary to reduce subarea of an image

2011-08-19 Jeannie Backer - Modified unitTest to use $temporary variable instead of /tmp directory.

2012-02-01 Sharmila Prasad - Remove unused band data member Fixes #00681

2013-01-16 Tracie Sucharski - Fixed bug caused by a round off error when calculating scales when output line and sample are entered. This resulted in output bands beyond band 1 being NULL in the output cube. This only happened with certain values of output lines and scales. Also, fixed the the swapping of output samples and lines in the Results group in the print.prt file. Fixes #1385.

Definition at line 47 of file Reduce.h.

Constructor & Destructor Documentation

◆ Reduce()

Isis::Reduce::Reduce ( Isis::Cube * pInCube,
const double sampleScale,
const double lineScale )

Constructor.

Reduce Constructor.

Author
Sharmila Prasad (4/26/2011)
Parameters
pInCube- Input cube
psBands- Bands list
sampleScale- Sample scale
lineScale- Line scale
History
2013-01-16 Tracie Sucharski - Use rounding instead of ceil function to prevent errors that were caused by round off. The reduce application would get ons, onl from the user, calculate scale and pass the scale in to this class, which would calculate ons, onl, which could be different from the user entered values.

Definition at line 32 of file Reduce.cpp.

References Isis::Cube::bandCount(), Isis::Cube::lineCount(), m_iPortal, mdLine, mdLineScale, mdSampleScale, miBandIndex, miEndLine, miEndSample, miInputBands, miInputLines, miInputSamples, mInCube, miOutputLines, miOutputSamples, miStartLine, miStartSample, Isis::Cube::pixelType(), and Isis::Cube::sampleCount().

◆ ~Reduce()

Isis::Reduce::~Reduce ( )

Destructor.

Author
Sharmila Prasad (5/11/2011)

Definition at line 66 of file Reduce.cpp.

References m_iPortal.

Member Function Documentation

◆ setInputBoundary()

void Isis::Reduce::setInputBoundary ( int startSample,
int endSample,
int startLine,
int endLine )

Parameters to input image sub area.

Parameters to input image sub area to be reduced.

Author
Sharmila Prasad (5/11/2011)
Parameters
startSample- input image start sample
endSample- input image end sample
startLine- input image start line
endLine- input image end line
History
2013-01-16 Tracie Sucharski - Use rounding instead of ceil function to prevent errors that were caused by round off. The reduce application would get ons, onl from the user, calculate scale and pass the scale in to this class, which would calculate ons, onl, which could be different from the user entered values.

Definition at line 87 of file Reduce.cpp.

References mdLine, mdLineScale, mdSampleScale, miEndLine, miEndSample, miInputLines, miInputSamples, miOutputLines, miOutputSamples, miStartLine, and miStartSample.

◆ UpdateOutputLabel()

Isis::PvlGroup Isis::Reduce::UpdateOutputLabel ( Isis::Cube * pOutCube)

Create label for the reduced output image.

Update the Mapping, Instrument, and AlphaCube groups in the output cube label.

Parameters
pOutCube- Resulting reduced output cube
pResultsGrp- This is the Results group that will go into the application log file. This group must be created by the calling application. Information will be added to it if the Mapping or Instrument groups are deleted from the output image label

Definition at line 112 of file Reduce.cpp.

References Isis::Cube::lineCount(), mdLineScale, mdSampleScale, miEndLine, miEndSample, miInputLines, miInputSamples, mInCube, miOutputLines, miOutputSamples, miStartLine, miStartSample, Isis::Cube::sampleCount(), Isis::SubArea::SetSubArea(), and Isis::toString().

Member Data Documentation

◆ m_iPortal

Isis::Portal* Isis::Reduce::m_iPortal
protected

Input portal.

Definition at line 77 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), and ~Reduce().

◆ mdLine

double Isis::Reduce::mdLine
mutableprotected

Line index.

Definition at line 70 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), and setInputBoundary().

◆ mdLineScale

double Isis::Reduce::mdLineScale
protected

◆ mdSampleScale

double Isis::Reduce::mdSampleScale
protected

Sample scale.

Definition at line 64 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miBandIndex

int Isis::Reduce::miBandIndex
mutableprotected

Band Index.

Definition at line 76 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), and Reduce().

◆ miEndLine

int Isis::Reduce::miEndLine
protected

Input end line.

Definition at line 69 of file Reduce.h.

Referenced by Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miEndSample

int Isis::Reduce::miEndSample
protected

Input end sample.

Definition at line 67 of file Reduce.h.

Referenced by Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miInputBands

int Isis::Reduce::miInputBands
protected

Input Bands.

Definition at line 75 of file Reduce.h.

Referenced by Isis::Average::operator()(), and Reduce().

◆ miInputLines

int Isis::Reduce::miInputLines
protected

Input Lines.

Definition at line 74 of file Reduce.h.

Referenced by Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miInputSamples

int Isis::Reduce::miInputSamples
protected

Input Samples.

Definition at line 73 of file Reduce.h.

Referenced by Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ mInCube

Isis::Cube* Isis::Reduce::mInCube
protected

Input image.

Definition at line 63 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), and UpdateOutputLabel().

◆ miOutputLines

int Isis::Reduce::miOutputLines
protected

Output Lines.

Definition at line 72 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miOutputSamples

int Isis::Reduce::miOutputSamples
protected

Output Samples.

Definition at line 71 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miStartLine

int Isis::Reduce::miStartLine
protected

Input start line.

Definition at line 68 of file Reduce.h.

Referenced by Reduce(), setInputBoundary(), and UpdateOutputLabel().

◆ miStartSample

int Isis::Reduce::miStartSample
protected

Input start sample.

Definition at line 66 of file Reduce.h.

Referenced by Isis::Nearest::operator()(), Isis::Average::operator()(), Reduce(), setInputBoundary(), and UpdateOutputLabel().


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