[String] [Up] [MaxTree] Data Types

Coord
Image pixel coordinates

Synopsis

class Coord
{
public:
    Coord();
    Coord(Coord& img);
    Coord(int x, int y=1, int z=1);
    ~Coord();
    Coord& operator=(Coord& img);
    int x() const;
    int y() const;
    int z() const;
};

Description

The pixel coordinates data type is an int32 vector of up to three values depending on the image dimensionality: 1D: [column]; 2D: [row,column]; 3D: [depth,row,column]. The top-left pixel of a 2D image is at the coordinates [0,0]. The center pixel of a structuring element is at coordinates [0,0] increasing from left to right and top to down.

Class Methods

The following public methods are intended for use by application programs:

Technical Notes

The class Coord is a proxy for the internal toolbox coordinate type. It takes care of chores like memory release and exception catching. When a toolbox function returns a coordinate, an object of this class is created to be returned to the caller. The object constructor catches any error ocurred in the function implementation and, in case of error, throws a morphException .

To free your code of the memory allocation statements, keep your Coords created in local space, so the underlying C++ system will take care of the memory releasing. Only in the case of returning an image to another procedure, create the image in the heap with the new operator.

See the code of the demonstrations for examples of use of the Coord class.

See also

Strel Toolbox structuring element type
mmSetrans Translate a structuring element
[String] [Up] [MaxTree]