GLIMSView Source Code Documentation

ImageArithmaticCube Class Reference

#include <ImageArithmaticCube.h>

Inheritance diagram for ImageArithmaticCube:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 13 of file ImageArithmaticCube.h.


Public Member Functions

 ImageArithmaticCube (int x1, int y1, int w1, int h1)
 ImageArithmaticCube is a specialized ImageCube that handles arithmatic between layers.
 ~ImageArithmaticCube ()
 ~ImageArithmaticCube() Destroys the ImageArithmaticCube
void setEquation (std::string eq)
 void setEquation(std::string eq) std::string eq - the equation to be executed on this cube Sets the equation that will be used for calculations.
std::vector< double > * calculateLayer ()
 std::vector<double> calculateLayer() Preforms the specified calculation on the cube, and returns the resulting layer.
bool calculate ()
 Performs the specified calculation on the cube, without returning the resulting layer.
std::vector< double > * getCalculatedLayer ()
 std::vector<double> getCalculatedLayer() Returns the calculated layer, but does no calculations.
std::vector< double > * getValuesOf (int z)
 int z - z index (band or layer) returns the value for layer (band) z
double getValueAtLocal (int x, int y, int z)
 Uses a local reference (i.e.
double getValueAtOverall (int x, int y, int z)
 Location is specified in terms of the original image.
ThreeDPoint getLowestPoint ()
ThreeDPoint getHighestPoint ()
bool addBand (std::vector< double > *vals)
 adds a layer to the end of the current "stack" of layers
bool addBand (std::vector< double > *vals, int layernum)
 add a layer in to a specific location
bool addBands (std::vector< double > *vals)
 adds several layers in consecutive order.

Protected Attributes

Parser parser
std::vector< double > * calculatedLayer
 the results layer
bool eqset
 true if the equation has been set for this Cube
ImageInterfaceimage
int width
 width of the cube
int height
 height of the cube
int layers
 number of layers in the cube
ThreeDPoint lowestPoint
 where (0,0,0) falls in the original image
ThreeDPoint highestPoint
 where the opposite corner falls in original image
std::vector< LayertheCube
 holds all the layers, effectivly the cube

Constructor & Destructor Documentation

ImageArithmaticCube::ImageArithmaticCube ( int  x1,
int  y1,
int  w1,
int  h1 
)

ImageArithmaticCube is a specialized ImageCube that handles arithmatic between layers.

It uses muParser to parse and deal with the equation. Info on muParser can be found in it's folder, or at http://muparser.sourceforge.net/.

Author:
Erica Liszewski 2006-04-20 ImageArithmaticCube(int x1, int y1, int w1, int h1) int x1 - the lowest x value this cube covers int y1 - the lowest y value this cube covers int w1 - the width (in pixels) of this cube int h1 - the height (in pixels) of this cube Creates an ImageArithmaticCube with the specified dimesions.

Definition at line 4 of file ImageArithmaticCube.cpp.

References calculatedLayer, and eqset.

ImageArithmaticCube::~ImageArithmaticCube (  ) 

~ImageArithmaticCube() Destroys the ImageArithmaticCube

Definition at line 11 of file ImageArithmaticCube.cpp.


Member Function Documentation

void ImageArithmaticCube::setEquation ( std::string  eq  ) 

void setEquation(std::string eq) std::string eq - the equation to be executed on this cube Sets the equation that will be used for calculations.

Definition at line 18 of file ImageArithmaticCube.cpp.

References eqset, and parser.

Referenced by ImageCalculator::testDriver().

std::vector< double > * ImageArithmaticCube::calculateLayer (  ) 

std::vector<double> calculateLayer() Preforms the specified calculation on the cube, and returns the resulting layer.

This pointer is creates using new, so it is your responsiblity to see that it's destroyed properly.

Definition at line 24 of file ImageArithmaticCube.cpp.

References calculate(), calculatedLayer, and eqset.

Referenced by ImageCalculator::testDriver().

Here is the call graph for this function:

bool ImageArithmaticCube::calculate (  ) 

Performs the specified calculation on the cube, without returning the resulting layer.

Returns:
boolean indicating success or failure of calculation
History:
2006-07-29 dls added return to allow tool to shut down if something went wrong with calculation

Definition at line 36 of file ImageArithmaticCube.cpp.

References calculatedLayer, ImageCube::height, ImageCube::layers, parser, ImageCube::theCube, and ImageCube::width.

Referenced by calculateLayer().

std::vector< double > * ImageArithmaticCube::getCalculatedLayer (  ) 

std::vector<double> getCalculatedLayer() Returns the calculated layer, but does no calculations.

You must call calculate() first or this will not return anything useful. This is ment for getting the calculated layer if it is needed later in the program after calculate() has been called. If you want to do the calculations and get the resulting layer, use calculateLayer(). The returned pointer is created with new, so it is your responsiblity to see that it is destroyed properly.

Definition at line 76 of file ImageArithmaticCube.cpp.

References calculatedLayer.

std::vector< double > * ImageCube::getValuesOf ( int  z  )  [inherited]

int z - z index (band or layer) returns the value for layer (band) z

Definition at line 48 of file ImageCube.cpp.

References ImageCube::theCube.

double ImageCube::getValueAtLocal ( int  x,
int  y,
int  z 
) [inherited]

Uses a local reference (i.e.

starts at 0,0).

Parameters:
[in] x int x index
[in] y int y index
[in] z int z index
Returns:
double the value at the location specified.

Definition at line 53 of file ImageCube.cpp.

References ImageCube::theCube, and ImageCube::width.

Referenced by ImageCube::getValueAtOverall().

double ImageCube::getValueAtOverall ( int  x,
int  y,
int  z 
) [inherited]

Location is specified in terms of the original image.

Parameters:
[in] x int x index
[in] y int y index
[in] z int z index
Returns:
double the value at the location specified,

Definition at line 74 of file ImageCube.cpp.

References ImageCube::getValueAtLocal(), ImageCube::lowestPoint, ImageCube::ThreeDPoint::x, and ImageCube::ThreeDPoint::y.

Referenced by ImageSelectionCube::getAsString().

Here is the call graph for this function:

ImageCube::ThreeDPoint ImageCube::getLowestPoint (  )  [inherited]

Returns:
ThreeDPoint corresponds to where the lowest point in this cube is in the original image.

Definition at line 80 of file ImageCube.cpp.

References ImageCube::lowestPoint.

ImageCube::ThreeDPoint ImageCube::getHighestPoint (  )  [inherited]

Returns:
ThreeDPoint corresponds to where the highest point in this cube is in the original image.

Definition at line 84 of file ImageCube.cpp.

References ImageCube::highestPoint.

bool ImageCube::addBand ( std::vector< double > *  vals  )  [inherited]

adds a layer to the end of the current "stack" of layers

Parameters:
[in] vals std::vector<double> the values to form the layer
Returns:
boolean true if successful, and false if not

Definition at line 88 of file ImageCube.cpp.

References ImageCube::Layer::layernum, ImageCube::layers, ImageCube::theCube, and ImageCube::Layer::values.

Referenced by ImageCube::addBands().

bool ImageCube::addBand ( std::vector< double > *  vals,
int  layernum 
) [inherited]

add a layer in to a specific location

Parameters:
[in] vals std::vector<double> the values to form the layer
[in] layernum int the location of the layer
Returns:
boolean true if successful, and false if not

Definition at line 99 of file ImageCube.cpp.

References ImageCube::Layer::layernum, ImageCube::layers, ImageCube::theCube, and ImageCube::Layer::values.

bool ImageCube::addBands ( std::vector< double > *  vals  )  [inherited]

adds several layers in consecutive order.

The size of the cube is determined when initialized, so we can determine each layer from the next based on size

Parameters:
[in] vals std::vector<double> the values to form the layer
Returns:
boolean true if successful, and false if not

Definition at line 125 of file ImageCube.cpp.

References ImageCube::addBand(), ImageCube::height, and ImageCube::width.

Referenced by GtoSConverter::getSelectedShapes(), ImageCube::ImageCube(), and ImageCalculator::testDriver().

Here is the call graph for this function:


Member Data Documentation

Parser ImageArithmaticCube::parser [protected]

Definition at line 81 of file ImageArithmaticCube.h.

Referenced by calculate(), and setEquation().

std::vector<double>* ImageArithmaticCube::calculatedLayer [protected]

the results layer

Definition at line 82 of file ImageArithmaticCube.h.

Referenced by calculate(), calculateLayer(), getCalculatedLayer(), and ImageArithmaticCube().

bool ImageArithmaticCube::eqset [protected]

true if the equation has been set for this Cube

Definition at line 83 of file ImageArithmaticCube.h.

Referenced by calculateLayer(), ImageArithmaticCube(), and setEquation().

ImageInterface* ImageCube::image [protected, inherited]

Definition at line 42 of file ImageCube.h.

Referenced by ImageCube::ImageCube().

int ImageCube::width [protected, inherited]

width of the cube

Definition at line 43 of file ImageCube.h.

Referenced by ImageCube::addBands(), calculate(), ImageCube::getValueAtLocal(), and ImageCube::ImageCube().

int ImageCube::height [protected, inherited]

height of the cube

Definition at line 44 of file ImageCube.h.

Referenced by ImageCube::addBands(), calculate(), and ImageCube::ImageCube().

int ImageCube::layers [protected, inherited]

number of layers in the cube

Definition at line 45 of file ImageCube.h.

Referenced by ImageCube::addBand(), calculate(), ImageSelectionCube::getAsString(), and ImageCube::ImageCube().

ThreeDPoint ImageCube::lowestPoint [protected, inherited]

where (0,0,0) falls in the original image

Definition at line 46 of file ImageCube.h.

Referenced by ImageCube::getLowestPoint(), ImageCube::getValueAtOverall(), and ImageCube::ImageCube().

ThreeDPoint ImageCube::highestPoint [protected, inherited]

where the opposite corner falls in original image

Definition at line 47 of file ImageCube.h.

Referenced by ImageCube::getHighestPoint(), and ImageCube::ImageCube().

std::vector<Layer> ImageCube::theCube [protected, inherited]


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov