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 &dataObjIn,
ito::DataObject &dataObjOut,
const int copyLastNDims,
const bool includeValueTags =
true,
const bool includeRotationMatrix =
true);
291 DATAOBJ_EXPORT
ito::RetVal dObjSetScaleRectangle(
ito::DataObject &dataObj,
const double &x0,
const double &x1,
const double &y0,
const double &y1);
307 template<
typename _Tp>
ito::RetVal freeRowPointer(_Tp *** &pointer)
316 while(pointer[i] != 0)
362 pointer = (_Tp***)calloc(dObj->
getNumPlanes() + 1,
sizeof(_Tp**));
376 pointer[i] = (_Tp**)calloc(sizeY,
sizeof(_Tp*));
379 for(
int y = 0; y < sizeY; y++)
381 pointer[i][y] = mdata[dObj->
seekMat(i, numMats)]->ptr<_Tp>(y);
391 if(retVal.containsError())
393 freeRowPointer(pointer);
406 template<
typename _Tp>
void GetHLineL(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData);
409 template<
typename _Tp>
void GetHLineD(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData);
412 template<
typename _Tp>
void GetHLineC(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData);
415 template<
typename _Tp>
void SetHLineL(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData);
418 template<
typename _Tp>
void SetHLineD(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData);
432 template<
typename _Tp>
inline void GetHLineL(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData)
435 resRowPtr = (_Tp*)(srcPlane->ptr(y));
438 for(
int i = 0; i < length; i++, x++)
440 pData[i] = (int32)(resRowPtr[x]);
455 template<>
inline void GetHLineL<int32>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, int32 * pData)
458 resRowPtr = (int32*)(srcPlane->ptr(y));
459 memcpy(pData, &resRowPtr[x0], length *
sizeof(int32));
474 template<
typename _Tp>
inline void GetHLineD(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData)
477 resRowPtr = (_Tp*)(srcPlane->ptr(y));
480 for(
int i = 0; i < length; i++, x++)
482 pData[i] = cv::saturate_cast<ito::float64>(resRowPtr[x]);
497 template<>
inline void GetHLineD<ito::float64>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, float64 * pData)
500 resRowPtr = (float64*)(srcPlane->ptr(y));
501 memcpy(pData, &resRowPtr[x0], length *
sizeof(float64));
516 template<
typename _Tp>
inline void GetHLineC(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
518 const _Tp* resRowPtr = srcPlane->ptr<_Tp>(y);
521 for(
int i = 0; i < length; i++, x++)
523 pData[i] = complex128(cv::saturate_cast<ito::float64>(resRowPtr[x]), 0.0);
538 template<>
inline void GetHLineC<complex64>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
540 const complex64* resRowPtr = srcPlane->ptr<complex64>(y);
543 for(
int i = 0; i < length; i++, x++)
545 pData[i] = complex128(resRowPtr[x].
real(), resRowPtr[x].
imag());
560 template<>
inline void GetHLineC<complex128>(
const cv::Mat *srcPlane,
const int x0,
const int y,
const int length, complex128 * pData)
562 const complex128* resRowPtr = srcPlane->ptr<complex128>(y);
563 memcpy(pData, &resRowPtr[x0], length *
sizeof(complex128));
578 template<
typename _Tp>
inline void SetHLineL(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData)
581 resRowPtr = (_Tp*)(destPlane->ptr(y));
584 for(
int i = 0; i < length; i++, x++)
586 resRowPtr[x] = (_Tp)(pData[i]);
602 template<>
inline void SetHLineL<int32>(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const int32 * pData)
605 resRowPtr = (int32*)(destPlane->ptr(y));
606 memcpy(&resRowPtr[x0], pData, length *
sizeof(int32));
621 template<
typename _Tp>
inline void SetHLineD(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData)
624 resRowPtr = (_Tp*)destPlane->ptr(y);
627 for(
int i = 0; i < length; i++, x++)
629 resRowPtr[x] = cv::saturate_cast<_Tp>(pData[i]);
645 template<>
inline void SetHLineD<ito::float64>(cv::Mat *destPlane,
const int x0,
const int y,
const int length,
const float64 * pData)
648 resRowPtr = (float64*)(destPlane->ptr(y));
649 memcpy(&resRowPtr[x0], pData, length *
sizeof(float64));
659 inline int itomType2cvType(
const int type)
688 inline int cvType2itomType(
const int type)
dataObject contains a n-dimensional matrix
Definition dataobj.h:591
int getDims(void) const
Definition dataobj.h:882
int seekMat(const int matNum, const int numMats) const
Definition dataobj.cpp:1557
MSize getSize(void)
returns the size-member. m_size fits to the physical organization of data in memory.
Definition dataobj.h:976
int getNumPlanes(void) const
calculates numbers of single opencv matrices which are part of the ROI which has previously been set.
Definition dataobj.h:908
cv::Mat ** get_mdata(void)
returns array of pointers to cv::_Mat-matrices (planes) of the data object.
Definition dataobj.h:952
int getType(void) const
Definition dataobj.h:885
each range value has a start and end point. Optionally range can be marked as Range::all(),...
Definition dataobj.h:332
Class for managing status values (like errors or warning)
Definition retVal.h:54
static RetVal format(ito::tRetValue retValue, int retCode, const char *pRetMessage,...)
Definition retVal.cpp:69
Definition apiFunctionsGraph.cpp:40
ito::tDataType getDataType2()
method which returns the value of enumeration ito::tDataType, which corresponds to the template param...
Definition dataobj.h:1703
DataObject imag(const DataObject &dObj)
Definition dataobj.cpp:13456
tDataType
Definition typeDefs.h:88
@ tInt16
Definition typeDefs.h:91
@ tFloat32
Definition typeDefs.h:95
@ tInt8
Definition typeDefs.h:89
@ tComplex128
Definition typeDefs.h:98
@ tInt32
Definition typeDefs.h:93
@ tUInt16
Definition typeDefs.h:92
@ tFloat64
Definition typeDefs.h:96
@ tComplex64
Definition typeDefs.h:97
@ tUInt8
Definition typeDefs.h:90
@ tUInt32
Definition typeDefs.h:94
DataObject real(const DataObject &dObj)
Definition dataobj.cpp:13020
@ retError
Definition typeDefs.h:60
@ retOk
Definition typeDefs.h:58