28 #ifndef __DATAOBJFUNCH
29 #define __DATAOBJFUNCH
31 #include "../common/typeDefs.h"
40 enum CmplxSelectionFlags
43 CMPLX_IMAGINARY_VALUE = 1,
45 CMPLX_ARGUMENT_VALUE = 3
49 DATAOBJ_EXPORT RetVal minValue(
const DataObject *dObj, float64 &minValue, uint32 *firstLocation,
bool ignoreInf =
true);
52 DATAOBJ_EXPORT RetVal maxValue(
const DataObject *dObj, float64 &maxValue, uint32 *firstLocation,
bool ignoreInf =
true);
55 DATAOBJ_EXPORT RetVal minMaxValue(
const DataObject *dObj, float64 &minValue, uint32 *firstMinLocation, float64 &maxValue, uint32 *firstMaxLocation,
bool ignoreInf =
true,
const int specialDataTypeFlags = CMPLX_ABS_VALUE);
57 DATAOBJ_EXPORT RetVal meanValue(
const DataObject *dObj, float64 &meanResult,
bool ignoreNaN =
true);
59 DATAOBJ_EXPORT RetVal medianValue(
const DataObject *dObj, float64 &medianResult,
bool ignoreNaN =
true);
61 DATAOBJ_EXPORT RetVal devValue(
const DataObject *dObj,
const int devTypFlag, float64 &meanResult, float64 &devResult,
bool ignoreNaN =
true);
63 DATAOBJ_EXPORT RetVal calcCVDFT(DataObject *dObjIO,
const bool inverse,
const bool inverseAsReal,
const bool lineWise);
66 DATAOBJ_EXPORT RetVal verifyDataObjectType(
const DataObject* dObj,
const char* name, uint8 numberOfAllowedTypes, ...);
69 DATAOBJ_EXPORT RetVal verify2DDataObject(
const DataObject* dObj,
const char* name,
int sizeYMin,
int sizeYMax,
int sizeXMin,
int sizeXMax, uint8 numberOfAllowedTypes, ...);
75 DATAOBJ_EXPORT RetVal verify3DDataObject(
const DataObject* dObj,
const char* name,
int sizeZMin,
int sizeZMax,
int sizeYMin,
int sizeYMax,
int sizeXMin,
int sizeXMax, uint8 numberOfAllowedTypes, ...);
82 DATAOBJ_EXPORT RetVal verifySize(
int size,
int minSize,
int maxSize,
const char *axisName,
const char* dObjName);
106 assert(dObj1 && dObj2);
110 last2DimsFlag =
true;
114 dimsFlag = (d1 == d2);
121 if (d1 >= 2 && d2 >= 2)
125 last2DimsFlag =
false;
129 last2DimsFlag =
false;
134 last2DimsFlag =
false;
145 last2DimsFlag =
false;
149 last2DimsFlag =
false;
154 last2DimsFlag =
false;
157 return typeFlag && dimsFlag && last2DimsFlag && sizeEqual;
169 assert(obj1 && obj2);
186 DATAOBJ_EXPORT std::string invertUnit(
const std::string &oldUnit);
278 DATAOBJ_EXPORT
ito::RetVal dObjCopyLastNAxisTags(
const ito::DataObject &DataObjectIn,
ito::DataObject &DataObjectOut,
const int copyLastNDims,
const bool includeValueTags =
true,
const bool includeRotationMatrix =
true);
280 DATAOBJ_EXPORT
ito::RetVal dObjSetScaleRectangle(
ito::DataObject &DataObjectInOut,
const double &x0,
const double &x1,
const double &y0,
const double &y1);
296 template<
typename _Tp>
ito::RetVal freeRowPointer(_Tp *** &pointer)
305 while(pointer[i] != 0)
341 if(dObj->
getType() != ito::getDataType2<_Tp*>())
351 pointer = (_Tp***)calloc(dObj->
getNumPlanes() + 1,
sizeof(_Tp**));
365 pointer[i] = (_Tp**)calloc(sizeY,
sizeof(_Tp*));
368 for(
int y = 0; y < sizeY; y++)
370 pointer[i][y] = mdata[dObj->
seekMat(i, numMats)]->ptr<_Tp>(y);
380 if(retVal.containsError())
382 freeRowPointer(pointer);
395 template<
typename _Tp>
void GetHLineL(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData);
398 template<
typename _Tp>
void GetHLineD(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData);
401 template<
typename _Tp>
void GetHLineC(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData);
404 template<
typename _Tp>
void SetHLineL(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData);
407 template<
typename _Tp>
void SetHLineD(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData);
421 template<
typename _Tp>
inline void GetHLineL(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData)
424 resRowPtr = (_Tp*)(srcPlane->ptr(y));
427 for(
int i = 0; i < length; i++, x++)
429 pData[i] = (int32)(resRowPtr[x]);
444 template<>
inline void GetHLineL<int32>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData)
447 resRowPtr = (int32*)(srcPlane->ptr(y));
448 memcpy(pData, &resRowPtr[x0], length *
sizeof(int32));
463 template<
typename _Tp>
inline void GetHLineD(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData)
466 resRowPtr = (_Tp*)(srcPlane->ptr(y));
469 for(
int i = 0; i < length; i++, x++)
471 pData[i] = cv::saturate_cast<ito::float64>(resRowPtr[x]);
486 template<>
inline void GetHLineD<ito::float64>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData)
489 resRowPtr = (float64*)(srcPlane->ptr(y));
490 memcpy(pData, &resRowPtr[x0], length *
sizeof(float64));
505 template<
typename _Tp>
inline void GetHLineC(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
507 const _Tp* resRowPtr = srcPlane->ptr<_Tp>(y);
510 for(
int i = 0; i < length; i++, x++)
512 pData[i] = complex128(cv::saturate_cast<ito::float64>(resRowPtr[x]), 0.0);
527 template<>
inline void GetHLineC<complex64>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
529 const complex64* resRowPtr = srcPlane->ptr<complex64>(y);
532 for(
int i = 0; i < length; i++, x++)
534 pData[i] = complex128(resRowPtr[x].
real(), resRowPtr[x].
imag());
549 template<>
inline void GetHLineC<complex128>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
551 const complex128* resRowPtr = srcPlane->ptr<complex128>(y);
552 memcpy(pData, &resRowPtr[x0], length *
sizeof(complex128));
567 template<
typename _Tp>
inline void SetHLineL(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData)
570 resRowPtr = (_Tp*)(destPlane->ptr(y));
573 for(
int i = 0; i < length; i++, x++)
575 resRowPtr[x] = (_Tp)(pData[i]);
591 template<>
inline void SetHLineL<int32>(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData)
594 resRowPtr = (int32*)(destPlane->ptr(y));
595 memcpy(&resRowPtr[x0], pData, length *
sizeof(int32));
610 template<
typename _Tp>
inline void SetHLineD(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData)
613 resRowPtr = (_Tp*)destPlane->ptr(y);
616 for(
int i = 0; i < length; i++, x++)
618 resRowPtr[x] = cv::saturate_cast<_Tp>(pData[i]);
634 template<>
inline void SetHLineD<ito::float64>(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData)
637 resRowPtr = (float64*)(destPlane->ptr(y));
638 memcpy(&resRowPtr[x0], pData, length *
sizeof(float64));
648 inline int itomType2cvType(
const int type)
677 inline int cvType2itomType(
const int type)
dataObject contains a n-dimensional matrix
Definition: dataobj.h:511
MSize getSize(void)
returns the size-member. m_size fits to the physical organization of data in memory.
Definition: dataobj.h:885
static RetVal format(ito::tRetValue retValue, int retCode, const char *pRetMessage,...)
create RetVal with message that may contain placeholders using the formalism of the default sprintf m...
Definition: retVal.cpp:69
Definition: typeDefs.h:91
Definition: typeDefs.h:60
Definition: typeDefs.h:96
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Definition: typeDefs.h:98
Definition: typeDefs.h:97
int getType(void) const
Definition: dataobj.h:794
Definition: typeDefs.h:94
Definition: typeDefs.h:58
Definition: typeDefs.h:89
DataObject imag(const DataObject &dObj)
high-level value which calculates the imaginary value of each element of the input source data object...
Definition: dataobj.cpp:10622
each range value has a start and end point. Optionally range can be marked as Range::all(), which indicates a full range
Definition: dataobj.h:252
Definition: apiFunctionsGraph.cpp:39
int getDims(void) const
Definition: dataobj.h:791
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 ma...
Definition: dataobj.cpp:1434
Definition: typeDefs.h:93
Definition: typeDefs.h:95
Definition: typeDefs.h:92
cv::Mat ** get_mdata(void)
returns array of pointers to cv::_Mat-matrices (planes) of the data object.
Definition: dataobj.h:861
DataObject real(const DataObject &dObj)
high-level value which calculates the real value of each element of the input source data object and ...
Definition: dataobj.cpp:10215
tDataType
Definition: typeDefs.h:87
int getNumPlanes(void) const
calculates numbers of single opencv matrices which are part of the ROI which has previously been set...
Definition: dataobj.h:817
Definition: typeDefs.h:90