CollimatorDetProcess.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /*! @file
  2. ********************************************************************************
  3. <PRE>
  4. Copyright (c) E-COM 2009-2017.
  5. All rights reserved.
  6. MODULE NAME: Collimator
  7. FILE NAME: CollimatorDetProcess.h
  8. DESCRIPTION: This file is the header of collimator functions.
  9. NOTES: Reference 西门子RAD3项目需求的第316项.
  10. AUTHOR: Chen G.N
  11. VERSION: 1.2
  12. HISTORY: 2013-04-28 First version
  13. </PRE>
  14. *******************************************************************************/
  15. #pragma once
  16. #ifndef FALSE
  17. #define FALSE 0
  18. #endif
  19. #ifndef TRUE
  20. #define TRUE 1
  21. #endif
  22. #ifndef far
  23. #define far
  24. #endif
  25. typedef unsigned char BYTE;
  26. typedef unsigned short WORD;
  27. typedef unsigned long DWORD;
  28. typedef void far *LPVOID;
  29. #ifdef _WIN64
  30. #ifdef _DEBUG
  31. #pragma comment(lib, "CollimatorX64D.lib")
  32. #else
  33. #pragma comment(lib, "CollimatorX64.lib")
  34. #endif
  35. #else
  36. #ifdef _DEBUG
  37. #pragma comment(lib, "CollimatorD.lib")
  38. #else
  39. #pragma comment(lib, "Collimator.lib")
  40. #endif
  41. #endif
  42. /*! @function
  43. ********************************************************************************
  44. <PRE>
  45. FUNCTION NAME: GetBeginEnd
  46. DESCRIPTION: Get the Begin and End of the histogram for image with a mask.
  47. PARA: [IN] pImage : pointer for the image
  48. [IN] nWidth : image width
  49. [IN] nHeight : image height
  50. [IN] nFlag : image bits
  51. [IN] nInvert : not used
  52. [IN] nLeft, nRight, nTop, nBottom: mask boundary
  53. [IN|OUT] nBegin, nEnd : begin or end of the histogram
  54. HISTORY: 2013-09-29 First version
  55. </PRE>
  56. *******************************************************************************/
  57. extern "C" bool __declspec(dllexport) GetBeginEnd(int nFlag,int nInvert,
  58. const unsigned short* pData,int nWidth,int nHeight,
  59. int nLeft,int nRight,int nTop,int nBottom,int &nBegin,int &nEnd);
  60. /*! @function
  61. ********************************************************************************
  62. <PRE>
  63. FUNCTION NAME: AutoCrop
  64. DESCRIPTION: interface of the autocrop.
  65. PARA: [IN] pImage : pointer for the image
  66. [IN] nWidth : image width
  67. [IN] nHeight : image height
  68. [IN] ImageBit : image bits
  69. [IN|OUT] leftside, rightside, upside, bottomside: output of the
  70. boundary
  71. HISTORY: 2013-09-29 First version
  72. </PRE>
  73. *******************************************************************************/
  74. extern "C" int __declspec(dllexport) AutoCrop( WORD *pIn, int Width, int Height,
  75. int ImageBit,int &leftside, int &rightside,int &upside, int &bottomside );
  76. /*! @function
  77. ********************************************************************************
  78. <PRE>
  79. FUNCTION NAME: AutoCropReleaseALLMem
  80. DESCRIPTION: Memery release function for all InArray and OutArray.
  81. PARA: [IN|OUT] pInArray : pointer for InArray
  82. [IN|OUT] pOutArray : pointer for OutArray
  83. HISTORY: 2013-09-29 First version
  84. 2016-08-15 Add memery release for AutoCropProcess_polygon
  85. </PRE>
  86. *******************************************************************************/
  87. extern "C" int __declspec(dllexport) AutoCropReleaseALLMem( LPVOID *pInArray,
  88. LPVOID *pOutArray, int OutFlag );
  89. /*! @function
  90. ********************************************************************************
  91. <PRE>
  92. FUNCTION NAME: GetALLFunctionNum
  93. DESCRIPTION: get the number of all functions.
  94. PARA: [OUT] : number of all functions
  95. HISTORY: 2013-09-29 First version
  96. </PRE>
  97. *******************************************************************************/
  98. extern "C" int __declspec(dllexport) GetALLFunctionNum();
  99. /*! @function
  100. ********************************************************************************
  101. <PRE>
  102. FUNCTION NAME: GetALLFunctionNames
  103. DESCRIPTION: get the name of all functions.
  104. PARA: [IN|OUT] pFuncNameList : list of the functions' name
  105. [IN] count : not used
  106. HISTORY: 2013-09-29 First version
  107. </PRE>
  108. *******************************************************************************/
  109. extern "C" int __declspec(dllexport) GetALLFunctionNames(char** pFuncNameList,
  110. int count);
  111. /*! @function
  112. ********************************************************************************
  113. <PRE>
  114. FUNCTION NAME: AutoCropFunctionInfo
  115. DESCRIPTION: Get the info of autocrop function.
  116. PARA: [IN|OUT] nInputBufferCount : Input BufferCount
  117. [IN|OUT] nMicroParamCount : Micro Parameters Count
  118. [IN|OUT] nOutParamCount : Output Parameters Count
  119. HISTORY: 2013-09-29 First version
  120. </PRE>
  121. *******************************************************************************/
  122. extern "C" int __declspec(dllexport) AutoCropFunctionInfo(int* nInputBufferCount,
  123. int* nMicroParamCount, int* nOutParamCount);
  124. /*! @function
  125. ********************************************************************************
  126. <PRE>
  127. FUNCTION NAME: AutoCropProcess
  128. DESCRIPTION: interface for DROC V2 device layer.
  129. REFERENCE: 西门子RAD3项目需求的第316项.
  130. PARA: [IN|OUT] pInArray : input array
  131. [IN|OUT] pMicroParam : micro parameters
  132. [IN] MicroParamNum : number of micro parameters
  133. [IN|OUT] pOutArray : output array
  134. [IN] nOutParamNum : number of output parameters
  135. RETURN: OK : return 0; others : return error code
  136. HISTORY: 2016-07-09 First version
  137. </PRE>
  138. *******************************************************************************/
  139. extern "C" int __declspec(dllexport) AutoCropProcess( LPVOID *pInArray,
  140. float* pMicroParam, int MicroParamNum, LPVOID *pOutArray, int nOutParamNum );
  141. /*! @function
  142. ********************************************************************************
  143. <PRE>
  144. FUNCTION NAME: AutoCropForNDT
  145. DESCRIPTION: AutoCrop function for NDT use.
  146. PARA: [IN] pImage : pointer for the image
  147. [IN] nWidth : image width
  148. [IN] nHeight : image height
  149. [IN] ImageBit : image bits
  150. [IN|OUT] leftside, rightside, upside, bottomside: output of the
  151. boundary
  152. HISTORY: 2013-09-29 First version
  153. </PRE>
  154. *******************************************************************************/
  155. extern "C" int __declspec(dllexport) AutoCropForNDT( WORD *pImage, int nWidth,
  156. int nHeight, int ImageBit,int &leftside, int &rightside,int &upside,
  157. int &bottomside );
  158. /*! @function
  159. ********************************************************************************
  160. <PRE>
  161. FUNCTION NAME: AutoCropProcess_v3
  162. DESCRIPTION: new interface for DROC V3 device layer.
  163. REFERENCE: 西门子RAD3项目需求的第316项.
  164. PARA: [IN|OUT] pInArray : input array
  165. [IN|OUT] pMicroParam : micro parameters
  166. [IN] MicroParamNum : number of micro parameters
  167. [IN|OUT] pOutArray : output array
  168. [IN] nOutParamNum : number of output parameters
  169. RETURN: OK : return 0; others : return error code
  170. HISTORY: 2017-03-09 First version
  171. </PRE>
  172. *******************************************************************************/
  173. extern "C" int __declspec(dllexport) AutoCropProcess_v3( LPVOID *pInArray,
  174. float* pMicroParam, int MicroParamNum, LPVOID *pOutArray, int nOutParamNum );