Isis 3 Programmer Reference
Isis::SubArea Class Reference

Apply corrections to a cube label for subarea extraction. More...

#include <SubArea.h>

Collaboration diagram for Isis::SubArea:
Collaboration graph

Public Member Functions

void SetSubArea (const int orignl, const int origns, const int sl, const int ss, const int el, const int es, const double linc, const double sinc)
 Defines the subarea.
 
void UpdateLabel (Cube *icube, Cube *ocube, PvlGroup &results)
 Modifies a label for a file containing a subarea.
 

Private Attributes

int p_sl
 Starting line of subarea.
 
int p_ss
 Starting sample of subarea.
 
int p_el
 Ending line of subarea.
 
int p_es
 Ending sample of subarea.
 
int p_nl
 Number of lines in original file.
 
int p_ns
 Number of samples in original file.
 
double p_linc
 Line increment for subarea.
 
double p_sinc
 Sample increment for subarea.
 

Detailed Description

Apply corrections to a cube label for subarea extraction.

This class is used to apply corrections to a cube label when a subarea has been extracted. It is a base class which will take the cube label from the original cube file along with subarea information and generate a corrected cube label for the output cube file.

If you would like to see SubArea being used in implementation, see crop, reduce, enlarge, cropspecial, or pad.

Author
2009-10-02 Janet Barrett
History

2010-11-21 Mackenzie Boyd - Modified UpdateLabels method so so that the units for Scale and PixelResolution keywords are perserved.

2011-01-24 Steven Lambright - Cameras are still valid when linc and sinc are not equal, so now this class is more likely to not delete the instrument group.

2013-12-27 Janet Barrett - Modified the UpdateLabel method so that it updates the MinimumLatitude, MaximumLatitude, MinimumLongitude, and MaximumLongitude keywords for equatorial cylindrical projections. All other projections will not have these keywords in their labels because it is not possible to recalculate them for curved projections. Fixes #1500.

Definition at line 47 of file SubArea.h.

Constructor & Destructor Documentation

◆ SubArea()

Isis::SubArea::SubArea ( )
inline

Definition at line 49 of file SubArea.h.

◆ ~SubArea()

Isis::SubArea::~SubArea ( )
inline

Definition at line 51 of file SubArea.h.

Member Function Documentation

◆ SetSubArea()

void Isis::SubArea::SetSubArea ( const int orignl,
const int origns,
const int sl,
const int ss,
const int el,
const int es,
const double linc,
const double sinc )

Defines the subarea.

Parameters
orignlThis is the number of lines in the original image.
orignsThis is the number of samples in the original image.
slThis is the line in the original image where the subarea will start at. This value must be greater than or equal to 1 and less than or equal to the number of lines in the original image.
ssThis is the sample in the original image where the subarea will start at. This value must be greater than or equal to 1 and less than or equal to the number of samples in the original image.
elThis is the ending line of the subarea to extract from the original image. This value must be greater than or equal to sl and less than or equal to the number of lines in the original image. The actual number of lines that will be in the subarea will be (el-sl+1)/linc.
esThis is the ending sample of the subarea to extract from the original image. This value must be greater than or equal to ss and less than or equal to the number of samples in the original image. The actual number of samples that will be in the subarea will be (es-ss+1)/sinc.
lincThis is the line increment that will be used to extract the subarea from the original image. It must be greater than 0.
sincThis is the sample increment that will be used to extract the subarea from the original image. It must be greater than 0.

Definition at line 60 of file SubArea.cpp.

References p_el, p_es, p_linc, p_nl, p_ns, p_sinc, p_sl, p_ss, and Isis::IException::Programmer.

Referenced by Isis::FileTool::saveAs_FullResolution(), Isis::Enlarge::UpdateOutputLabel(), and Isis::Reduce::UpdateOutputLabel().

◆ UpdateLabel()

void Isis::SubArea::UpdateLabel ( Cube * icube,
Cube * ocube,
PvlGroup & results )

Modifies a label for a file containing a subarea.

The AlphaCube, Mapping, and Instrument groups are all affected when a subarea is extracted from another file. If the linc is not equal to the sinc, then the Instrument and Mapping groups will be removed from the label because they will no longer be valid. If the linc is equal to the sinc and they are not equal to 1, then the map scale and resolution in the Mapping group needs to be updated. The latitude and longitude ranges become invalid when the subarea does not cover the entire sample and line range of the original cube. Update the upper left corner x,y values if the projection is still valid and the starting line and/or starting sample have been changed from their location in the original file.

Parameters
icubeThis is the input cube that will have the subarea extracted from it. The label of this cube will be used to create updated Mapping, Instrument, and AlphaCube groups for the label of the output cube containing the subarea.
ocubeThis is the output cube file containing the subarea. The label of this cube will be modified by extracting the Mapping, Instrument, and AlphaCube groups from the input label and putting them in this label.
resultsThis 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 126 of file SubArea.cpp.

References Isis::PvlContainer::addKeyword(), Isis::PvlObject::findObject(), p_el, p_es, p_linc, p_nl, p_ns, p_sinc, p_sl, p_ss, Isis::Projection::SetWorld(), Isis::toDouble(), Isis::toString(), and Isis::PvlObject::Traverse.

Member Data Documentation

◆ p_el

int Isis::SubArea::p_el
private

Ending line of subarea.

Definition at line 64 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_es

int Isis::SubArea::p_es
private

Ending sample of subarea.

Definition at line 65 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_linc

double Isis::SubArea::p_linc
private

Line increment for subarea.

Definition at line 68 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_nl

int Isis::SubArea::p_nl
private

Number of lines in original file.

Definition at line 66 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_ns

int Isis::SubArea::p_ns
private

Number of samples in original file.

Definition at line 67 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_sinc

double Isis::SubArea::p_sinc
private

Sample increment for subarea.

Definition at line 69 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_sl

int Isis::SubArea::p_sl
private

Starting line of subarea.

Definition at line 62 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().

◆ p_ss

int Isis::SubArea::p_ss
private

Starting sample of subarea.

Definition at line 63 of file SubArea.h.

Referenced by SetSubArea(), and UpdateLabel().


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