itom  4.1.0
ito::DataObject Class Reference

dataObject contains a n-dimensional matrix More...

Classes

struct  MROI
 
struct  MSize
 

Public Member Functions

 DataObject (void)
 constructor for empty data object More...
 
 DataObject (const int size, const int type)
 constructor for one-dimensional data object. The data is newly allocated and arbitrarily filled. More...
 
 DataObject (const int sizeY, const int sizeX, const int type)
 constructor for two-dimensional data object. The data is newly allocated and arbitrarily filled. More...
 
 DataObject (const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous=0)
 constructor for three-dimensional data object. The data is newly allocated and arbitrarily filled. More...
 
 DataObject (const int sizeZ, const int sizeY, const int sizeX, const int type, const uchar *continuousDataPtr, const int *steps=NULL)
 constructor for 3-dimensional data object which uses the data given by the continuousDataPtr. More...
 
 DataObject (const MSize &sizes, const int type, const unsigned char continuous=0)
 constructor for data object with given dimension. The data is newly allocated and arbitrarily filled. More...
 
 DataObject (const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous=0)
 constructor for data object with given dimension. The data is newly allocated and arbitrarily filled. More...
 
 DataObject (const unsigned char dimensions, const int *sizes, const int type, const uchar *continuousDataPtr, const int *steps=NULL)
 constructor for data object which uses the data given by the continuousDataPtr. More...
 
 DataObject (const unsigned char dimensions, const int *sizes, const int type, const cv::Mat *planes, const unsigned int nrOfPlanes)
 constructor for data object from a stack of cv::Mat
 
 DataObject (const cv::Mat &data)
 constructor for data object from a single cv::Mat
 
 DataObject (const DataObject &copyConstr)
 copy constructor for data object More...
 
 ~DataObject (void)
 destructor More...
 
double getValueOffset () const
 < Function return the offset of the values stored within the dataOject More...
 
double getValueScale () const
 Function return the unit description for the values stoerd within the dataOject.
 
const std::string getValueUnit () const
 Function return the description for the values stored within the dataOject, if tagspace does not exist, NULL is returned.
 
std::string getValueDescription () const
 Function return the axis-offset for the existing axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
 
double getAxisOffset (const int axisNum) const
 Function returns the axis-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
 
double getAxisScale (const int axisNum) const
 Function returns the axis-unit-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL. More...
 
const std::string getAxisUnit (const int axisNum, bool &validOperation) const
 Function returns the axis-description for the exist specified by axisNum. If axisNum is out of dimension range it returns NULL. More...
 
std::string getAxisDescription (const int axisNum, bool &validOperation) const
 < Function returns the axis-description for the exist specified by axisNum. If axisNum is out of dimension range it returns NULL.
 
DataObjectTagType getTag (const std::string &key, bool &validOperation) const
 
bool getTagByIndex (const int tagNumber, std::string &key, DataObjectTagType &value) const
 Function returns the string-value for 'key' identified by int tagNumber. If key in the TagMap do not exist NULL is returned.
 
std::string getTagKey (const int tagNumber, bool &validOperation) const
 Function returns the number of elements in the Tags-Maps. More...
 
int getTagListSize () const
 Function to set the string-value of the value unit, return 1 if values does not exist. More...
 
int setValueUnit (const std::string &unit)
 Function to set the string-value of the value description, return 1 if values does not exist. More...
 
int setValueDescription (const std::string &description)
 set the offset of the axisNum-th axis. Offset is in pixel. The relation is: physical unit = (pixel unit - offset) * scale More...
 
int setAxisOffset (const unsigned int axisNum, const double offset)
 set the scaling of the axisNum-th axis. Scaling is in (physical unit / pixel). The relation is: physical unit = (pixel unit - offset) * scale More...
 
int setAxisScale (const unsigned int axisNum, const double scale)
 set the unit of the axisNum-th axis as latin1 encoded string More...
 
int setAxisUnit (const unsigned int axisNum, const std::string &unit)
 set the description of the axisNum-th axis as latin1 encoded string More...
 
int setAxisDescription (const unsigned int axisNum, const std::string &description)
 < Function to set the description (string value) of the specified axis, return 1 if axis does not exist
 
int setTag (const std::string &key, const DataObjectTagType &value)
 < Function to set the string value of the specified tag, if the tag do not exist, it will be added automatically, return 1 if tagspace does not exist
 
bool existTag (const std::string &key) const
 < Function to check whether tag exist or not
 
bool deleteTag (const std::string &key)
 < Function deletes specified tag. If tag do not exist, return value is 1 else returnvalue is 0
 
bool deleteAllTags ()
 
int addToProtocol (const std::string &value)
 < Function adds value to the protocol-tag. If this object is an ROI, the ROI-coordinates are added. If string do not end with an
,
is added.
 
double getPhysToPix (const unsigned int dim, const double phys, bool &isInsideImage) const
 Function returns the not rounded pixel index of a physical coordinate. More...
 
double getPhysToPix (const unsigned int dim, const double phys) const
 Function returns the not rounded pixel index of a physical coordinate. More...
 
int getPhysToPix2D (const double physY, double &tPxY, bool &isInsideImageY, const double physX, double &tPxX, bool &isInsideImageX) const
 Function returns the not rounded pixel index of a physical coordinate. More...
 
double getPixToPhys (const unsigned int dim, const double pix, bool &isInsideImage) const
 Function returns the physical coordinate of a pixel. More...
 
double getPixToPhys (const unsigned int dim, const double pix) const
 Function returns the physical coordinate of a pixel. More...
 
RetVal setXYRotationalMatrix (double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)
 Function to access (set) the rotiational matrix by each element. More...
 
RetVal getXYRotationalMatrix (double &r11, double &r12, double &r13, double &r21, double &r22, double &r23, double &r31, double &r32, double &r33) const
 Function to access (get) the rotiational matrix by each element. More...
 
RetVal copyTagMapTo (DataObject &rhs) const
 
RetVal copyAxisTagsTo (DataObject &rhs) const
 
RetVal setReal (DataObject &valuesObj)
 high-level value which calculates the real value of each element of the input source data object and returns the resulting data object More...
 
RetVal setImag (DataObject &valuesObj)
 high-level value which calculates the real value of each element of the input source data object and returns the resulting data object More...
 
int getDims (void) const
 
int getType (void) const
 
char getContinuous (void) const
 
char getOwnData (void) const
 
int seekMat (const int matNum, const int numMats) const
 returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index More...
 
int seekMat (const int matNum) const
 returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index More...
 
int calcNumMats (void) const
 calculates numbers of single opencv matrices which are part of the ROI which has previously been set. More...
 
int getNumPlanes (void) const
 calculates numbers of single opencv matrices which are part of the ROI which has previously been set. More...
 
cv::Mat * getCvPlaneMat (const int planeIndex)
 returns pointer to cv::Mat plane with given index considering a possible roi. More...
 
const cv::Mat * getCvPlaneMat (const int planeIndex) const
 returns pointer to cv::Mat plane with given index considering a possible roi. More...
 
const cv::Mat getContinuousCvPlaneMat (const int planeIndex) const
 returns a shallow or deep copy of a cv::Mat plane with given index. If the current plane is not continuous (due to a roi), a cloned, continuous matrix is returned, else a shallow copy. More...
 
cv::Mat ** get_mdata (void)
 returns array of pointers to cv::_Mat-matrices (planes) of the data object. More...
 
const cv::Mat ** get_mdata (void) const
 returns constant array of pointers to cv::_Mat-matrices (planes) of the data object More...
 
MSize getSize (void)
 returns the size-member. m_size fits to the physical organization of data in memory. More...
 
const MSize getSize (void) const
 returns the size-member. This member does not consider the transpose flag, hence, m_size fits to the physical organization of data in memory. More...
 
int getSize (int index) const
 gets the size of the given dimension (this is the size within the ROI) More...
 
MSize getOriginalSize (void)
 returns the original size-member. This is equal to getSize() if no roi is set to the dataObject. More...
 
const MSize getOriginalSize (void) const
 returns the original size-member. This is equal to getSize() if no roi is set to the dataObject. More...
 
int getOriginalSize (int index) const
 gets the original size of the given dimension (this is the size without considering any ROI) More...
 
int getStep (int index) const
 returns a normalized step in the index-th axis, this is the number of values one has to walk in order to get the next value in the index-th axis. More...
 
int getTotal () const
 gets total number of elements within the data object's ROI More...
 
int getOriginalTotal () const
 gets total number of elements of the whole data object More...
 
RetVal copyTo (DataObject &rhs, unsigned char regionOnly=0) const
 high-level, non-templated method to deeply copy the data of this matrix to another matrix rhs More...
 
RetVal convertTo (DataObject &rhs, const int type, const double alpha=1, const double beta=0) const
 high-level, non-templated matrix conversion More...
 
RetVal setTo (const int8 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const uint8 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const int16 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const uint16 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const int32 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const uint32 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const float32 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const float64 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const complex64 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const complex128 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal setTo (const ito::Rgba32 &value, const DataObject &mask=DataObject())
 Sets all or some of the array elements to the specific value. More...
 
RetVal deepCopyPartial (DataObject &copyTo)
 copy all values of this data object to the copyTo data object. The copyTo-data object must be allocated and have the same type and size (of its roi) than this data object. The compared sequence of sizes only contains dimensions whose size is bigger than one (e.g. it is possible to copy a 5x1 object to a 1x1x5 object) More...
 
DObjIterator begin ()
 Returns the matrix iterator and sets it to the first matrix element. More...
 
DObjIterator end ()
 Returns the matrix iterator and sets it to the after-last matrix element. More...
 
DObjConstIterator constBegin () const
 Returns the matrix read-only iterator and sets it to the first matrix element. More...
 
DObjConstIterator constEnd () const
 Returns the matrix read-only iterator and sets it to the after-last matrix element. More...
 
DataObjectoperator= (const cv::Mat &rhs)
 assign-operator which creates a two-dimensional data object as a shallow copy of a two dimensional cv::Mat object. More...
 
DataObjectoperator= (const DataObject &rhs)
 assign-operator which makes a shallow-copy of the rhs data object and stores it in this data object More...
 
DataObjectoperator= (const int8 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const uint8 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const int16 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const uint16 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const int32 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const uint32 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const float32 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const float64 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const complex64 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const complex128 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator= (const ito::Rgba32 &value)
 Every data element in this data object is set to the given value. More...
 
DataObjectoperator+= (const DataObject &rhs)
 high-level, non-templated arithmetic operator for element-wise addition of values of given data object to this data object More...
 
DataObjectoperator+= (const float64 &value)
 
DataObjectoperator+= (const complex128 &value)
 
DataObject operator+ (const DataObject &rhs)
 high-level, non-templated arithmetic operator for element-wise addition of values of two given data objects More...
 
DataObject operator+ (const float64 &value)
 
DataObject operator+ (const complex128 &value)
 
DataObjectoperator-= (const DataObject &rhs)
 high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object More...
 
DataObjectoperator-= (const float64 &value)
 
DataObjectoperator-= (const complex128 &value)
 
DataObject operator- (const DataObject &rhs)
 high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object More...
 
DataObject operator- (const float64 &value)
 
DataObject operator- (const complex128 &value)
 
DataObjectoperator*= (const DataObject &rhs)
 inplace matrix multiplication of this dataObject with rhs (this *= rhs) More...
 
DataObjectoperator*= (const float64 &factor)
 high-level method which multiplies every element in this data object by a given floating-point factor More...
 
DataObjectoperator*= (const complex128 &factor)
 
DataObject operator* (const DataObject &rhs)
 matrix multiplication of this dataObject with rhs. The result is returned. More...
 
DataObject operator* (const float64 &factor)
 high-level method which multiplies every element in this data object by a given floating-point factor. The result matrix is returned as a new matrix. More...
 
DataObject operator* (const complex128 &factor)
 
DataObject operator< (DataObject &rhs)
 compare operator, compares for "lower than" More...
 
DataObject operator> (DataObject &rhs)
 compare operator, compares for "bigger than" More...
 
DataObject operator<= (DataObject &rhs)
 compare operator, compares for "lower or equal than" More...
 
DataObject operator>= (DataObject &rhs)
 compare operator, compares for "bigger or equal than" More...
 
DataObject operator== (DataObject &rhs)
 compare operator, compares for "equal to" More...
 
DataObject operator!= (DataObject &rhs)
 compare operator, compares for "unequal to" More...
 
DataObject operator< (const float64 &value)
 compare operator, compares for "lower than" More...
 
DataObject operator> (const float64 &value)
 compare operator, compares for "bigger than" More...
 
DataObject operator<= (const float64 &value)
 compare operator, compares for "lower or equal than" More...
 
DataObject operator>= (const float64 &value)
 compare operator, compares for "bigger or equal than" More...
 
DataObject operator== (const float64 &value)
 compare operator, compares for "equal to" More...
 
DataObject operator!= (const float64 &value)
 compare operator, compares for "unequal to" More...
 
DataObject operator== (const ito::complex64 &value)
 
DataObject operator!= (const ito::complex64 &value)
 compare operator, compares for "unequal to" More...
 
DataObject operator== (const ito::complex128 &value)
 
DataObject operator!= (const ito::complex128 &value)
 
DataObject operator<< (const unsigned int shiftbit)
 high-level operator, which shifts the elements of this data objects by a given number of bits to the left and returns the new data object More...
 
DataObjectoperator<<= (const unsigned int shiftbit)
 high-level operator, which shifts the elements of this data objects by a given number of bits to the left More...
 
DataObject operator>> (const unsigned int shiftbit)
 high-level operator, which shifts the elements of this data objects by a given number of bits to the right and returns the new data object More...
 
DataObjectoperator>>= (const unsigned int shiftbit)
 high-level operator, which shifts the elements of this data objects by a given number of bits to the right More...
 
DataObject operator& (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise and" between this data object and a given data object More...
 
DataObjectoperator&= (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise and" between this data object and a given data object More...
 
DataObject operator| (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object More...
 
DataObjectoperator|= (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object More...
 
DataObject operator^ (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object More...
 
DataObjectoperator^= (const DataObject &rhs)
 high-level operator, which executes the element-wise operation "bitwise xor" between this data object and a given data object More...
 
DataObject bitwise_not () const
 
RetVal zeros (const int type)
 allocates a zero-value matrix of size 1x1 with the given type More...
 
RetVal zeros (const int size, const int type)
 allocates a zero-value matrix of size 1 x size with the given type More...
 
RetVal zeros (const int sizeY, const int sizeX, const int type)
 allocates a zero-value matrix of size sizeY x sizeX with the given type More...
 
RetVal zeros (const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous=0)
 allocates a zero-value, 3D- matrix of size sizeZ x sizeY x sizeX with the given type More...
 
RetVal zeros (const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous=0)
 high-level, non-templated base function for allocation of new matrix whose elements are all set to zero More...
 
RetVal ones (const int type)
 allocates a one-value matrix of size 1x1 with the given type More...
 
RetVal ones (const int size, const int type)
 allocates a one-value matrix of size 1 x size with the given type More...
 
RetVal ones (const int sizeY, const int sizeX, const int type)
 allocates a one-value matrix of size sizeY x sizeX with the given type More...
 
RetVal ones (const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous=0)
 allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type More...
 
RetVal ones (const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous=0)
 high-level, non-templated base function for allocation of new matrix whose elements are all set to one More...
 
RetVal nans (const int type)
 allocates a one-value matrix of size 1x1 with the given type More...
 
RetVal nans (const int size, const int type)
 allocates a one-value matrix of size 1 x size with the given type More...
 
RetVal nans (const int sizeY, const int sizeX, const int type)
 allocates a one-value matrix of size sizeY x sizeX with the given type More...
 
RetVal nans (const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous=0)
 allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type More...
 
RetVal nans (const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous=0)
 high-level, non-templated base function for allocation of new matrix whose elements are all set to one More...
 
RetVal rand (const int type, const bool randMode=false)
 allocates a random-value matrix of size 1x1 with the given type More...
 
RetVal rand (const int size, const int type, const bool randMode=false)
 allocates a random-value matrix of size 1 x size with the given type More...
 
RetVal rand (const int sizeY, const int sizeX, const int type, const bool randMode=false)
 allocates a random-value matrix of size sizeY x sizeX with the given type More...
 
RetVal rand (const int sizeZ, const int sizeY, const int sizeX, const int type, const bool randMode, const unsigned char continuous=0)
 allocates a random-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type More...
 
RetVal rand (const unsigned char dimensions, const int *sizes, const int type, const bool randMode, const unsigned char continuous=0)
 high-level, non-templated base function for allocation of new matrix whose elements are all set to one More...
 
RetVal eye (const int type)
 sets the matrix of this data object to a two-dimensional eye-matrix of size 1, hence [1] More...
 
RetVal eye (const int size, const int type)
 sets the matrix of this data object to a two-dimensional eye-matrix of given size More...
 
RetVal conj ()
 converts every element of the data object to its conjugate complex value More...
 
DataObject adj () const
 converts every element of the data object to its adjungate value More...
 
DataObject trans () const
 transposes this data object More...
 
DataObject mul (const DataObject &mat2, const double scale=1.0) const
 high-level method which does a element-wise multiplication of elements in this matrix with elements in the second matrix. More...
 
DataObject div (const DataObject &mat2, const double scale=1.0) const
 high-level method which does a element-wise division of elements in this matrix by elements in second source matrix. More...
 
DataObject pow (const ito::float64 &power)
 
void pow (const ito::float64 &power, DataObject &dst)
 
DataObject sqrt ()
 
void sqrt (DataObject &dst)
 
DataObject squeeze () const
 
DataObject reshape (int newDims, const int *newSizes) const
 
int elemSize () const
 returns number of bytes required by each value in the array. More...
 
template<typename _Tp >
const _Tp & at (const unsigned int y, const unsigned int x) const
 addressing method for two-dimensional data object. More...
 
template<typename _Tp >
_Tp & at (const unsigned int y, const unsigned int x)
 addressing method for two-dimensional data object. More...
 
template<typename _Tp >
const _Tp & at (const unsigned int z, const unsigned int y, const unsigned int x) const
 addressing method for three-dimensional data object. More...
 
template<typename _Tp >
_Tp & at (const unsigned int z, const unsigned int y, const unsigned int x)
 addressing method for three-dimensional data object. More...
 
template<typename _Tp >
const _Tp & at (const unsigned int *idx) const
 addressing method for n-dimensional data object. More...
 
template<typename _Tp >
_Tp & at (const unsigned int *idx)
 addressing method for n-dimensional data object. More...
 
DataObject at (const ito::Range &rowRange, const ito::Range &colRange) const
 addressing method for two-dimensional data object with two given range-values. returns shallow copy of addressed regions. More...
 
DataObject at (ito::Range *ranges) const
 addressing method for n-dimensional data object with n given range-values. returns shallow copy of addressed regions More...
 
DataObject at (const DataObject &mask) const
 addressing method that returns a 1xM data object of the same type than this object with only values that are marked in the given uint8 mask object More...
 
uchar * rowPtr (const int matNum, const int y)
 returns pointer to the data in the y-th row in the 2d-matrix plane matNum More...
 
const uchar * rowPtr (const int matNum, const int y) const
 returns pointer to the data in the y-th row in the 2d-matrix plane matNum More...
 
template<typename _Tp >
_Tp * rowPtr (const int matNum, const int y)
 returns pointer to the data in the y-th row in the 2d-matrix plane matNum More...
 
template<typename _Tp >
const _Tp * rowPtr (const int matNum, const int y) const
 returns pointer to the data in the y-th row in the 2d-matrix plane matNum More...
 
DataObject row (const int selRow) const
 low-level, templated method which changes the region of interest of the data object to the selected zero-based row index More...
 
DataObject col (const int selCol) const
 low-level, templated method which changes the region of interest of the data object to the selected zero-based col index More...
 
DataObject toGray (const int destinationType=ito::tUInt8) const
 converts a color image (rgba32) to a gray-scale image More...
 
DataObject splitColor (const char *destinationColor, const int &dtype) const
 returns a color channel of a color image (rgba32) More...
 
DataObject lineCut (const double *coordinates, const int &len) const
 high-level method which takes a line cut across the planes of a dataObject. More...
 
DataObjectadjustROI (const int dtop, const int dbottom, const int dleft, const int dright)
 adjust submatrix size and position within the two-dimensional data-object More...
 
DataObjectadjustROI (const unsigned char dims, const int *lims)
 adjust submatrix size and position within the n-dimensional data-object More...
 
RetVal locateROI (int *wholeSizes, int *offsets) const
 method locates ROI of this data object within its original data block More...
 
RetVal locateROI (int *lims) const
 method get ROI of this data object within its original data block More...
 
template<typename _Tp >
RetVal copyFromData2D (const _Tp *src, const int sizeX, const int sizeY)
 copies the externally given source data inside this data object More...
 
template<typename _Tp >
RetVal copyFromData2D (const _Tp *src, const int sizeX, const int sizeY, const int x0, const int y0, const int width, const int height)
 copies the externally given source data inside this data object More...
 
template<typename T2 >
 operator T2 ()
 cast operator for data object More...
 
template<typename _Tp >
RetVal linspace (const _Tp start, const _Tp end, const _Tp inc, const int transposed)
 
template<typename _Tp >
ito::RetVal linspace (const _Tp start, const _Tp end, const _Tp inc, const int transposed)
 equivalent to matlab linspace functino More...
 

Static Public Member Functions

static DataObject stack (const DataObject *mats, int num, unsigned int axis=0)
 returns a stack of multiple dataObjects (number is equal to num) along the given axis (default: 0). More...
 

Private Member Functions

void createHeader (const unsigned char dimensions, const int *sizes, const int *steps, const int elemSize)
 create header information for data objects with a given size and step sizes to jump from one element in a dimension to the next one. More...
 
void createHeaderWithROI (const unsigned char dimensions, const int *sizes, const int *osizes=NULL, const int *roi=NULL)
 create header information for data objects with a given size, optional roi indeces and a possible original size More...
 
void create (const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous, const uchar *continuousDataPtr=NULL, const int *steps=NULL)
 high-level, non-templated method for data allocation More...
 
void create (const unsigned char dimensions, const int *sizes, const int type, const cv::Mat *planes, const unsigned int nrOfPlanes)
 high-level, non-templated method for data allocation More...
 
void freeData (void)
 high-level, non-templated method for freeing data More...
 
void secureFreeData (void)
 high-level, non-templated method for securely freeing data More...
 
ito::RetVal matNumToIdx (const int matNum, int *matIdx) const
 
ito::RetVal matIdxToNum (const unsigned int *matIdx, int *matNum) const
 calculates the index of the matrix-plane in the m_data-vector for a given vector of indices, which address one element in the n-dimensional matrix More...
 
 DataObject (const DataObject &dObj, bool transposed)
 
int mdata_realloc (const int size)
 
int mdata_size (void) const
 
int mdata_free ()
 
RetVal copyFromData2DInternal (const uchar *src, const int sizeOfElem, const int sizeX, const int sizeY)
 
RetVal copyFromData2DInternal (const uchar *src, const int sizeOfElem, const int sizeX, const int x0, const int y0, const int width, const int height)
 

Private Attributes

char m_continuous
 
char m_owndata
 
int m_type
 
int * m_pRefCount
 
int m_dims
 
MSize m_osize
 
MROI m_roi
 
MSize m_size
 
uchar ** m_data
 
DataObjectTagsPrivatem_pDataObjectTags
 

Static Private Attributes

static const int m_sizeofs = sizeof(int) < sizeof(int *) ? 1 : sizeof(int) / sizeof(int *)
 

Friends

template<typename _Tp >
RetVal CreateFunc (DataObject *dObj, const unsigned char dimensions, const int *sizes, const unsigned char continuous, const uchar *continuousDataPtr, const int *steps)
 templated method for create More...
 
template<typename _Tp >
RetVal CreateFuncWithCVPlanes (DataObject *dObj, const unsigned char dimensions, const int *sizes, const cv::Mat *planes, const unsigned int nrOfPlanes)
 templated method for creation with given vector of cv::Mat-planes More...
 
template<typename _Tp >
RetVal FreeFunc (DataObject *dObj)
 low-level, templated method for freeing allocated data blocks More...
 
template<typename _Tp >
RetVal SecureFreeFunc (DataObject *dObj)
 
template<typename _Tp >
RetVal CopyToFunc (const DataObject &lhs, DataObject &rhs, unsigned char regionOnly)
 low-level, templated method for deeply copying the data of one matrix to another given matrix More...
 
template<typename _Tp >
RetVal ConvertToFunc (const DataObject &lhs, DataObject &rhs, const int type, const double alpha, const double beta)
 converts data in DataObject lhs to DataObject rhs with a given type More...
 
template<typename _Tp >
RetVal AdjustROIFunc (DataObject *dObj, const int *lims)
 
template<typename _Tp >
RetVal AssignScalarFunc (const DataObject *src, const ito::tDataType type, const void *scalar)
 
template<typename _Tp >
RetVal MakeContinuousFunc (const DataObject &dObj, DataObject &resDObj)
 low-level, templated method which copies an incontinuously organized data object to a continuously organized resulting data object More...
 
template<typename _Tp >
RetVal EvaluateTransposeFlagFunc (DataObject *dObj)
 
template<typename _Tp >
std::ostream & coutFunc (std::ostream &out, const DataObject &dObj)
 
template<typename _Tp >
RetVal GetRangeFunc (DataObject *dObj, const int dtop, const int dbottom, const int dleft, const int dright)
 low-level, templated method for saving a shallow copy of a source cv::Mat_ to a destination cv::Mat_ with respect to given row- and col-ranges More...
 
template<typename _Tp >
RetVal AdjustROIFunc (DataObject *dObj, int dtop, int dbottom, int dleft, int dright)
 low-level, templated method for adjusting the ROI of a data object by the given incremental values More...
 

Detailed Description

dataObject contains a n-dimensional matrix

The n-dimensional matrix can have different element types. Recently the following types are supported: int8, uint8, int16, uint16, int32, uint32, float32, float64 (=> double), complex64 (2x float32), complex128 (2x float64)

In order to handle huge matrices, the data object can divide one matrix into subparts in memory. Each subpart (called matrix-plane) is two-dimensional and covers data of the last two dimensions. Each of these matrix-planes is of type cv::Mat_<type> and can be used with every operator given by the openCV-framework (version 2.3.1 or higher).

We assume to have a n-dimensional matrix A, where each dimension has its size s_i, hence A=[s_1, s_2, ..., s_(n-2), s_(n-1), s_n]

Hence, in total there are s_1 * s_2 * ... * s_(n-2) different matrix-planes, which are all accessible by the member m_data, which is a std::vector of the general type int*. This type has to be casted to the specific cv::Mat_<...> when one matrix-plane has to be accessed. Sometimes it is also possible to simply cast to cv::Mat.

In order to make the data object compatible to continuously organized data structures, like numpy-arrays, it is also possible to have all matrix-planes in one data-block in memory. Then the continuous-flag will be set and the whole data block can be accessed by taking the pointer given by m_data[0]. Nevertheless, the indicated data structure with the two-dimensional sub-matrix-planes is still existing, hence, the pointer to each matrix-planes points to the entry point of its matrix-planes lying withing the huge data block.

The data organization is equal to the one of open-cv, hence, two-dimensional matrices are stored row-by-row (C-style)...

The real size of each dimension is stored in the vector m_osize. Since it is possible to set a n-dimensional region of interest (ROI) to each matrix, the virtual dimensions, which will be delivered if the user asks for the matrix size, are stored in the member vector m_size.

Concept to handle templated and non-templated methods

According to openCV, the class dataObject is not templated, because there are some structures in the entire itom-framework which does not support any templating concept, like the plugin-handling or communication with external dll-functions. Additionally the signal-slot-design of the Qt-framework does not accept templated parameters beside some standard-objects. Therefore the element-data-type is set by the integer-member m_type. The transformation between the real data type and the integer number is coded several times within the whole framework and can be accessed by the enumeration tDataType in typeDefs.h. Since templating has got many advantages concerning low-level calculation, we adapted the transformation-process which is used by openCV:

  1. define a templated helper-method in the following form:

    template<typename _Tp> returnType 'MethodName'Func(Parameters1)

  2. define the following two lines of code: typedef returnType (*t'MethodName'Func)(Parameters1); MAKEFUNCLIST('MethodName'Func);
  3. define the method, accessed for example as public-method of dataObject RetVal DataObject::'PublicMethodName'(Parameters2) { ... fList'MethodName'Func[getType()](Parameters1); ... return ... }
    By the macro MAKEFUNCLIST a list fList'MethodName'Func is generated with each entry being a function pointer to the specific templated version of 'MethodName'Func. The specific method is accessed by using getType() of dataObject. Hence it is important to keep the element-data-types and their order consistent for the whole itom-project.

Constructor & Destructor Documentation

ito::DataObject::DataObject ( const DataObject dObj,
bool  transposed 
)
private

copy constructor for transposed creation

ito::DataObject::DataObject ( void  )

constructor for empty data object

no data will be allocated, the number of elements and dimensions is set to zero

ito::DataObject::DataObject ( const int  size,
const int  type 
)

constructor for one-dimensional data object. The data is newly allocated and arbitrarily filled.

In fact, by this constructor a two-dimensional matrix with dimension 1 x size will be created. the owndata-flag is set to true, the continuously-flag, too (since only one matrix-plane will be created)

Parameters
sizeis the number of elements
typeis the data-type of each element (use type of enumeration tDataType)
See also
create, tDataType
ito::DataObject::DataObject ( const int  sizeY,
const int  sizeX,
const int  type 
)

constructor for two-dimensional data object. The data is newly allocated and arbitrarily filled.

the owndata-flag is set to true, the continuously-flag, too (since only one matrix-plane will be created)

Parameters
sizeYis the number of rows in each matrix-plane
sizeXis the number of columns in each matrix-plane
typeis the data-type of each element (use type of enumeration tDataType)
See also
create, tDataType
ito::DataObject::DataObject ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const unsigned char  continuous = 0 
)

constructor for three-dimensional data object. The data is newly allocated and arbitrarily filled.

the owndata-flag is set to true

Parameters
sizeZis the number of images in the z-direction
sizeYis the number of rows in each matrix-plane
sizeXis the number of columns in each matrix-plane
typeis the data-type of each element (use type of enumeration tDataType)
continuousindicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
See also
create, tDataType
ito::DataObject::DataObject ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const uchar *  continuousDataPtr,
const int *  steps = NULL 
)

constructor for 3-dimensional data object which uses the data given by the continuousDataPtr.

In case of the continuousDataPtr, the owndata-flag is set to false, hence this DataObject will not delete the data. Additionally the continuous-flag is set to true. The external data must be kept alive during the entire lifetime of this DataObject.

Parameters
sizeZis the number of images in the z-direction
sizeYis the number of rows in each matrix-plane
sizeXis the number of columns in each matrix-plane
typeis the data-type of each element (use type of enumeration tDataType)
*continuousDataPtrpoints to the first element of a continuous data block of the specific data type
*stepsmay be NULL, if the data in continuousDataPtr should be taken continuously, hence the ROI is the whole matrix, else this is a vector with three elements, where each elements indicates the number of bytes one has to move in order to get from one element to the next one in the same dimension. Hence, the last element in this vector is equal to the size of one single element (in bytes)
See also
create, tDataType
ito::DataObject::DataObject ( const MSize sizes,
const int  type,
const unsigned char  continuous = 0 
)

constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.

the owndata-flag is set to true

Parameters
sizes
typeis the data-type of each element (use type of enumeration tDataType)
continuousindicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
See also
create, tDataType
ito::DataObject::DataObject ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const unsigned char  continuous = 0 
)

constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.

the owndata-flag is set to true

Parameters
dimensionsindicates the total number of dimensions
*sizesis a vector of size 'dimensions', where each element gives the size (not osize) of the specific dimension
typeis the data-type of each element (use type of enumeration tDataType)
continuousindicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
See also
create, tDataType
ito::DataObject::DataObject ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const uchar *  continuousDataPtr,
const int *  steps = NULL 
)

constructor for data object which uses the data given by the continuousDataPtr.

In case of the continuousDataPtr, the owndata-flag is set to false, hence this dataObj will not delete the data. Additionally the continuous-flag is set to true. The external data must be kept alive during the entire lifetime of this DataObject.

Parameters
dimensionsindicates the total number of dimensions
*sizesis a vector of size 'dimensions', where each element gives the size (not osize) of the specific dimension
typeis the data-type of each element (use type of enumeration tDataType)
*continuousDataPtrpoints to the first element of a continuous data block of the specific data type
*stepsmay be NULL, if the data in continuousDataPtr should be taken continuously, hence the ROI is the whole matrix, else this is a vector of size 'dimensions', where each elements indicates the number of bytes one has to move in order to get from one element to the next one in the same dimension. Hence, the last element in this vector is equal to the size of one single element (in bytes)
See also
create, ito::tDataType
ito::DataObject::DataObject ( const DataObject copyConstr)

copy constructor for data object

copy constructor

creates a data object with respect to the given data object. The header information is completely copied, while the data is a shallow copy. The lock of the new data object is unlocked while the lock for the common data block is taken from the current lock status of the given data object.

Parameters
&copyConstris the data object, which will be copied
ito::DataObject::~DataObject ( void  )

destructor

reference pointer of data is decremented and if <0, data will be deleted if owndata-flag is true. Additionally the allocated memory for header information will be deleted, too.

See also
freeData

Member Function Documentation

DataObject ito::DataObject::adj ( ) const

converts every element of the data object to its adjungate value

The adjungate is the transposed matrix, where each element is complex conjugated.

Exceptions
cv::Exceptionif data type is not complex.
Returns
retOk
See also
conj
DataObject & ito::DataObject::adjustROI ( const int  dtop,
const int  dbottom,
const int  dleft,
const int  dright 
)

adjust submatrix size and position within the two-dimensional data-object

changes the boundaries of the ROI of a two-dimensional data object by the given incremental values

Parameters
dtopThe shift of the top submatrix boundary upwards (positive value means upwards)
dbottomThe shift of the bottom submatrix boundary downwards (positive value means downwards)
dleftThe shift of the left submatrix boundary to the left (positive value means to the left)
drightThe shift of the right submatrix boundary to the right (positive value means to the right)
Remarks
the parameters indicates the shift with respect to the virtual order of the matrix, hence, the transpose flag is considered in this method
Returns
reference to this data object
Exceptions
cv::Exceptionif data object is not two-dimensional
See also
adjustROI
DataObject & ito::DataObject::adjustROI ( const unsigned char  dims,
const int *  lims 
)

adjust submatrix size and position within the n-dimensional data-object

changes the boundaries of the ROI of a n-dimensional data object by the given incremental values

dims is the number of dimensions

Parameters
*limsis a integer array whose length is 2*dims. For every dimension, two adjacent values indicates the shift of the ROI. The first of both values indicates the shift of the ROI towards the first element in the matrix (positive direction). The second value indicates the shift of the ROI towards the last element in the matrix (positive direction).
Returns
reference to this data object
Remarks
lims indicates the shift with respect to the virtual order of the matrix, hence, the transpose flag is considered in this method
See also
adjustROI
template<typename _Tp >
const _Tp& ito::DataObject::at ( const unsigned int  y,
const unsigned int  x 
) const
inline

addressing method for two-dimensional data object.

Parameters
yis the zero-based row-index to the element which is requested (considering any ROI)
xis the zero-based column-index to the element which is requested (considering any ROI)
Returns
const reference to specific element
template<typename _Tp >
_Tp& ito::DataObject::at ( const unsigned int  y,
const unsigned int  x 
)
inline

addressing method for two-dimensional data object.

Parameters
yis the zero-based row-index to the element which is requested (considering any ROI)
xis the zero-based column-index to the element which is requested (considering any ROI)
Returns
reference to specific element
template<typename _Tp >
const _Tp& ito::DataObject::at ( const unsigned int  z,
const unsigned int  y,
const unsigned int  x 
) const
inline

addressing method for three-dimensional data object.

Parameters
zis the zero-based z-index to the element which is requested (considering any ROI)
yis the zero-based row-index to the element which is requested (considering any ROI)
xis the zero-based column-index to the element which is requested (considering any ROI)
Returns
const reference to specific element
template<typename _Tp >
_Tp& ito::DataObject::at ( const unsigned int  z,
const unsigned int  y,
const unsigned int  x 
)
inline

addressing method for three-dimensional data object.

Parameters
zis the zero-based z-index to the element which is requested (considering any ROI)
yis the zero-based row-index to the element which is requested (considering any ROI)
xis the zero-based column-index to the element which is requested (considering any ROI)
Returns
reference to specific element
template<typename _Tp >
const _Tp& ito::DataObject::at ( const unsigned int *  idx) const
inline

addressing method for n-dimensional data object.

Parameters
*idxis vector whose size is equal to the data object's dimensions. Each entry indicates the zero-based index of its specific dimension considering any ROI
Remarks
The idx vector must indicate the indizes in "virtual"-order (user-friendly order)
Returns
const reference to specific element
template<typename _Tp >
_Tp& ito::DataObject::at ( const unsigned int *  idx)
inline

addressing method for n-dimensional data object.

Parameters
*idxis vector whose size is equal to the data object's dimensions. Each entry indicates the zero-based index of its specific dimension considering any ROI
Remarks
The idx vector must indicate the indizes in "virtual"-order (user-friendly order)
Returns
reference to specific element
DataObject ito::DataObject::at ( const ito::Range rowRange,
const ito::Range colRange 
) const

addressing method for two-dimensional data object with two given range-values. returns shallow copy of addressed regions.

addressing method for two-dimensional data object with two given range-values. returns shallow copy of addressed regions

Parameters
rowRangeis the desired rowRange which should be in the new ROI (considers any existing ROI, too)
colRangeis the desired colRange which should be in the new ROI (considers any existing ROI, too)
Returns
new data object which is a shallow copy of this data object and whose ROI is set to the given row- and col-ranges
Exceptions
cv::Exceptionif number of dimensions is unequal to two.
DataObject ito::DataObject::at ( ito::Range ranges) const

addressing method for n-dimensional data object with n given range-values. returns shallow copy of addressed regions

addressing method for n-dimensional data object with n given range-values. returns shallow copy of addressed regions

If any of the given ranges exceed the boundaries of its corresponding dimension, the range will be set to the boundaries. ranges will be given in "virtual" order, hence, the transpose-flag is considered by this method.

Parameters
*rangesis vector of desired ranges for each dimension
Returns
new data object with shallow copy of this data object and adjusted ROI with respect to the given ranges
See also
GetRangeFunc
DataObject ito::DataObject::at ( const DataObject mask) const

addressing method that returns a 1xM data object of the same type than this object with only values that are marked in the given uint8 mask object

addressing method that returns a Mx1 data object of the same type than this object with only values that are marked in the given uint8 mask object

This method returns a new 1xM data object with the same type than this data object. The M columns are filled with a values of this data object whose corresponding mask value is != 0.

Parameters
maskis a uint8 mask data object with the same size than this object. Values != 0 are valid values in the mask.
Returns
new data object with shallow copy of this data object and adjusted ROI with respect to the given ranges
DObjIterator ito::DataObject::begin ( )

Returns the matrix iterator and sets it to the first matrix element.

returns iterator to the first item in the data object array

Returns
iterator
See also
DObjIterator
DataObject ito::DataObject::bitwise_not ( ) const

All other types will raise an exception. Compute bit-wise and element-wise inversion. For signed integer inputs, the two's complement is returned. For floating-point objects, its machine-specific bit representation is used for the operation

int ito::DataObject::calcNumMats ( void  ) const

calculates numbers of single opencv matrices which are part of the ROI which has previously been set.

Returns
0 if empty range or empty matrix, 1 if two dimensional, else product of sizes of all dimensions besides the last two ones.
See also
getNumPlanes
DataObject ito::DataObject::col ( const int  selCol) const

low-level, templated method which changes the region of interest of the data object to the selected zero-based col index

Parameters
*dObj
unsignedint selCol indicates the zero-based col-index (considering any existing ROI)
Returns
retOkhigh-level method which makes a new header for the specified matrix column and returns it. The underlying data of the new matrix is shared with the original matrix.
Parameters
selColis the specific zero-based row index
Returns
new data object
Exceptions
cv::Exceptionif dimension is unequal to two.
See also
ColFunc
RetVal ito::DataObject::conj ( )

converts every element of the data object to its conjugate complex value

Exceptions
cv::Exceptionif data type is not complex.
Returns
retOk
See also
ConjFunc
DObjConstIterator ito::DataObject::constBegin ( ) const

Returns the matrix read-only iterator and sets it to the first matrix element.

returns constant iterator to the first item in the data object array

Returns
iterator
See also
DObjConstIterator
DObjConstIterator ito::DataObject::constEnd ( ) const

Returns the matrix read-only iterator and sets it to the after-last matrix element.

returns constant iterator to the end value of this data object array

The end value is the first item outside of the data object array.

Returns
iterator
See also
DObjConstIterator
RetVal ito::DataObject::convertTo ( DataObject rhs,
const int  type,
const double  alpha = 1,
const double  beta = 0 
) const

high-level, non-templated matrix conversion

Convertes an array to another data type with optional scaling (alpha * value + beta)

Every element of the source matrix is converted to a new, given type. Additionally a floating-point scaling and offset parameter is possible.

Parameters
&rhsis the destination data object, whose memory is firstly deleted, then newly allocated
typeis the type-number of the destination element
alphascaling factor (default: 1.0)
betaoffset value (default: 0.0)
Exceptions
cv::Exceptionif cast failed, e.g. if cast not possible or types unknown
Returns
retOk
See also
fListConvertToFunc
RetVal ito::DataObject::copyAxisTagsTo ( DataObject rhs) const

Deep copies the axistags to rhs object

this function makes a deepcopy of the axis and value metadata from this object to rhs object. It copies

Parameters
&rhsis the matrix where the map is copied from. The old map of this object is cleared first
Returns
retOk
See also
DataObjectTags
template<typename _Tp >
RetVal ito::DataObject::copyFromData2D ( const _Tp *  src,
const int  sizeX,
const int  sizeY 
)
inline

copies the externally given source data inside this data object

This method obtains an externally given source array that must have the same element type than this data object. Its dimension is given by sizeX and sizeY and must correspond to the x-size and y-size of this data object. It is allowed that this data object is a shallow copy with a possible region of interest of another (bigger) object.

Then, the given array is copied inside of the values of the data object. The external array must have a row-wise data arrangment (c-style), hence, one row follows after the other one.

Parameters
_Tp*src is the source array. The type of the array is analyzed at compile time (_Tp is the placeholder for this type as template parameter)
sizeXis the width of the array and must fit to the plane width of the data object
sizeYis the height of the array and must fit to the plane height of the data object
Returns
RetVal error if sizeX or sizeY does not fit to the size of the data object or if the type of the given array does not fit to the type of the data object
template<typename _Tp >
RetVal ito::DataObject::copyFromData2D ( const _Tp *  src,
const int  sizeX,
const int  sizeY,
const int  x0,
const int  y0,
const int  width,
const int  height 
)
inline

copies the externally given source data inside this data object

This method obtains an externally given source array that must have the same element type than this data object. Its dimension is given by sizeX and sizeY and must correspond to the x-size and y-size of this data object. It is allowed that this data object is a shallow copy with a possible region of interest of another (bigger) object.

Then, the given array is copied inside of the values of the data object. The external array must have a row-wise data arrangment (c-style), hence, one row follows after the other one.

In this method, it is allowed that the original width and height of the given data is different than the plane size of this data object. Then only a subregion of the external data is copied, indicated by the x0 and y0 indices of the first value and its width and height (sizeX and sizeY are the original size of the given data). width and height must correspond to the plane size of the data object.

Parameters
_Tp*src is the source array. The type of the array is analyzed at compile time (_Tp is the placeholder for this type as template parameter)
sizeXis the width of the array.
sizeYis the height of the array.
x0is the x-index of the first value of the source data that is copied.
y0is the y-index of the first value of the source data that is copied.
widthis the width of the sub-region of the source data that should be copied (must fit to the width of the data object)
heightis the height of the sub-region of the source data that should be copied (must fit to the height of the data object)
Returns
RetVal error if sizeX or sizeY does not fit to the size of the data object or if the type of the given array does not fit to the type of the data object
RetVal ito::DataObject::copyTagMapTo ( DataObject rhs) const

Deep copies the tagmap with all entries to rhs object

this function makes a deepcopy of the tags map to rhs object from this object.

Parameters
&rhsis the matrix where the map is copied to. The old map of ths object is cleared first
Returns
retOk
See also
DataObjectTags
RetVal ito::DataObject::copyTo ( DataObject rhs,
unsigned char  regionOnly = 0 
) const

high-level, non-templated method to deeply copy the data of this matrix to another matrix rhs

deeply copies the data of this data object to the given rhs-dataObject. regionOnly defines if only data within the current ROI should be copied or the entire matrix with the current ROI borders. The destination object is newly allocated if its current number od dimensions, type or size of the ROI does not fit.

In case of 'regionOnly' == false, the destination dataObject 'rhs' is always newly allocated before copying data and the tags as well as the axis descriptions etc. are also copied from the source object. If the source object has a ROI set, the entire object with all data outside of the ROI is copied and the ROI is applied to the destination object, too.

If 'regionOnly' == true, only data within a current ROI is copied to the destination object. In this case, the destination is only newly allocated if its current dimension, size or type do not fit to the source object. Else, data is copied into the existing memory. Tags and axis descriptions etc. are always copied to the destination object.

Parameters
&rhsis the matrix where the data is copied to. The old data of rhs is deleted first
regionOnly,iftrue, only the data of the ROI in lhs is copied, hence, the org-size of rhs corresponds to the ROI-size of lhs, else the whole data block is copied and the ROI of rhs is set to the ROI of lhs
Returns
retOk
See also
deepCopyPartial
void ito::DataObject::create ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const unsigned char  continuous,
const uchar *  continuousDataPtr = NULL,
const int *  steps = NULL 
)
private

high-level, non-templated method for data allocation

allocates new data

Parameters
dimensionsis the total number of dimensions
*sizesis a vector whose length is equal to dimensions. Each entry indicates the size of the specific dimension. Each matrix-plane is allocated with the size of the last two sizes
typeis the desired element data type (see tDataType)
continuousindicates wether the entire array should be allocated in one connected data block in memory (true) or not (default, better for huge matrices)
*continuousDataPtris NULL if new data storage should be allocated (then m_owndata is true). Otherwise this pointer points to the starting point of a continuous data block, where this data-object should be refer to (then m_owndata is false). The data is not copied and the dataObject does not take ownership of the external data, hence it must be allocated during the lifetime of the dataObject and deallocated afterwards.
*stepsvector with size of dimensions, indicates how many bytes one has to move in order to get to the next element in the same dimension, the step-size for the last element must be set to element-size
Exceptions
open-cverror in case of error
See also
CreateFunc
void ito::DataObject::create ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const cv::Mat *  planes,
const unsigned int  nrOfPlanes 
)
private

high-level, non-templated method for data allocation

Parameters
[in]dimensionsis the total number of dimensions
[in]*sizesis a vector whose length is equal to dimensions. Each entry indicates the size of the specific dimension. Each matrix-plane is allocated with the size of the last two sizes
[in]typeis the desired element data type (see tDataType)
[in]*planesis an array of cv::Mat-planes which will be used as matrices for every single 2D-plane. Every Mat must have the same size and type. The type must correspond to the param type, the size must fit to the last two given sizes.
[in]nrOfPlanesis the length of the planes-array. This value must be the same than (sizes[0]*sizes[1]*...*sizes[dimensions-2])
Exceptions
open-cverror in case of error
See also
CreateFuncWithCVPlanes
void ito::DataObject::createHeader ( const unsigned char  dimensions,
const int *  sizes,
const int *  steps,
const int  elemSize 
)
private

create header information for data objects with a given size and step sizes to jump from one element in a dimension to the next one.

helper method for creation of header information

This method allocates memory for the member variables m_roi, m_osize and m_size. Therefore one memory-block is continuously allocated with length 3*(dims+1):

[dimensions, roi1, ..., roiN, dimensions, osize1,..., osizeN, dimensions, size1,...,sizeN] m_roi.m_p points to roi1, m_osize.m_p points to osize1 and m_size.m_p points to size1

Parameters
dimensionsindicates the number of dimensions
*sizesis an array with length of 'dimensions'. Each element gives the size of the corresponding dimension
*stepsThis parameter makes the data object compatible to numpy and opencv and is only used if a continuousDataPtr has been given to the data object. Else set steps = NULL. Each element if steps indicates by how many bytes one has to go in order to get from one element in this dimension to the next one. Hence, the last element is equal to elemSize
elemSizenumber of bytes each element requires
Exceptions
cv::Exceptionif dimensions is <= 1
See also
CreateFunc
void ito::DataObject::createHeaderWithROI ( const unsigned char  dimensions,
const int *  sizes,
const int *  osizes = NULL,
const int *  roi = NULL 
)
private

create header information for data objects with a given size, optional roi indeces and a possible original size

helper method for creation of header information considering the region of interest

This method allocates memory for the member variables m_roi, m_osize and m_size. Therefore one memory-block is continuously allocated with length 3*(dims+1):

[dimensions, roi1, ..., roiN, dimensions, osize1,..., osizeN, dimensions, size1,...,sizeN] m_roi.m_p points to roi1, m_osize.m_p points to osize1 and m_size.m_p points to size1

Parameters
dimensionsindicates the number of dimensions
*sizesis an array with length of 'dimensions'. Each element gives the size of the corresponding dimension
*osizesgives a vector with the original size of each dimension, which corresponds to the physical data in memory, if NULL, a full size ROI is assumed, hence osize is equal to size (default : NULL)
*roigives a vector with the offset from the starting point of the allocated data block to the first element in the region of interest, must be NULL if osizes is NULL too (default : NULL)
Exceptions
cv::Exceptionif dimensions is <= 1
See also
CreateFunc
RetVal ito::DataObject::deepCopyPartial ( DataObject copyTo)

copy all values of this data object to the copyTo data object. The copyTo-data object must be allocated and have the same type and size (of its roi) than this data object. The compared sequence of sizes only contains dimensions whose size is bigger than one (e.g. it is possible to copy a 5x1 object to a 1x1x5 object)

high-level, non-templated method. Deeply copies data of this data object which is within its ROI to the ROI of rhs.

Parameters
&rhsis the right-handed data object, where data is copied to.
Returns
retOk
Exceptions
cv::Exception(CV_StsAssert)if sizes or type of both matrices are not equal
See also
DeepCopyPartialFunc
DataObject ito::DataObject::div ( const DataObject mat2,
const double  scale = 1.0 
) const

high-level method which does a element-wise division of elements in this matrix by elements in second source matrix.

The result is returned as new data object with the same type and size than this object. The axis scale, offset, description and unit values are copied from this object. Tags are copied from this object, too.

Parameters
&mat2is the second source matrix
scaleis the scaling factor (default: 1.0)
Returns
result matrix
See also
DivFunc
int ito::DataObject::elemSize ( ) const

returns number of bytes required by each value in the array.

number of bytes that are required by each value inside of the data object array (e.g. 1 for uint8, 2 for int16...)

Returns
the size of each array element in bytes.
DObjIterator ito::DataObject::end ( )

Returns the matrix iterator and sets it to the after-last matrix element.

returns iterator to the end value of this data object array

The end value is the first item outside of the data object array.

Returns
iterator
See also
DObjIterator
RetVal ito::DataObject::eye ( const int  type)

sets the matrix of this data object to a two-dimensional eye-matrix of size 1, hence [1]

Parameters
typeis the desired element data-type
Returns
retOk
See also
ones
RetVal ito::DataObject::eye ( const int  size,
const int  type 
)

sets the matrix of this data object to a two-dimensional eye-matrix of given size

At first, a preexisting matrix is freed, before creating the eye-matrix

Parameters
sizeis the desired size of the squared eye-matrix
typeis the desired element data-type
Returns
retOk
See also
freeData, create, EyeFunc
void ito::DataObject::freeData ( void  )
private

high-level, non-templated method for freeing data

decrements reference counter and deletes data, if no other instance is using them (ref counter < 0)

See also
FreeFunc
cv::Mat** ito::DataObject::get_mdata ( void  )
inline

returns array of pointers to cv::_Mat-matrices (planes) of the data object.

The returned array of matrices contains all matrices of this object, including the matrices that may lie outside of a possible region of interest. In order to access the i-th plane considering any roi, use getCvPlaneMat or calculate the right accessing index using seekMat.

Returns
pointer to vector of matrices
Remarks
the returned type is an array of cv::Mat*, you should cast it to the appropriate type (e.g. cv::_Mat<int8>)
See also
seekMat, getCvPlaneMat
const cv::Mat** ito::DataObject::get_mdata ( void  ) const
inline

returns constant array of pointers to cv::_Mat-matrices (planes) of the data object

The returned array of matrices contains all matrices of this object, including the matrices that may lie outside of a possible region of interest. In order to access the i-th plane considering any roi, use getCvPlaneMat or calculate the right accessing index using seekMat.

Returns
pointer to vector of matrices
Remarks
the returned type is a const array of cv::Mat*, you should cast it to the appropriate type (e.g. cv::_Mat<int8>)
See also
seekMat, getCvPlaneMat
double ito::DataObject::getAxisScale ( const int  axisNum) const

Function returns the axis-unit-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.

< Function returns the axis-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.

const std::string ito::DataObject::getAxisUnit ( const int  axisNum,
bool &  validOperation 
) const

Function returns the axis-description for the exist specified by axisNum. If axisNum is out of dimension range it returns NULL.

< Function returns the axis-unit-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.

char ito::DataObject::getContinuous ( void  ) const
inline

returns if the data object is owner of the data, hence, the data will be deleted by this data object, if nobody else is using the data any more

const cv::Mat ito::DataObject::getContinuousCvPlaneMat ( const int  planeIndex) const

returns a shallow or deep copy of a cv::Mat plane with given index. If the current plane is not continuous (due to a roi), a cloned, continuous matrix is returned, else a shallow copy.

Parameters
planeIndexis the zero-based index of the requested plane within the current ROI of the data object
Returns
shallow copy or clone of desired plane, depending if the plane is continuous (no roi set in plane dimensions) or not.
See also
seekMat
get_mdata, getCvPlaneMat
cv::Mat * ito::DataObject::getCvPlaneMat ( const int  planeIndex)

returns pointer to cv::Mat plane with given index considering a possible roi.

returns the pointer to the underlying cv::Mat that represents the plane with given planeIndex of the entire data object.

This command is equivalent to get_mdata()[seekMat(planeIndex)] but checks for out-of-range errors.

Parameters
planeIndexis the zero-based index of the requested plane within the current ROI of the data object
Returns
pointer to the cv::Mat plane or NULL if planeIndex is out of range
See also
seekMat
get_mdata, getContinuousCvPlaneMat
const cv::Mat * ito::DataObject::getCvPlaneMat ( const int  planeIndex) const

returns pointer to cv::Mat plane with given index considering a possible roi.

returns the pointer to the underlying cv::Mat that represents the plane with given planeIndex of the entire data object.

This command is equivalent to get_mdata()[seekMat(planeIndex)] but checks for out-of-range errors.

Parameters
planeIndexis the zero-based index of the requested plane within the current ROI of the data object
Returns
pointer to the cv::Mat plane or NULL if planeIndex is out of range
See also
seekMat
get_mdata, getContinuousCvPlaneMat
int ito::DataObject::getDims ( void  ) const
inline

< returns the number of dimensions returns the element data type in form of its type-number

int ito::DataObject::getNumPlanes ( void  ) const
inline

calculates numbers of single opencv matrices which are part of the ROI which has previously been set.

Returns
0 if empty range or empty matrix, 1 if two dimensional, else product of sizes of all dimensions besides the last two ones.

This method replaces calcNumMats due to its more consistent method name.

MSize ito::DataObject::getOriginalSize ( void  )
inline

returns the original size-member. This is equal to getSize() if no roi is set to the dataObject.

Returns
osize-member of type MSize
const MSize ito::DataObject::getOriginalSize ( void  ) const
inline

returns the original size-member. This is equal to getSize() if no roi is set to the dataObject.

Returns
osize-member of type MSize
int ito::DataObject::getOriginalSize ( int  index) const
inline

gets the original size of the given dimension (this is the size without considering any ROI)

Parameters
indexis the specific zero-based dimension-index whose size is requested
Returns
size or -1 if index is out of boundaries
int ito::DataObject::getOriginalTotal ( ) const
inline

gets total number of elements of the whole data object

Returns
number of elements
See also
getDims, getSize
char ito::DataObject::getOwnData ( void  ) const
inline

returns the real plane index of cv::Mat array returned by get_mdata() for a given plane number considering a possible roi. Use this method if you already know the total number of planes within the roi.

double ito::DataObject::getPhysToPix ( const unsigned int  dim,
const double  phys,
bool &  isInsideImage 
) const

Function returns the not rounded pixel index of a physical coordinate.

Function returns the not rounded pixel index of a physical coordinate Function returns the not rounded pixel index of a physical coordinate (Unit-Coordinate = ( px-Coordinate - Offset)* Scale). If the pixel is outside of the image, the isInsideImage-flag is set to false else it is set to true. To avoid memory access-error, the returnvalue is clipped within the range of the image ([0...imagesize-1])

Parameters
[in]dimAxis-dimension for which the physical coordinate is calculated
[in]pixPixel-index as double
[out]isInsideImageflag which is set to true if coordinate is within range of the image.
Returns
(double)( phys / AxisScale + AxisOffset) & [0..imagesize-1]
double ito::DataObject::getPhysToPix ( const unsigned int  dim,
const double  phys 
) const

Function returns the not rounded pixel index of a physical coordinate.

Function returns the not rounded pixel index of a physical coordinate Function returns the not rounded pixel index of a physical coordinate (Unit-Coordinate = ( px-Coordinate - Offset)* Scale). To avoid memory access-error, the return value is clipped within the range of the image ([0...imagesize-1])

Parameters
[in]dimAxis-dimension for which the physical coordinate is calculated
[in]pixPixel-index as double
Returns
(double)( phys / AxisScale + AxisOffset) & [0..imagesize-1]
int ito::DataObject::getPhysToPix2D ( const double  physY,
double &  tPxY,
bool &  isInsideImageY,
const double  physX,
double &  tPxX,
bool &  isInsideImageX 
) const

Function returns the not rounded pixel index of a physical coordinate.

This method only considers the x- and y-coordinates (last two dimensions of the dataObject).

Parameters
physYis the physical coordinate of the y axis
tPxY[byRef] contains the corresponding pixel coordinate of physY after the function has been called
isInsideImageY[byRef] is true if physY is inside of the dataObject area, else false
physXis the physical coordinate of the x axis
tPxX[byRef] contains the corresponding pixel coordinate of physX after the function has been called
isInsideImageX[byRef] is true if physX is inside of the dataObject area, else false
Returns
0 (always)
double ito::DataObject::getPixToPhys ( const unsigned int  dim,
const double  pix,
bool &  isInsideImage 
) const

Function returns the physical coordinate of a pixel.

Function returns the physical coordinate of a pixel Function returns the physical coordinate of a pixel index (Unit-Coordinate = ( px-Coordinate - Offset)* Scale). If the pixel is outside of the image, the isInsideImage-flag is set to false else it is set to true.

Parameters
[in]dimAxis-dimension for which the physical coordinate is calculated
[in]pixPixel-index as double
[out]isInsideImageflag which is set to true if coordinate is within range of the image.
Returns
(double)( pix - AxisOffset)* AxisScale)
double ito::DataObject::getPixToPhys ( const unsigned int  dim,
const double  pix 
) const

Function returns the physical coordinate of a pixel.

Function returns the physical coordinate of a pixel Function returns the physical coordinate of a pixel index (Unit-Coordinate = ( px-Coordinate - Offset)* Scale).

Parameters
[in]dimAxis-dimension for which the physical coordinate is calculated
[in]pixPixel-index as double
Returns
(double)( pix - AxisOffset)* AxisScale)
MSize ito::DataObject::getSize ( void  )
inline

returns the size-member. m_size fits to the physical organization of data in memory.

Returns
size-member of type MSize
const MSize ito::DataObject::getSize ( void  ) const
inline

returns the size-member. This member does not consider the transpose flag, hence, m_size fits to the physical organization of data in memory.

Returns
size-member of type MSize
int ito::DataObject::getSize ( int  index) const
inline

gets the size of the given dimension (this is the size within the ROI)

Parameters
indexis the specific zero-based dimension-index whose size is requested
Returns
size or -1 if index is out of boundaries
int ito::DataObject::getStep ( int  index) const

returns a normalized step in the index-th axis, this is the number of values one has to walk in order to get the next value in the index-th axis.

Please consider, that this value can only be used for pointer-arithmetic operations if the dataObject is continuous. Else, it only indicates the number of values, however their pixel position might be interrupted at plane boundaries.

Parameters
indexis the axis for which the step size should be determined Exception if index is out of bounds
std::string ito::DataObject::getTagKey ( const int  tagNumber,
bool &  validOperation 
) const

Function returns the number of elements in the Tags-Maps.

< Function returns the string-value for 'key' identified by int tagNumber. If key in the TagMap do not exist NULL is returned

int ito::DataObject::getTagListSize ( ) const

Function to set the string-value of the value unit, return 1 if values does not exist.

< Function returns the number of elements in the Tags-Maps

int ito::DataObject::getTotal ( ) const
inline

gets total number of elements within the data object's ROI

Returns
number of elements
See also
getDims, getSize
int ito::DataObject::getType ( void  ) const
inline

returns if the data in the first n-2 dimensions is stored within one entire block in memory (true), else (false)

double ito::DataObject::getValueOffset ( ) const

< Function return the offset of the values stored within the dataOject

Function return the scaling of values stored within the dataOject

RetVal ito::DataObject::getXYRotationalMatrix ( double &  r11,
double &  r12,
double &  r13,
double &  r21,
double &  r22,
double &  r23,
double &  r31,
double &  r32,
double &  r33 
) const

Function to access (get) the rotiational matrix by each element.

Parameters
[out]r11Upper left element
[out]r12Upper middle element
[out]r13Upper rigth element
[out]r21Middle left element
[out]r22Middle middle element
[out]r23Middle rigth element
[out]r31Lower left element
[out]r32Lower middle element
[out]r33Lower rigth element
Returns
ito::retOk || ito::retError
DataObject ito::DataObject::lineCut ( const double *  coordinates,
const int &  len 
) const

high-level method which takes a line cut across the planes of a dataObject.

The result is stored in a 2d result matrix of the same type.

Parameters
*coordinatesstart and end point coordinates of line cut (phyiscal). The coordinates are interpreted as followed: [x0,y0,x1,y1].
&lenlength of coordinates list.
Returns
result dataObject
template<typename _Tp >
ito::RetVal ito::DataObject::linspace ( const _Tp  start,
const _Tp  end,
const _Tp  inc,
const int  transposed 
)

equivalent to matlab linspace functino

Parameters
&dObjis the source data object
Returns
See also
MakeContinuousFunc
RetVal ito::DataObject::locateROI ( int *  wholeSizes,
int *  offsets 
) const

method locates ROI of this data object within its original data block

locates the boundaries of the ROI of a n-dimensional data object and returns the original size and the distances to the physical borders

long description

Parameters
*wholeSizesis an allocated array of size m_dims, which is filled with the original matrix-sizes (considering the transpose-flag, hence, the output is in user-friendly form)
*offsetsis dimension-wise offset in order to get from the original first element of the matrix to the subpart within the region of interest, array must be pre-allocated, too.
Returns
retOk
RetVal ito::DataObject::locateROI ( int *  lims) const

method get ROI of this data object within its original data block

locates the boundaries of the ROI of a n-dimensional data object the distances to the physical borders

dims is the number of dimensions

Parameters
*limsis a integer array whose length is 2*dims. For every dimension, two adjacent values indicates the shift of the ROI. The first of both values indicates the shift of the ROI towards the first element in the matrix (positive direction). The second value indicates the shift of the ROI towards the last element in the matrix (positive direction).
Returns
retOk
ito::RetVal ito::DataObject::matIdxToNum ( const unsigned int *  matIdx,
int *  matNum 
) const
private

calculates the index of the matrix-plane in the m_data-vector for a given vector of indices, which address one element in the n-dimensional matrix

The matrix indices are zero-based and consider the ROI of this data object.

Parameters
*matIdxis a vector containing indices which address one element in the n-dimensional matrix
*matNumis a pointer, where the resulting matrix-plane-index is written.
Returns
retOk
Exceptions
cv::Exceptionif the given indices are out of bounds
RetVal ito::DataObject::matNumToIdx ( const int  matNum,
int *  matIdx 
) const
private
Todo:
documentation is missing
DataObject ito::DataObject::mul ( const DataObject mat2,
const double  scale = 1.0 
) const

high-level method which does a element-wise multiplication of elements in this matrix with elements in the second matrix.

The result is returned as new data object with the same type and size than this object. The axis scale, offset, description and unit values are copied from this object. Tags are copied from this object, too. Optionally the multiplication can be scaled by a scaling factor, which is set to one by default.

Parameters
&mat2is the second source matrix
scaleis the scaling factor (default: 1.0)
Returns
result matrix
See also
DivFunc
RetVal ito::DataObject::nans ( const int  type)

allocates a one-value matrix of size 1x1 with the given type

Parameters
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::nans ( const int  size,
const int  type 
)

allocates a one-value matrix of size 1 x size with the given type

Parameters
sizeis the desired length of the vector
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::nans ( const int  sizeY,
const int  sizeX,
const int  type 
)

allocates a one-value matrix of size sizeY x sizeX with the given type

Parameters
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::nans ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const unsigned char  continuous = 0 
)

allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type

Parameters
sizeZare the number of matrix-planes
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
unsignedchar continuous indicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::nans ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const unsigned char  continuous = 0 
)

high-level, non-templated base function for allocation of new matrix whose elements are all set to one

Parameters
dimensionsindicates the number of dimensions
*sizesis a vector with the same length than dimensions. Every element indicates the size of the specific dimension
typeis the desired data-element-type
continuousindicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
OnesFunc
RetVal ito::DataObject::ones ( const int  type)

allocates a one-value matrix of size 1x1 with the given type

Parameters
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::ones ( const int  size,
const int  type 
)

allocates a one-value matrix of size 1 x size with the given type

Parameters
sizeis the desired length of the vector
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::ones ( const int  sizeY,
const int  sizeX,
const int  type 
)

allocates a one-value matrix of size sizeY x sizeX with the given type

Parameters
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::ones ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const unsigned char  continuous = 0 
)

allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type

Parameters
sizeZare the number of matrix-planes
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
unsignedchar continuous indicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::ones ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const unsigned char  continuous = 0 
)

high-level, non-templated base function for allocation of new matrix whose elements are all set to one

Parameters
dimensionsindicates the number of dimensions
*sizesis a vector with the same length than dimensions. Every element indicates the size of the specific dimension
typeis the desired data-element-type
continuousindicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
OnesFunc
template<typename T2 >
ito::DataObject::operator T2 ( )

cast operator for data object

cast operator, tries to cast this data object to another element type

usage: res = static_cast<ito::float32>(sourceDataObject)

Exceptions
cv::Exceptionif cast failed, e.g. if cast not possible or types unknown
Returns
cast data object
See also
convertTo, CastFunc
DataObject ito::DataObject::operator!= ( DataObject rhs)

compare operator, compares for "unequal to"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator!= ( const float64 &  value)

compare operator, compares for "unequal to"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator!= ( const ito::complex64 &  value)

compare operator, compares for "unequal to"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator& ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise and" between this data object and a given data object

the result is returned as a newly allocated data object.

Parameters
&rhsis the matrix which is used for the operator
Returns
new data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
operator &=, BitAndFunc
DataObject & ito::DataObject::operator&= ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise and" between this data object and a given data object

Parameters
&rhsis the matrix which is used for the operator
Returns
reference to this data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
BitAndFunc
DataObject ito::DataObject::operator* ( const DataObject rhs)

matrix multiplication of this dataObject with rhs. The result is returned.

This multiplication is only implemented for float32 and float64. The matrix multiplication is only executed plane-by-plane, hence, the multiplication is done separately for each plane.

For an element wise multiplication use the mul-method.

DataObject ito::DataObject::operator* ( const float64 &  factor)

high-level method which multiplies every element in this data object by a given floating-point factor. The result matrix is returned as a new matrix.

Parameters
factor
See also
operator *, OpScalarMulFunc
DataObject & ito::DataObject::operator*= ( const DataObject rhs)

inplace matrix multiplication of this dataObject with rhs (this *= rhs)

This multiplication is only implemented for float32 and float64. The matrix multiplication is only executed plane-by-plane, hence, the multiplication is done separately for each plane. This operation is only inplace, if the second matrix is squared and both matrices have the same number of columns. Else, this dataObject is reallocated to the new size.

For an element wise multiplication use the mul-method.

DataObject & ito::DataObject::operator*= ( const float64 &  factor)

high-level method which multiplies every element in this data object by a given floating-point factor

Parameters
factor
See also
OpScalarMulFunc
DataObject ito::DataObject::operator+ ( const DataObject rhs)

high-level, non-templated arithmetic operator for element-wise addition of values of two given data objects

Parameters
&rhsis the data object whose elements will be added to this data object
Returns
new resulting data object
Exceptions
cv::Exceptionif both data objects don't have the same size or type
See also
AddFunc
DataObject & ito::DataObject::operator+= ( const DataObject rhs)

high-level, non-templated arithmetic operator for element-wise addition of values of given data object to this data object

Parameters
&rhsis the data object whose elements will be added to this data object
Returns
this data object
Exceptions
cv::Exceptionif both data objects don't have the same size or type
See also
AddFunc
DataObject ito::DataObject::operator- ( const DataObject rhs)

high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object

Parameters
&rhsis the data object whose elements will be subtracted from this data object
Returns
new resulting data object
Exceptions
cv::Exceptionif both data objects don't have the same size or type
See also
SubFunc
DataObject & ito::DataObject::operator-= ( const DataObject rhs)

high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object

Parameters
&rhsis the data object whose elements will be subtracted from this data object
Returns
this data object
Exceptions
cv::Exceptionif both data objects don't have the same size or type
See also
SubFunc
DataObject ito::DataObject::operator< ( DataObject rhs)

compare operator, compares for "lower than"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator< ( const float64 &  value)

compare operator, compares for "lower than"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator<< ( const unsigned int  shiftbit)

high-level operator, which shifts the elements of this data objects by a given number of bits to the left and returns the new data object

Parameters
shiftbitdefines the number of bits to shift
Returns
new data object with shifted values
See also
operator <<=, ShiftLFunc
DataObject & ito::DataObject::operator<<= ( const unsigned int  shiftbit)

high-level operator, which shifts the elements of this data objects by a given number of bits to the left

Parameters
shiftbitdefines the number of bits to shift
Returns
reference to this data object
See also
ShiftLFunc
DataObject ito::DataObject::operator<= ( DataObject rhs)

compare operator, compares for "lower or equal than"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator<= ( const float64 &  value)

compare operator, compares for "lower or equal than"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject & ito::DataObject::operator= ( const cv::Mat &  rhs)

assign-operator which creates a two-dimensional data object as a shallow copy of a two dimensional cv::Mat object.

shallow-copy means, that the header information of this data-object is physically created at the hard disk, while the data is shared with the original cv::Mat.

Parameters
&rhsis the cv::Mat where the shallow copy is taken from. At first, the existing data of this object is freed.
Returns
this data object
Exceptions
cv::Exceptionif rhs is not two-dimensional or data type has no compatible data type of dataObject.
See also
create
DataObject & ito::DataObject::operator= ( const DataObject rhs)

assign-operator which makes a shallow-copy of the rhs data object and stores it in this data object

shallow-copy means, that the header information of the rhs data-object is physically copied to this-dataObject while the data is shared, hence, only its reference counter is incremented.

The previous array covered by this data object is completely released before assigning the new rhs data object. In order to deeply copy the values from one object into another pre-allocated object use the method deepCopyPartial.

Parameters
&rhsis the data object where the shallow copy is taken from. At first, the existing data of this object is freed.
Returns
this data object
Exceptions
cv::Exceptionif lock state of both objects is not equal. Please make sure, that both lock states are equal
See also
CopyMatFunc, deepCopyPartial
DataObject & ito::DataObject::operator= ( const int8 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const uint8 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const int16 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const uint16 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const int32 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const uint32 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const float32 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const float64 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const complex64 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const complex128 &  value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject & ito::DataObject::operator= ( const ito::Rgba32 value)

Every data element in this data object is set to the given value.

sets all elements of the data object to the given value. Value is cast to the data object's type

Parameters
valueis the scalar assignment value
Returns
modified data object
See also
AssignScalarValue
DataObject ito::DataObject::operator== ( DataObject rhs)

compare operator, compares for "equal to"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator== ( const float64 &  value)

compare operator, compares for "equal to"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator> ( DataObject rhs)

compare operator, compares for "bigger than"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator> ( const float64 &  value)

compare operator, compares for "bigger than"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator>= ( DataObject rhs)

compare operator, compares for "bigger or equal than"

Parameters
&rhsis the data object with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator>= ( const float64 &  value)

compare operator, compares for "bigger or equal than"

Parameters
valueis the value with which this data object should element-wisely be compared
Returns
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
Exceptions
cv::Exceptionif both data objects doesn't have the same size or type
See also
CmpFunc
DataObject ito::DataObject::operator>> ( const unsigned int  shiftbit)

high-level operator, which shifts the elements of this data objects by a given number of bits to the right and returns the new data object

Parameters
shiftbitdefines the number of bits to shift
Returns
new data object with shifted values
See also
operator >>=, ShiftRFunc
DataObject & ito::DataObject::operator>>= ( const unsigned int  shiftbit)

high-level operator, which shifts the elements of this data objects by a given number of bits to the right

Parameters
shiftbitdefines the number of bits to shift
Returns
reference to this data object
See also
ShiftRFunc
DataObject ito::DataObject::operator^ ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object

the result is returned as a newly allocated data object.

Parameters
&rhsis the matrix which is used for the operator
Returns
new data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
operator ^=, BitXorFunc
DataObject & ito::DataObject::operator^= ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise xor" between this data object and a given data object

Parameters
&rhsis the matrix which is used for the operator
Returns
reference to this data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
BitXorFunc
DataObject ito::DataObject::operator| ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object

the result is returned as a newly allocated data object.

Parameters
&rhsis the matrix which is used for the operator
Returns
new data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
operator |=, BitOrFunc
DataObject & ito::DataObject::operator|= ( const DataObject rhs)

high-level operator, which executes the element-wise operation "bitwise or" between this data object and a given data object

Parameters
&rhsis the matrix which is used for the operator
Returns
reference to this data object, where the result of the operation is stored
Exceptions
cv::Exceptionif data type is not supported or both data objects differs either in their size or data type
See also
BitOrFunc
RetVal ito::DataObject::rand ( const int  type,
const bool  randMode = false 
)

allocates a random-value matrix of size 1x1 with the given type

this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusiv). In case of an integer type, the gausian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.

Parameters
typeis the desired type-number
randModeswitch mode between uniform distributed(false) and normal distributed noise(true)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::rand ( const int  size,
const int  type,
const bool  randMode = false 
)

allocates a random-value matrix of size 1 x size with the given type

this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusiv). In case of an integer type, the gausian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.

Parameters
sizeis the desired length of the vector
typeis the desired type-number
randModeswitch mode between uniform distributed(false) and normal distributed noise(true)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::rand ( const int  sizeY,
const int  sizeX,
const int  type,
const bool  randMode = false 
)

allocates a random-value matrix of size sizeY x sizeX with the given type

this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusiv). In case of an integer type, the gausian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.

Parameters
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
randModeswitch mode between uniform distributed(false) and normal distributed noise(true)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::rand ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const bool  randMode,
const unsigned char  continuous = 0 
)

allocates a random-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type

this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusiv). In case of an integer type, the gausian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.

Parameters
sizeZare the number of matrix-planes
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
randModeswitch mode between uniform distributed(false) and normal distributed noise(true)
unsignedchar continuous indicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::rand ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const bool  randMode,
const unsigned char  continuous = 0 
)

high-level, non-templated base function for allocation of new matrix whose elements are all set to one

this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(exclusive). For floating point types, the noise is between 0(inclusiv) and 1(exclusiv). In case of an integer type, the gausian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.

Parameters
dimensionsindicates the number of dimensions
*sizesis a vector with the same length than dimensions. Every element indicates the size of the specific dimension
typeis the desired data-element-type
randModeswitch mode between uniform distributed(false) and normal distributed noise(true)
continuousindicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
OnesFunc
DataObject ito::DataObject::row ( const int  selRow) const

low-level, templated method which changes the region of interest of the data object to the selected zero-based row index

Parameters
*dObj
selRowindicates the zero-based row-index (considering any existing ROI)
Returns
retOkhigh-level method which makes a new header for the specified matrix row and returns it. The underlying data of the new matrix is shared with the original matrix.
Parameters
selRowis the specific zero-based row index
Returns
new data object
Exceptions
cv::Exceptionif dimension is unequal to two.
See also
RowFunc
uchar* ito::DataObject::rowPtr ( const int  matNum,
const int  y 
)
inline

returns pointer to the data in the y-th row in the 2d-matrix plane matNum

cast this pointer to the data type of the matrix elements (as pointer).

Remarks
No further error checking (e.g. boundaries)
Returns
data-pointer
const uchar* ito::DataObject::rowPtr ( const int  matNum,
const int  y 
) const
inline

returns pointer to the data in the y-th row in the 2d-matrix plane matNum

cast this pointer to the data type of the matrix elements (as pointer).

Remarks
No further error checking (e.g. boundaries)
Returns
data-pointer
template<typename _Tp >
_Tp* ito::DataObject::rowPtr ( const int  matNum,
const int  y 
)
inline

returns pointer to the data in the y-th row in the 2d-matrix plane matNum

This is a templated version to return the pointer already casted to the right type, e.g. ito::float64* myPtr = myObj->rowPtr<ito::float64>(0,0).

Remarks
No further error checking (e.g. boundaries)
Returns
data-pointer
template<typename _Tp >
const _Tp* ito::DataObject::rowPtr ( const int  matNum,
const int  y 
) const
inline

returns pointer to the data in the y-th row in the 2d-matrix plane matNum

This is a templated version to return the pointer already casted to the right type, e.g. const ito::float64* myPtr = myObj->rowPtr<ito::float64>(0,0).

Remarks
No further error checking (e.g. boundaries)
Returns
data-pointer
void ito::DataObject::secureFreeData ( void  )
private

high-level, non-templated method for securely freeing data

decrements reference counter and deletes data, if no other instance is using them (ref counter < 0). This method makes a lot of security checks instead of freeFunc.

See also
SecureFreeFunc
int ito::DataObject::seekMat ( const int  matNum,
const int  numMats 
) const

returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index

returns the real plane index of cv::Mat array returned by get_mdata() for a given plane number considering a possible roi. This method internally calculates the number of planes within the roi using getNumPlanes.

Since there might be a difference between the "real" matrix size in memory and the virtual size which is set by subslicing a matrix and hence setting any ROI, this method transforms a desired matrix-plane index to the real index in memory of the data-vector m_data

Parameters
matNumzero-based matrix-plane-index, considering the virtual matrix size (ROI), 0<=matNum<getNumPlanes
numMatstotal number of matrix-planes, lying within the ROI
Returns
real vector-index for the desired matrix-plane or 0 if matNum >= numMats.
int ito::DataObject::seekMat ( const int  matNum) const

returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index

returns the number of planes of this data object (considering a possible ROI). This method simply calls getNumPlanes and is only there for historical reasons.

Since there might be a difference between the "real" matrix size in memory and the virtual size which is set by subslicing a matrix and hence setting any ROI, this method transforms a desired matrix-plane index to the real index in memory of the data-vector m_data

Parameters
matNumzero-based matrix-plane considering the virtual matrix size (ROI), 0<=matNum<getNumPlanes
Returns
real vector-index for the desired matrix-plane
See also
seekMat
getNumPlanes
int ito::DataObject::setAxisOffset ( const unsigned int  axisNum,
const double  offset 
)

set the scaling of the axisNum-th axis. Scaling is in (physical unit / pixel). The relation is: physical unit = (pixel unit - offset) * scale

< Function to set the offset of the specified axis, return 1 if axis does not exist

int ito::DataObject::setAxisScale ( const unsigned int  axisNum,
const double  scale 
)

set the unit of the axisNum-th axis as latin1 encoded string

< Function to set the scale of the specified axis, return 1 if axis does not exist or scale is 0.0.

int ito::DataObject::setAxisUnit ( const unsigned int  axisNum,
const std::string &  unit 
)

set the description of the axisNum-th axis as latin1 encoded string

< Function to set the unit (string value) of the specified axis, return 1 if axis does not exist

RetVal ito::DataObject::setImag ( DataObject valuesObj)

high-level value which calculates the real value of each element of the input source data object and returns the resulting data object

Parameters
&dObj
Returns
new data object with real values
Exceptions
cv::Exceptionif undefined data type (e.g. real data types)
See also
ArgFunc
RetVal ito::DataObject::setReal ( DataObject valuesObj)

high-level value which calculates the real value of each element of the input source data object and returns the resulting data object

Parameters
&dObj
Returns
new data object with real values
Exceptions
cv::Exceptionif undefined data type (e.g. real data types)
See also
ArgFunc
RetVal ito::DataObject::setTo ( const int8 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const uint8 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const int16 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const uint16 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const int32 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const uint32 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const float32 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const float64 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const complex64 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const complex128 &  value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
RetVal ito::DataObject::setTo ( const ito::Rgba32 value,
const DataObject mask = DataObject() 
)

Sets all or some of the array elements to the specific value.

Sets all or some (if uint8 mask is given) of the array elements to the specified value.

Parameters
assignedscalar converted to the actual array type
maskOperation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
Returns
retError in case of error
See also
AssignScalarValue
int ito::DataObject::setValueDescription ( const std::string &  description)

set the offset of the axisNum-th axis. Offset is in pixel. The relation is: physical unit = (pixel unit - offset) * scale

< Function to set the string-value of the value description, return 1 if values does not exist

int ito::DataObject::setValueUnit ( const std::string &  unit)

Function to set the string-value of the value description, return 1 if values does not exist.

< Function to set the string-value of the value unit, return 1 if values does not exist

RetVal ito::DataObject::setXYRotationalMatrix ( double  r11,
double  r12,
double  r13,
double  r21,
double  r22,
double  r23,
double  r31,
double  r32,
double  r33 
)

Function to access (set) the rotiational matrix by each element.

Parameters
[in]r11Upper left element
[in]r12Upper middle element
[in]r13Upper rigth element
[in]r21Middle left element
[in]r22Middle middle element
[in]r23Middle rigth element
[in]r31Lower left element
[in]r32Lower middle element
[in]r33Lower rigth element
Returns
ito::retOk || ito::retError
DataObject ito::DataObject::splitColor ( const char *  destinationColor,
const int &  dtype 
) const

returns a color channel of a color image (rgba32)

Exceptions
cv::Exceptionif cast failed, e.g. if cast not possible or types unknown
Returns
data object
DataObject ito::DataObject::stack ( const DataObject mats,
int  num,
unsigned int  axis = 0 
)
static

returns a stack of multiple dataObjects (number is equal to num) along the given axis (default: 0).

high-level method which stacks the planes of the input dataObjects to a three dimensional dataObject together.

The axis is always mapped to the object with the largest number of dimensions ndim_max. All other dataObjects are considered to also have ndim_max dimensions, where additional dimensions are prepended having a size of 1.

The result is stored in a result matrix of the same plane size and type. Only one of the (n-2) dimensions is allowed to have a size greter than one.

Parameters
*matssequence of input DataObjects
*numnumber elements in mats
axisaxis along which a stack is build (not yet implemented)
Returns
result dataObject
DataObject ito::DataObject::toGray ( const int  destinationType = ito::tUInt8) const

converts a color image (rgba32) to a gray-scale image

usage: res = static_cast<ito::float32>(sourceDataObject)

Exceptions
cv::Exceptionif cast failed, e.g. if cast not possible or types unknown
Returns
cast data object
See also
convertTo, CastFunc
DataObject ito::DataObject::trans ( ) const

transposes this data object

simply toggles the transpose flag

Returns
reference to this data object
RetVal ito::DataObject::zeros ( const int  type)

allocates a zero-value matrix of size 1x1 with the given type

Parameters
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::zeros ( const int  size,
const int  type 
)

allocates a zero-value matrix of size 1 x size with the given type

Parameters
sizeis the desired length of the vector
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::zeros ( const int  sizeY,
const int  sizeX,
const int  type 
)

allocates a zero-value matrix of size sizeY x sizeX with the given type

Parameters
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::zeros ( const int  sizeZ,
const int  sizeY,
const int  sizeX,
const int  type,
const unsigned char  continuous = 0 
)

allocates a zero-value, 3D- matrix of size sizeZ x sizeY x sizeX with the given type

Parameters
sizeZare the number of matrix-planes
sizeYare the number of rows
sizeXare the number of columns
typeis the desired type-number
continuousindicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
zeros, ZerosFunc
RetVal ito::DataObject::zeros ( const unsigned char  dimensions,
const int *  sizes,
const int  type,
const unsigned char  continuous = 0 
)

high-level, non-templated base function for allocation of new matrix whose elements are all set to zero

Parameters
dimensionsindicates the number of dimensions
*sizesis a vector with the same length than dimensions. Every element indicates the size of the specific dimension
typeis the desired data-element-type
continuousindicates wether the data should be in one continuous block (true) or not (false)
Returns
retOk
See also
ZerosFunc

Friends And Related Function Documentation

template<typename _Tp >
RetVal AdjustROIFunc ( DataObject dObj,
int  dtop,
int  dbottom,
int  dleft,
int  dright 
)
friend

low-level, templated method for adjusting the ROI of a data object by the given incremental values

Parameters
*dObjis the data object, whose boundaries should be adjusted
dtop- The shift of the top submatrix boundary upwards (positive value means upwards)
dbottom- The shift of the bottom submatrix boundary downwards (positive value means downwards)
dleft- The shift of the left submatrix boundary to the left (positive value means to the left)
dright- The shift of the right submatrix boundary to the right (positive value means to the right)
Remarks
for any n-dimensional data object, the ROI of every matrix-plane is adjusted, even if any specific matrix-plane is temporarily not inside of the ROI
Returns
retOk
template<typename _Tp >
RetVal ConvertToFunc ( const DataObject lhs,
DataObject rhs,
const int  type,
const double  alpha,
const double  beta 
)
friend

converts data in DataObject lhs to DataObject rhs with a given type

Every element of the source data object is copied to the destionation data object by using this transformation
elem_destination = static_cast<newType>(elem_source * alpha + beta)

Parameters
&lhsis the left-hand sided data object, whose data should be converted
&rhsis the destination data object, whose memory is firstly deleted, then newly allocated
dest_typeis the type-number of the destination element
alphascaling factor (default: 1.0)
betaoffset value (default: 0.0)
Returns
retOk
Exceptions
cv::Exception(CV_StsAssert)if conversion type is unknown
See also
convertTo, CastFunc
template<typename _Tp >
RetVal CopyToFunc ( const DataObject lhs,
DataObject rhs,
unsigned char  regionOnly 
)
friend

low-level, templated method for deeply copying the data of one matrix to another given matrix

In case of 'regionOnly' == false, the destination dataObject 'rhs' is always newly allocated before copying data and the tags as well as the axis descriptions etc. are also copied from the source object. If the source object has a ROI set, the entire object with all data outside of the ROI is copied and the ROI is applied to the destination object, too.

If 'regionOnly' == true, only data within a current ROI is copied to the destination object. In this case, the destination is only newly allocated if its current dimension, size or type do not fit to the source object. Else, data is copied into the existing memory. Tags and axis descriptions etc. are always copied to the destination object.

Parameters
&lhsis the matrix whose data is copied
&rhsis the matrix where the data is copied to. The old data of rhs is deleted first
regionOnly,iftrue, only the data of the ROI in lhs is copied, hence, the org-size of rhs corresponds to the ROI-size of lhs, else the whole data block is copied and the ROI of rhs is set to the ROI of lhs
Returns
retOk
See also
copyTo, CreateFunc
template<typename _Tp >
RetVal CreateFunc ( DataObject dObj,
const unsigned char  dimensions,
const int *  sizes,
const unsigned char  continuous,
const uchar *  continuousDataPtr,
const int *  steps 
)
friend

templated method for create

creates or initializes matrix with given parameters

Parameters
dObjDataObject, whose matrix is created here
dimensionstotal number of dimensions (>=1), if dimensions == 1, dimensions will be set to two and a matrix with dimension [1 x orginial dimension] is created
*sizesvector with size of dimensions, each element gives the size of elements in each dimension
continuous,indicateswhether the data stored in this data object is stored in one continuous data block or not. if dimension <= 2, matrix is always continuous be careful, continuous has not the same meaning than the continuous flag in opencv or numpy.
continuousDataPtrif this pointer is NULL, new data will be allocated. Else the given data indicates data which will be used by this data object. only possible if continuous is true. m_ownflag will be set to 0 if this pointer is set
*stepsvector with size of dimensions, indicates how many bytes one has to move in order to get to the next element in the same dimension, the step-size for the last element must be equal to element-size (in byte)
Returns
retOk
See also
create

continuous

template<typename _Tp >
RetVal CreateFuncWithCVPlanes ( DataObject dObj,
const unsigned char  dimensions,
const int *  sizes,
const cv::Mat *  planes,
const unsigned int  nrOfPlanes 
)
friend

templated method for creation with given vector of cv::Mat-planes

Parameters
[in]dimensionsis the total number of dimensions
[in]*sizesis a vector whose length is equal to dimensions. Each entry indicates the size of the specific dimension. Each matrix-plane is allocated with the size of the last two sizes
[in]typeis the desired element data type (see tDataType)
[in]*planesis an array of cv::Mat-planes which will be used as matrices for every single 2D-plane. Every Mat must have the same size and type. The type must correspond to the param type, the size must fit to the last two given sizes.
[in]nrOfPlanesis the length of the planes-array. This value must be the same than (sizes[0]*sizes[1]*...*sizes[dimensions-2])
Returns
retOk
See also
create
template<typename _Tp >
RetVal FreeFunc ( DataObject dObj)
friend

low-level, templated method for freeing allocated data blocks

First, the header information of the corresponding data block is deleted. Then the reference counter of the data block is decremented. In the same way, the reference counter for every matrix-plane is incremented by calling the corresponding release-method. If the ref-counter is lower than zero no other instance needs this data block and it is deallocated if the m_owndata-flag is true.

Parameters
*dObjwhose data block should be freed
Returns
retOk
See also
freeData
template<typename _Tp >
RetVal GetRangeFunc ( DataObject dObj,
const int  dtop,
const int  dbottom,
const int  dleft,
const int  dright 
)
friend

low-level, templated method for saving a shallow copy of a source cv::Mat_ to a destination cv::Mat_ with respect to given row- and col-ranges

Parameters
<em>SrcMatis the source matrix which is firstly cast to cv::Mat_<_Tp>
rowRangeis the desired row-range
colRangeis the desired col-range
**dstMatis the pointer to a destination matrix which is also cast to cv::Mat_<_Tp>*
Returns
retOk
template<typename _Tp >
RetVal MakeContinuousFunc ( const DataObject dObj,
DataObject resDObj 
)
friend

low-level, templated method which copies an incontinuously organized data object to a continuously organized resulting data object

this templated helper function should only be called if dObj is non-continuous. This is already checked by the calling function makeContinuous The hidden data which is out of a possible roi will not be part of the new continuous matrix.

Parameters
&dObjis the source data object
&resDObjis the resulting data object
Returns
retOk

Member Data Documentation

char ito::DataObject::m_continuous
private

continuous flag

uchar** ito::DataObject::m_data
private

vector with references to each matrix-plane. array of char pointers

int ito::DataObject::m_dims
private

number of dimensions

MSize ito::DataObject::m_osize
private

vector containing the original size of each dimension. The allocated data block corresponds to these sizes

char ito::DataObject::m_owndata
private

owndata flag (false if the data object is constructed with a given continuousDataPointer, else true)

DataObjectTagsPrivate* ito::DataObject::m_pDataObjectTags
private

class containing the object metadata

int* ito::DataObject::m_pRefCount
private

pointer to the reference counter, the integer variable will be allocated once the data block is allocated. If only one data object has access to the data, the reference counter is 0.

MROI ito::DataObject::m_roi
private

vector containing the offset to the starting point of the ROI for each dimension, is used for detecting and adjusting the ROI

MSize ito::DataObject::m_size
private

vector containing the "virtual" size of each dimension considering the ROI

int ito::DataObject::m_type
private

element data type


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