#include <ImageArithmaticCube.h>
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 | |
ImageInterface * | image |
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< Layer > | theCube |
holds all the layers, effectivly the cube |
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/.
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.
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.
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().
bool ImageArithmaticCube::calculate | ( | ) |
Performs the specified calculation on the cube, without returning the resulting layer.
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).
[in] | x | int x index |
[in] | y | int y index |
[in] | z | int z index |
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.
[in] | x | int x index |
[in] | y | int y index |
[in] | z | int z index |
Definition at line 74 of file ImageCube.cpp.
References ImageCube::getValueAtLocal(), ImageCube::lowestPoint, ImageCube::ThreeDPoint::x, and ImageCube::ThreeDPoint::y.
Referenced by ImageSelectionCube::getAsString().
ImageCube::ThreeDPoint ImageCube::getLowestPoint | ( | ) | [inherited] |
Definition at line 80 of file ImageCube.cpp.
References ImageCube::lowestPoint.
ImageCube::ThreeDPoint ImageCube::getHighestPoint | ( | ) | [inherited] |
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
[in] | vals | std::vector<double> the values to form the layer |
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
[in] | vals | std::vector<double> the values to form the layer |
[in] | layernum | int the location of the layer |
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
[in] | vals | std::vector<double> the values to form the layer |
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().
Parser ImageArithmaticCube::parser [protected] |
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] |
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] |
holds all the layers, effectivly the cube
Definition at line 49 of file ImageCube.h.
Referenced by ImageCube::addBand(), calculate(), ImageCube::getValueAtLocal(), ImageCube::getValuesOf(), ImageCube::~ImageCube(), and ImageSelectionCube::~ImageSelectionCube().
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |