GLIMSView Source Code Documentation

ImageCube Class Reference

#include <ImageCube.h>

Inheritance diagram for ImageCube:

Inheritance graph
[legend]

List of all members.


Detailed Description

ImageCube is a representation of an image in an easy-to-manage form.

The general purpose of ImageCube is to hold a part of an image, but it could hold the whole image. Pixels can be refereced by xyz coordinates relatice to both image and cube.

Author:
Erica Liszewski 2006-04-10

Definition at line 15 of file ImageCube.h.


Public Member Functions

 ImageCube (int x1, int y1, int w1, int h1, ImageInterface *theimage)
 ImageCube (int x1, int y1, int w1, int h1)
 constructor, creates a cube and sets the size
 ~ImageCube ()
 destructor
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

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

Classes

struct  Layer
 Layer - represents an image band. More...
struct  Pixel
 Pixel - a pixel. More...
struct  ThreeDPoint
 ThreeDPoint - a point in 3d space. More...

Constructor & Destructor Documentation

ImageCube::ImageCube ( int  x1,
int  y1,
int  w1,
int  h1,
ImageInterface theimage 
)

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

constructor, creates a cube and sets the size

Parameters:
[in] x1 int where the lowest corner is in the original image
[in] y1 int where the lowest corner is in the original image
[in] w1 int the width of the cube
[in] h1 int the height of the cube

Definition at line 24 of file ImageCube.cpp.

References height, highestPoint, layers, lowestPoint, width, ImageCube::ThreeDPoint::x, ImageCube::ThreeDPoint::y, and ImageCube::ThreeDPoint::z.

ImageCube::~ImageCube (  ) 

destructor

Definition at line 41 of file ImageCube.cpp.

References theCube.


Member Function Documentation

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

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

Definition at line 48 of file ImageCube.cpp.

References theCube.

double ImageCube::getValueAtLocal ( int  x,
int  y,
int  z 
)

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 theCube, and width.

Referenced by getValueAtOverall().

double ImageCube::getValueAtOverall ( int  x,
int  y,
int  z 
)

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 getValueAtLocal(), lowestPoint, ImageCube::ThreeDPoint::x, and ImageCube::ThreeDPoint::y.

Referenced by ImageSelectionCube::getAsString().

Here is the call graph for this function:

ImageCube::ThreeDPoint ImageCube::getLowestPoint (  ) 

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 lowestPoint.

ImageCube::ThreeDPoint ImageCube::getHighestPoint (  ) 

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 highestPoint.

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

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, layers, theCube, and ImageCube::Layer::values.

Referenced by addBands().

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

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, layers, theCube, and ImageCube::Layer::values.

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

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 addBand(), height, and width.

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

Here is the call graph for this function:


Member Data Documentation

Definition at line 42 of file ImageCube.h.

Referenced by ImageCube().

int ImageCube::width [protected]

width of the cube

Definition at line 43 of file ImageCube.h.

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

int ImageCube::height [protected]

height of the cube

Definition at line 44 of file ImageCube.h.

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

int ImageCube::layers [protected]

number of layers in the cube

Definition at line 45 of file ImageCube.h.

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

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

Definition at line 46 of file ImageCube.h.

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

where the opposite corner falls in original image

Definition at line 47 of file ImageCube.h.

Referenced by getHighestPoint(), and ImageCube().

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

holds all the layers, effectivly the cube

Definition at line 49 of file ImageCube.h.

Referenced by addBand(), ImageArithmaticCube::calculate(), getValueAtLocal(), getValuesOf(), ~ImageCube(), and ImageSelectionCube::~ImageSelectionCube().


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

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