ImageHeader.h 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. //ImageHeader.h
  2. #pragma once
  3. #define IMAGE_HEADER_LEN 16384 //16K
  4. #define FRAME_HEADER_LEN 4096 // 4K
  5. #define LEN_2 2
  6. #define LEN_4 4
  7. #define LEN_8 8 //DA
  8. #define LEN_12 12 //IS
  9. #define LEN_16 16 //DS
  10. #define LEN_26 26
  11. #define LEN_32 32
  12. #define LEN_64 64 //LO
  13. #define LEN_1024 1024
  14. //float //FL
  15. //对应结构在ECOM中所占的长度
  16. #define FileHeaderLength 64
  17. #define GeneralImageModuleLength 512
  18. #define ModalityImageModuleLength 512
  19. #define ImagePixelModuleLength 128
  20. #define DisplayShutterModuleLength 256
  21. #define XrayGenerationModuleLength 128
  22. #define XrayGridModuleLength 128
  23. #define XrayCollimatorModuleLength 256
  24. #define XrayFiltrationModuleLength 128
  25. #define ModalityDetectorModuleLength 512
  26. #define XrayDetectorModuleLength 32
  27. #define ModalityPositioningModuleLength 512
  28. #define XrayAcquisitionDoseModuleLength 512
  29. #define XrayTomographyAcquisitionModuleLength 256
  30. //1) 文件头
  31. // FileHeader
  32. #define FileHeaderOffset 0
  33. typedef struct tagFileHeader
  34. {
  35. char strVersion[LEN_16]; //ECOM文件的版本号
  36. char strVersionDescription[LEN_16]; //版本描述
  37. UINT nFileLength; //整个文件的大小
  38. UINT nFrameNumber; //图像总帧数
  39. UINT nFileType; //文件类型
  40. tagFileHeader()
  41. {
  42. ZeroMemory(strVersion, LEN_16);
  43. ZeroMemory(strVersionDescription, LEN_16);
  44. nFileLength = 0;
  45. nFrameNumber = 0;
  46. nFileType = 0;
  47. }
  48. tagFileHeader& operator= (const tagFileHeader& tfh)
  49. {
  50. strcpy_s(strVersion, LEN_16, tfh.strVersion);
  51. strcpy_s(strVersionDescription, LEN_16, tfh.strVersionDescription);
  52. nFileLength = tfh.nFileLength;
  53. nFrameNumber = tfh.nFrameNumber;
  54. nFileType = tfh.nFileType;
  55. return *this;
  56. }
  57. }FileHeader;
  58. // General Image Module
  59. #define GeneralImageModuleOffset (FileHeaderOffset+FileHeaderLength)
  60. typedef struct tagGeneralImageModule
  61. {
  62. char strInstanceNumber[LEN_12] ; //(0020,0013)
  63. char strPatientOrientation[LEN_16]; //(0020,0020)
  64. char strContentDate[LEN_8]; //(0008,0023)
  65. char strContentTime[LEN_16]; //(0008,0033)
  66. char strImageType[LEN_16]; //(0008,0008)
  67. char strAcquisitionNumber[LEN_12]; //(0020,0012)
  68. char strAcquisitionDate[LEN_8]; //(0008,0022)
  69. char strAcquisitionTime[LEN_16]; //(0008,0032)
  70. char strAcquisitionDatetime[LEN_26]; //(0008,002A)
  71. char strImagesinAcquisition[LEN_12]; // (0020,1002)
  72. char strQualityControlImage[LEN_16]; //(0028,0300)
  73. char strBurnedInAnnotation[LEN_16]; //(0028,0301)
  74. char strLossyImageCompression[LEN_16]; // (0028,2110)
  75. char strLossyImageCompressionRatio[LEN_16]; // (0028,2112)
  76. char strPresentationLUTShape[LEN_16]; // (2050,0020)
  77. tagGeneralImageModule()
  78. {
  79. ZeroMemory(strInstanceNumber, LEN_12) ;
  80. ZeroMemory(strPatientOrientation, LEN_16);
  81. ZeroMemory(strContentDate, LEN_8);
  82. ZeroMemory(strContentTime, LEN_16);
  83. ZeroMemory(strImageType, LEN_16);
  84. ZeroMemory(strAcquisitionNumber, LEN_12);
  85. ZeroMemory(strAcquisitionDate, LEN_8);
  86. ZeroMemory(strAcquisitionTime, LEN_16);
  87. ZeroMemory(strAcquisitionDatetime, LEN_26);
  88. ZeroMemory(strImagesinAcquisition, LEN_12);
  89. ZeroMemory(strQualityControlImage, LEN_16);
  90. ZeroMemory(strBurnedInAnnotation, LEN_16);
  91. ZeroMemory(strLossyImageCompression, LEN_16);
  92. ZeroMemory(strLossyImageCompressionRatio, LEN_16);
  93. ZeroMemory(strPresentationLUTShape, LEN_16);
  94. }
  95. tagGeneralImageModule& operator=(const tagGeneralImageModule& tgi)
  96. {
  97. strcpy_s(strInstanceNumber, LEN_12, tgi.strInstanceNumber) ;
  98. strcpy_s(strPatientOrientation, LEN_16, tgi.strPatientOrientation);
  99. strcpy_s(strContentDate, LEN_8, tgi.strContentDate);
  100. strcpy_s(strContentTime, LEN_16, tgi.strContentTime);
  101. strcpy_s(strImageType, LEN_16, tgi.strImageType);
  102. strcpy_s(strAcquisitionNumber, LEN_12, tgi.strAcquisitionNumber);
  103. strcpy_s(strAcquisitionDate, LEN_8, tgi.strAcquisitionDate);
  104. strcpy_s(strAcquisitionTime, LEN_16, tgi.strAcquisitionTime);
  105. strcpy_s(strAcquisitionDatetime, LEN_26, tgi.strAcquisitionDatetime);
  106. strcpy_s(strImagesinAcquisition, LEN_12, tgi.strImagesinAcquisition);
  107. strcpy_s(strQualityControlImage, LEN_16, tgi.strQualityControlImage);
  108. strcpy_s(strBurnedInAnnotation, LEN_16, tgi.strBurnedInAnnotation);
  109. strcpy_s(strLossyImageCompression, LEN_16, tgi.strLossyImageCompression);
  110. strcpy_s(strLossyImageCompressionRatio, LEN_16, tgi.strLossyImageCompressionRatio);
  111. strcpy_s(strPresentationLUTShape, LEN_16, tgi.strPresentationLUTShape);
  112. return *this;
  113. }
  114. }GeneralImageModule;
  115. //Image Pixel Module
  116. #define ImagePixelModuleOffset (GeneralImageModuleOffset+GeneralImageModuleLength)
  117. typedef struct tagImagePixelModule
  118. {
  119. unsigned short nSamplesperPixel; //(0028,0002)
  120. char strPhotometricInterpretation[LEN_16]; //(0028,0004)
  121. unsigned short Rows; //(0028,0010)
  122. unsigned short Columns; //(0028,0011)
  123. unsigned short BitsAllocated; //(0028,0100)
  124. unsigned short BitsStored; //(0028,0101)
  125. unsigned short HighBit; //(0028,0102)
  126. unsigned short PixelRepresentation; //(0028,0103)
  127. unsigned short PlanarConfiguration; //(0028,0006)
  128. char strPixelAspectRatio[LEN_12]; //(0028,0034)
  129. unsigned short SmallestImagePixelValue; //(0028,0106)
  130. unsigned short LargestImagePixelValue; //(0028,0107)
  131. tagImagePixelModule()
  132. {
  133. nSamplesperPixel = 0;
  134. ZeroMemory(strPhotometricInterpretation, LEN_16);
  135. Rows = 0;
  136. Columns = 0;
  137. BitsAllocated = 0;
  138. BitsStored = 0;
  139. HighBit = 0;
  140. PixelRepresentation = 0;
  141. PlanarConfiguration = 0xFF;
  142. ZeroMemory(strPixelAspectRatio, LEN_12);
  143. SmallestImagePixelValue = 0;
  144. LargestImagePixelValue = 0;
  145. }
  146. tagImagePixelModule& operator=(const tagImagePixelModule& tip)
  147. {
  148. nSamplesperPixel = tip.nSamplesperPixel;
  149. strcpy_s(strPhotometricInterpretation, LEN_16, tip.strPhotometricInterpretation);
  150. Rows = tip.Rows;
  151. Columns = tip.Columns;
  152. BitsAllocated = tip.BitsAllocated;
  153. BitsStored = tip.BitsStored;
  154. HighBit = tip.HighBit;
  155. PixelRepresentation = tip.PixelRepresentation;
  156. PlanarConfiguration = tip.PlanarConfiguration;
  157. strcpy_s(strPixelAspectRatio, LEN_12, tip.strPixelAspectRatio);
  158. SmallestImagePixelValue = tip.SmallestImagePixelValue;
  159. LargestImagePixelValue = tip.LargestImagePixelValue;
  160. return *this;
  161. }
  162. }ImagePixelModule;
  163. //DX Image Module -- ModalityImageModule General Image Module基础上加入一下信息:
  164. #define ModalityImageModuleOffset (ImagePixelModuleOffset+ImagePixelModuleLength)
  165. typedef struct tagModalityImageModule
  166. {
  167. unsigned short nPixelRepresentation; //(0028,0103)
  168. char strPixelIntensityRelationship[LEN_16]; //(0028,1040)
  169. signed short nPixelIntensityRelationshipSign; //(0028,1041)
  170. char strRescaleIntercept[LEN_16]; //(0028,1052)
  171. char strRescaleSlope[LEN_16]; //(0028,1053)
  172. char strRescaleType[LEN_64]; //(0028,1054)
  173. char strAcquisitionDeviceProcessingDescription[LEN_64]; //(0018,1400)
  174. char strAcquisitionDeviceProcessingCode[LEN_64]; //(0018,1401)
  175. char strCalibrationImage[LEN_16]; //(0050,0004)
  176. char strWindowCenter[LEN_16]; //(0028,1050)
  177. char strWindowWidth[LEN_16]; //(0028,1051)
  178. tagModalityImageModule()
  179. {
  180. nPixelRepresentation = 0;
  181. ZeroMemory(strPixelIntensityRelationship, LEN_16);
  182. nPixelIntensityRelationshipSign = 0;
  183. ZeroMemory(strRescaleIntercept, LEN_16);
  184. ZeroMemory(strRescaleSlope, LEN_16);
  185. ZeroMemory(strRescaleType, LEN_64);
  186. ZeroMemory(strAcquisitionDeviceProcessingDescription, LEN_64);
  187. ZeroMemory(strAcquisitionDeviceProcessingCode, LEN_64);
  188. ZeroMemory(strCalibrationImage, LEN_16);
  189. ZeroMemory(strWindowCenter, LEN_16);
  190. ZeroMemory(strWindowWidth, LEN_16);
  191. }
  192. tagModalityImageModule& operator=(const tagModalityImageModule& tmi)
  193. {
  194. nPixelRepresentation = tmi.nPixelRepresentation;
  195. strcpy_s(strPixelIntensityRelationship, LEN_16, tmi.strPixelIntensityRelationship);
  196. nPixelIntensityRelationshipSign = tmi.nPixelIntensityRelationshipSign;
  197. strcpy_s(strRescaleIntercept, LEN_16, tmi.strRescaleIntercept);
  198. strcpy_s(strRescaleSlope, LEN_16, tmi.strRescaleSlope);
  199. strcpy_s(strRescaleType, LEN_64, tmi.strRescaleType);
  200. strcpy_s(strAcquisitionDeviceProcessingDescription, LEN_64, tmi.strAcquisitionDeviceProcessingDescription);
  201. strcpy_s(strAcquisitionDeviceProcessingCode, LEN_64, tmi.strAcquisitionDeviceProcessingCode);
  202. strcpy_s(strCalibrationImage, LEN_16, tmi.strCalibrationImage);
  203. strcpy_s(strWindowCenter, LEN_16, tmi.strWindowCenter);
  204. strcpy_s(strWindowWidth, LEN_16, tmi.strWindowWidth);
  205. return *this;
  206. }
  207. }ModalityImageModule;
  208. //Display Shutter Module
  209. #define DisplayShutterModuleOffset (ModalityImageModuleOffset+ModalityImageModuleLength)
  210. typedef struct tagDisplayShutterModule
  211. {
  212. char strShutterShape[LEN_16]; //(0018,1600)
  213. char strShutterLeftVerticalEdge[LEN_12]; //(0018,1602)
  214. char strShutterRightVerticalEdge[LEN_12]; //(0018,1604)
  215. char strShutterUpperHorizontalEdge[LEN_12]; //(0018,1606)
  216. char strShutterLowerHorizontalEdge[LEN_12]; //(0018,1608)
  217. char strCenterofCircularShutter[LEN_12]; //(0018,1610)
  218. char strRadiusofCircularShutter[LEN_12]; //(0018,1612)
  219. char strVerticesofthePolygonalShutter[LEN_12]; //(0018,1620)
  220. unsigned short nShutterPresentationValue; //(0018,1622)
  221. tagDisplayShutterModule()
  222. {
  223. ZeroMemory(strShutterShape, LEN_16);
  224. ZeroMemory(strShutterLeftVerticalEdge, LEN_12);
  225. ZeroMemory(strShutterRightVerticalEdge, LEN_12);
  226. ZeroMemory(strShutterUpperHorizontalEdge, LEN_12);
  227. ZeroMemory(strShutterLowerHorizontalEdge, LEN_12);
  228. ZeroMemory(strCenterofCircularShutter, LEN_12);
  229. ZeroMemory(strRadiusofCircularShutter, LEN_12);
  230. ZeroMemory(strVerticesofthePolygonalShutter, LEN_12);
  231. nShutterPresentationValue = 0xFF;
  232. }
  233. tagDisplayShutterModule& operator=(const tagDisplayShutterModule& tds)
  234. {
  235. strcpy_s(strShutterShape, LEN_16, tds.strShutterShape);
  236. strcpy_s(strShutterLeftVerticalEdge, LEN_12, tds.strShutterLeftVerticalEdge);
  237. strcpy_s(strShutterRightVerticalEdge, LEN_12, tds.strShutterRightVerticalEdge);
  238. strcpy_s(strShutterUpperHorizontalEdge, LEN_12, tds.strShutterUpperHorizontalEdge);
  239. strcpy_s(strShutterLowerHorizontalEdge, LEN_12, tds.strShutterLowerHorizontalEdge);
  240. strcpy_s(strCenterofCircularShutter, LEN_12, tds.strCenterofCircularShutter);
  241. strcpy_s(strRadiusofCircularShutter, LEN_12, tds.strRadiusofCircularShutter);
  242. strcpy_s(strVerticesofthePolygonalShutter, LEN_12, tds.strVerticesofthePolygonalShutter);
  243. nShutterPresentationValue = tds.nShutterPresentationValue;
  244. return *this;
  245. }
  246. }DisplayShutterModule;
  247. //X-RAY GENERATION MODULE
  248. #define XrayGenerationModuleOffset (DisplayShutterModuleOffset+DisplayShutterModuleLength)
  249. typedef struct tagXrayGenerationModule
  250. {
  251. char strExposureControlMode[LEN_16]; //(0018,7060)
  252. char strExposureStatus[LEN_16]; //(0018,7064)
  253. char strPhototimerSetting[LEN_16]; //(0018,7065)
  254. char strFocalSpot[LEN_16]; //(0018,1190)
  255. tagXrayGenerationModule()
  256. {
  257. ZeroMemory(strExposureControlMode, LEN_16);
  258. ZeroMemory(strExposureStatus, LEN_16);
  259. ZeroMemory(strPhototimerSetting, LEN_16);
  260. ZeroMemory(strFocalSpot, LEN_16);
  261. }
  262. tagXrayGenerationModule& operator=(const tagXrayGenerationModule& txg)
  263. {
  264. strcpy_s(strExposureControlMode, LEN_16, txg.strExposureControlMode);
  265. strcpy_s(strExposureStatus, LEN_16, txg.strExposureStatus);
  266. strcpy_s(strPhototimerSetting, LEN_16, txg.strPhototimerSetting);
  267. strcpy_s(strFocalSpot, LEN_16, txg.strFocalSpot);
  268. return *this;
  269. }
  270. }XrayGenerationModule;
  271. //X-Ray Grid Module
  272. #define XrayGridModuleOffset (XrayGenerationModuleOffset+XrayGenerationModuleLength)
  273. typedef struct tagXrayGridModule
  274. {
  275. char strGrid[LEN_16]; //(0018,1166)
  276. char strGridThickness[LEN_16]; //(0018,7042)
  277. char strGridPitch[LEN_16]; //(0018,7044)
  278. char strGridAspectRatio[LEN_12]; //(0018,7046)
  279. char strGridPeriod[LEN_16]; //(0018,7048)
  280. char strGridFocalDistance[LEN_16]; //(0018,704C)
  281. tagXrayGridModule()
  282. {
  283. ZeroMemory(strGrid, LEN_16);
  284. ZeroMemory(strGridThickness, LEN_16);
  285. ZeroMemory(strGridPitch, LEN_16);
  286. ZeroMemory(strGridAspectRatio, LEN_12);
  287. ZeroMemory(strGridPeriod, LEN_16);
  288. ZeroMemory(strGridFocalDistance, LEN_16);
  289. }
  290. tagXrayGridModule& operator=(const tagXrayGridModule& txg)
  291. {
  292. strcpy_s(strGrid, LEN_16, txg.strGrid);
  293. strcpy_s(strGridThickness, LEN_16, txg.strGridThickness);
  294. strcpy_s(strGridPitch, LEN_16, txg.strGridPitch);
  295. strcpy_s(strGridAspectRatio, LEN_12, txg.strGridAspectRatio);
  296. strcpy_s(strGridPeriod, LEN_16, txg.strGridPeriod);
  297. strcpy_s(strGridFocalDistance, LEN_16, txg.strGridFocalDistance);
  298. return *this;
  299. }
  300. }XrayGridModule;
  301. //X-Ray Collimator attributes
  302. #define XrayCollimatorModuleOffset (XrayGridModuleOffset+XrayGridModuleLength)
  303. typedef struct tagXrayCollimatorModule
  304. {
  305. char strCollimatorShape[LEN_16]; //(0018,1700)
  306. char strCollimatorLeftVerticalEdge[LEN_12]; //(0018,1702)
  307. char strCollimatorRightVerticalEdge[LEN_12]; //(0018,1704)
  308. char strCollimatorUpperHorizontalEdge[LEN_12]; //(0018,1706)
  309. char strCollimatorLowerHorizontalEdge[LEN_12]; //(0018,1708)
  310. char strCenterofCircularCollimator[LEN_12]; //(0018,1710)
  311. char strRadiusofCircularCollimator[LEN_12]; //(0018,1712)
  312. char strVerticesofthePolygonalCollimator[LEN_12]; //(0018,1720)
  313. tagXrayCollimatorModule()
  314. {
  315. ZeroMemory(strCollimatorShape, LEN_16);
  316. ZeroMemory(strCollimatorLeftVerticalEdge, LEN_12);
  317. ZeroMemory(strCollimatorRightVerticalEdge, LEN_12);
  318. ZeroMemory(strCollimatorUpperHorizontalEdge, LEN_12);
  319. ZeroMemory(strCollimatorLowerHorizontalEdge, LEN_12);
  320. ZeroMemory(strCenterofCircularCollimator, LEN_12);
  321. ZeroMemory(strRadiusofCircularCollimator, LEN_12);
  322. ZeroMemory(strVerticesofthePolygonalCollimator, LEN_12);
  323. }
  324. tagXrayCollimatorModule& operator=(const tagXrayCollimatorModule& txc)
  325. {
  326. strcpy_s(strCollimatorShape, LEN_16, txc.strCollimatorShape);
  327. strcpy_s(strCollimatorLeftVerticalEdge, LEN_12, txc.strCollimatorLeftVerticalEdge);
  328. strcpy_s(strCollimatorRightVerticalEdge, LEN_12, txc.strCollimatorRightVerticalEdge);
  329. strcpy_s(strCollimatorUpperHorizontalEdge, LEN_12, txc.strCollimatorUpperHorizontalEdge);
  330. strcpy_s(strCollimatorLowerHorizontalEdge, LEN_12, txc.strCollimatorLowerHorizontalEdge);
  331. strcpy_s(strCenterofCircularCollimator, LEN_12, txc.strCenterofCircularCollimator);
  332. strcpy_s(strRadiusofCircularCollimator, LEN_12, txc.strRadiusofCircularCollimator);
  333. strcpy_s(strVerticesofthePolygonalCollimator, LEN_12, txc.strVerticesofthePolygonalCollimator);
  334. return *this;
  335. }
  336. }XrayCollimatorModule;
  337. //X-Ray Filtration Module
  338. #define XrayFiltrationModuleOffset (XrayCollimatorModuleOffset+XrayCollimatorModuleLength)
  339. typedef struct tagXrayFiltrationModule
  340. {
  341. char strFilterType[LEN_16]; //(0018,1160)
  342. char strFilterMaterial[LEN_16]; //(0018,7050)
  343. char strFilterThicknessMinimum[LEN_16]; //(0018,7052)
  344. char strFilterThicknessMaximum[LEN_16]; //(0018,7054)
  345. tagXrayFiltrationModule()
  346. {
  347. ZeroMemory(strFilterType, LEN_16);
  348. ZeroMemory(strFilterMaterial, LEN_16);
  349. ZeroMemory(strFilterThicknessMinimum, LEN_16);
  350. ZeroMemory(strFilterThicknessMaximum, LEN_16);
  351. }
  352. tagXrayFiltrationModule& operator=(const tagXrayFiltrationModule& txf)
  353. {
  354. strcpy_s(strFilterType, LEN_16, txf.strFilterType);
  355. strcpy_s(strFilterMaterial, LEN_16, txf.strFilterMaterial);
  356. strcpy_s(strFilterThicknessMinimum, LEN_16, txf.strFilterThicknessMinimum);
  357. strcpy_s(strFilterThicknessMaximum, LEN_16, txf.strFilterThicknessMaximum);
  358. return *this;
  359. }
  360. }XrayFiltrationModule;
  361. //DX Detector Module - ModalityDetectorModule
  362. #define ModalityDetectorModuleOffset (XrayFiltrationModuleOffset+XrayFiltrationModuleLength)
  363. typedef struct tagModalityDetectorModule
  364. {
  365. char strDetectorActiveTime[LEN_16]; //(0018,7014)
  366. char strDetectorActivationOffsetFromExposure[LEN_16]; //(0018,7016)
  367. char strFieldofViewShape[LEN_16]; //(0018,1147)
  368. char strFieldofViewDimension[LEN_12]; //(0018,1149)
  369. char strFieldofViewOrigin[LEN_16]; //(0018,7030)
  370. char strFieldofViewRotation[LEN_16]; //(0018,7032) -- 0, 90, 180, 270
  371. char strFieldofViewHorizontalFlip[LEN_16]; //(0018,7034)
  372. char strImagerPixelSpacing[LEN_16]; //(0018,1164)
  373. char strDetectorType[LEN_16]; //(0018,7004)
  374. char strDetectorConfiguration[LEN_16]; //(0018,7005) – AREA, SLOT
  375. char strDetectorID[LEN_16]; //(0018,700A)
  376. char strDateofLastDetectorCalibration[LEN_8]; //(0018,700C)
  377. char strTimeofLastDetectorCalibration[LEN_16]; //(0018,700E)
  378. char strExposuresonDetectorSinceLastCalibration[LEN_12]; //(0018,7010)
  379. char strExposuresonDetectorSinceManufactured[LEN_12]; //(0018,7011)
  380. char strDetectorTimeSinceLastExposure[LEN_16]; //(0018,7012)
  381. char strDetectorBinning[LEN_16]; //(0018,701A)
  382. char strDetectorConditionsNominalFlag[LEN_16]; //(0018,7000)
  383. char strDetectorTemperature[LEN_16]; //(0018,7001)
  384. char strSensitivity[LEN_16]; //(0018,6000)
  385. char strDetectorElementPhysicalSize[LEN_16]; //(0018,7020)
  386. char strDetectorElementSpacing[LEN_16]; //(0018,7022)
  387. char strDetectorActiveShape[LEN_16]; //(0018,7024)
  388. char strDetectorActiveDimension[LEN_16]; //(0018,7026)
  389. char strDetectorActiveOrigin[LEN_16]; //(0018,7028)
  390. tagModalityDetectorModule()
  391. {
  392. ZeroMemory(strDetectorActiveTime, LEN_16);
  393. ZeroMemory(strDetectorActivationOffsetFromExposure, LEN_16);
  394. ZeroMemory(strFieldofViewShape, LEN_16);
  395. ZeroMemory(strFieldofViewDimension, LEN_12);
  396. ZeroMemory(strFieldofViewOrigin, LEN_16);
  397. ZeroMemory(strFieldofViewRotation, LEN_16);
  398. ZeroMemory(strFieldofViewHorizontalFlip, LEN_16);
  399. ZeroMemory(strImagerPixelSpacing, LEN_16);
  400. ZeroMemory(strDetectorType, LEN_16);
  401. ZeroMemory(strDetectorConfiguration, LEN_16);
  402. ZeroMemory(strDetectorID, LEN_16);
  403. ZeroMemory(strDateofLastDetectorCalibration, LEN_8);
  404. ZeroMemory(strTimeofLastDetectorCalibration, LEN_16);
  405. ZeroMemory(strExposuresonDetectorSinceLastCalibration, LEN_12);
  406. ZeroMemory(strExposuresonDetectorSinceManufactured, LEN_12);
  407. ZeroMemory(strDetectorTimeSinceLastExposure, LEN_16);
  408. ZeroMemory(strDetectorBinning, LEN_16);
  409. ZeroMemory(strDetectorConditionsNominalFlag, LEN_16);
  410. ZeroMemory(strDetectorTemperature, LEN_16);
  411. ZeroMemory(strSensitivity, LEN_16);
  412. ZeroMemory(strDetectorElementPhysicalSize, LEN_16);
  413. ZeroMemory(strDetectorElementSpacing, LEN_16);
  414. ZeroMemory(strDetectorActiveShape, LEN_16);
  415. ZeroMemory(strDetectorActiveDimension, LEN_16);
  416. ZeroMemory(strDetectorActiveOrigin, LEN_16);
  417. }
  418. tagModalityDetectorModule& operator=(const tagModalityDetectorModule& tmd)
  419. {
  420. strcpy_s(strDetectorActiveTime, LEN_16, tmd.strDetectorActiveTime);
  421. strcpy_s(strDetectorActivationOffsetFromExposure, LEN_16, tmd.strDetectorActivationOffsetFromExposure);
  422. strcpy_s(strFieldofViewShape, LEN_16, tmd.strFieldofViewShape);
  423. strcpy_s(strFieldofViewDimension, LEN_12, tmd.strFieldofViewDimension);
  424. strcpy_s(strFieldofViewOrigin, LEN_16, tmd.strFieldofViewOrigin);
  425. strcpy_s(strFieldofViewRotation, LEN_16, tmd.strFieldofViewRotation);
  426. strcpy_s(strFieldofViewHorizontalFlip, LEN_16, tmd.strFieldofViewHorizontalFlip);
  427. strcpy_s(strImagerPixelSpacing, LEN_16, tmd.strImagerPixelSpacing);
  428. strcpy_s(strDetectorType, LEN_16, tmd.strDetectorType);
  429. strcpy_s(strDetectorConfiguration, LEN_16, tmd.strDetectorConfiguration);
  430. strcpy_s(strDetectorID, LEN_16, tmd.strDetectorID);
  431. strcpy_s(strDateofLastDetectorCalibration, LEN_8, tmd.strDateofLastDetectorCalibration);
  432. strcpy_s(strTimeofLastDetectorCalibration, LEN_16, tmd.strTimeofLastDetectorCalibration);
  433. strcpy_s(strExposuresonDetectorSinceLastCalibration, LEN_12, tmd.strExposuresonDetectorSinceLastCalibration);
  434. strcpy_s(strExposuresonDetectorSinceManufactured, LEN_12, tmd.strExposuresonDetectorSinceManufactured);
  435. strcpy_s(strDetectorTimeSinceLastExposure, LEN_16, tmd.strDetectorTimeSinceLastExposure);
  436. strcpy_s(strDetectorBinning, LEN_16, tmd.strDetectorBinning);
  437. strcpy_s(strDetectorConditionsNominalFlag, LEN_16, tmd.strDetectorConditionsNominalFlag);
  438. strcpy_s(strDetectorTemperature, LEN_16, tmd.strDetectorTemperature);
  439. strcpy_s(strSensitivity, LEN_16, tmd.strSensitivity);
  440. strcpy_s(strDetectorElementPhysicalSize, LEN_16, tmd.strDetectorElementPhysicalSize);
  441. strcpy_s(strDetectorElementSpacing, LEN_16, tmd.strDetectorElementSpacing);
  442. strcpy_s(strDetectorActiveShape, LEN_16, tmd.strDetectorActiveShape);
  443. strcpy_s(strDetectorActiveDimension, LEN_16, tmd.strDetectorActiveDimension);
  444. strcpy_s(strDetectorActiveOrigin, LEN_16, tmd.strDetectorActiveOrigin);
  445. return *this;
  446. }
  447. }ModalityDetectorModule;
  448. //X-Ray Detector Module
  449. #define XrayDetectorModuleOffset (ModalityDetectorModuleOffset+ModalityDetectorModuleLength)
  450. typedef struct tagXrayDetectorModule
  451. {
  452. float fPhysicalDetectorSize; //(0018,9429)
  453. float fPositionofIsocenterProjection; //(0018,9430)
  454. tagXrayDetectorModule()
  455. {
  456. fPhysicalDetectorSize = 0;
  457. fPositionofIsocenterProjection = 0;
  458. }
  459. tagXrayDetectorModule& operator=(const tagXrayDetectorModule& txd)
  460. {
  461. fPhysicalDetectorSize = txd.fPhysicalDetectorSize;
  462. fPositionofIsocenterProjection = txd.fPositionofIsocenterProjection;
  463. return *this;
  464. }
  465. }XrayDetectorModule;
  466. //DX Positioning Module - ModalityPositioningModule
  467. #define ModalityPositioningModuleOffset (XrayDetectorModuleOffset+XrayDetectorModuleLength)
  468. typedef struct tagModalityPositioningModule
  469. {
  470. char strPatientPosition[LEN_16]; //(0018,5100)
  471. char strViewPosition[LEN_16]; //(0018,5101)
  472. char strDistanceSourcetoPatient[LEN_16]; //(0018,1111)
  473. char strDistanceSourcetoDetector[LEN_16]; //(0018,1110)
  474. char strEstimatedRadiographicMagnificationFactor[LEN_16]; //(0018,1114)
  475. char strPositionerType[LEN_16]; //(0018,1508)
  476. char strPositionerPrimaryAngle[LEN_16]; //(0018,1510)
  477. char strPositionerSecondaryAngle[LEN_16]; //(0018,1511)
  478. char strDetectorPrimaryAngle[LEN_16]; //(0018,1530)
  479. char strDetectorSecondaryAngle[LEN_16]; //(0018,1531)
  480. char strColumnAngulation[LEN_16]; //(0018,1450)
  481. char strTableType[LEN_16]; //(0018,113A)
  482. char strTableAngle[LEN_16]; //(0018,1138)
  483. char strBodyPartThickness[LEN_16]; //(0018,11A0)
  484. char strCompressionForce[LEN_16]; //(0018,11A2)
  485. char strOrganExposed[LEN_16]; //(0040,0318)
  486. char strBreastImplantPresent[LEN_16]; //(0028,1300)
  487. tagModalityPositioningModule()
  488. {
  489. ZeroMemory(strPatientPosition, LEN_16);
  490. ZeroMemory(strViewPosition, LEN_16);
  491. ZeroMemory(strDistanceSourcetoPatient, LEN_16);
  492. ZeroMemory(strDistanceSourcetoDetector, LEN_16);
  493. ZeroMemory(strEstimatedRadiographicMagnificationFactor, LEN_16);
  494. ZeroMemory(strPositionerType, LEN_16);
  495. ZeroMemory(strPositionerPrimaryAngle, LEN_16);
  496. ZeroMemory(strPositionerSecondaryAngle, LEN_16);
  497. ZeroMemory(strDetectorPrimaryAngle, LEN_16);
  498. ZeroMemory(strDetectorSecondaryAngle, LEN_16);
  499. ZeroMemory(strColumnAngulation, LEN_16);
  500. ZeroMemory(strTableType, LEN_16);
  501. ZeroMemory(strTableAngle, LEN_16);
  502. ZeroMemory(strBodyPartThickness, LEN_16);
  503. ZeroMemory(strCompressionForce, LEN_16);
  504. ZeroMemory(strOrganExposed, LEN_16);
  505. ZeroMemory(strBreastImplantPresent, LEN_16);
  506. }
  507. tagModalityPositioningModule& operator=(const tagModalityPositioningModule& tmp)
  508. {
  509. strcpy_s(strPatientPosition, LEN_16, tmp.strPatientPosition);
  510. strcpy_s(strViewPosition, LEN_16, tmp.strViewPosition);
  511. strcpy_s(strDistanceSourcetoPatient, LEN_16, tmp.strDistanceSourcetoPatient);
  512. strcpy_s(strDistanceSourcetoDetector, LEN_16, tmp.strDistanceSourcetoDetector);
  513. strcpy_s(strEstimatedRadiographicMagnificationFactor, LEN_16, tmp.strEstimatedRadiographicMagnificationFactor);
  514. strcpy_s(strPositionerType, LEN_16, tmp.strPositionerType);
  515. strcpy_s(strPositionerPrimaryAngle, LEN_16, tmp.strPositionerPrimaryAngle);
  516. strcpy_s(strPositionerSecondaryAngle, LEN_16, tmp.strPositionerSecondaryAngle);
  517. strcpy_s(strDetectorPrimaryAngle, LEN_16, tmp.strDetectorPrimaryAngle);
  518. strcpy_s(strDetectorSecondaryAngle, LEN_16, tmp.strDetectorSecondaryAngle);
  519. strcpy_s(strColumnAngulation, LEN_16, tmp.strColumnAngulation);
  520. strcpy_s(strTableType, LEN_16, tmp.strTableType);
  521. strcpy_s(strTableAngle, LEN_16, tmp.strTableAngle);
  522. strcpy_s(strBodyPartThickness, LEN_16, tmp.strBodyPartThickness);
  523. strcpy_s(strCompressionForce, LEN_16, tmp.strCompressionForce);
  524. strcpy_s(strOrganExposed, LEN_16, tmp.strOrganExposed);
  525. strcpy_s(strBreastImplantPresent, LEN_16, tmp.strBreastImplantPresent);
  526. return *this;
  527. }
  528. }ModalityPositioningModule;
  529. //X-Ray Acquisition Dose Module
  530. #define XrayAcquisitionDoseModuleOffset (ModalityPositioningModuleOffset+ModalityPositioningModuleLength)
  531. typedef struct tagXrayAcquisitionDoseModule
  532. {
  533. char strKVP[LEN_16]; //(0018,0060)
  534. char strXRayTubeCurrent[LEN_12]; //(0018,1151)
  535. char strXRayTubeCurrentinuA[LEN_16]; //(0018,8151)
  536. char strExposureTime[LEN_12]; //(0018,1150)
  537. char strExposureTimeinuS[LEN_16]; //(0018,8150)
  538. char strExposure[LEN_12]; //(0018,1152)
  539. char strExposureinuAs[LEN_12]; //(0018,1153)
  540. char strImageAreaDoseProduct[LEN_16]; //(0018,115E)
  541. char strRelativeXRayExposure[LEN_12]; //(0018,1405)
  542. unsigned short nEntranceDose; //(0040,0302)
  543. char strEntranceDoseinmGy[LEN_16]; //(0040,8302)
  544. unsigned short nExposedArea; //(0040,0303)
  545. char strDistanceSourcetoEntrance[LEN_16]; //(0040,0306)
  546. char strXRayOutput[LEN_16]; //(0040,0312)
  547. char strHalfValueLayer[LEN_16]; //(0040,0314)
  548. char strOrganDose[LEN_16]; //(0040,0316)
  549. char strAnodeTargetMaterial[LEN_16]; //(0018,1191)
  550. char strRectificationType[LEN_16]; //(0018,1156)
  551. tagXrayAcquisitionDoseModule()
  552. {
  553. ZeroMemory(strKVP, LEN_16);
  554. ZeroMemory(strXRayTubeCurrent, LEN_12);
  555. ZeroMemory(strXRayTubeCurrentinuA, LEN_16);
  556. ZeroMemory(strExposureTime, LEN_12);
  557. ZeroMemory(strExposureTimeinuS, LEN_16);
  558. ZeroMemory(strExposure, LEN_12);
  559. ZeroMemory(strExposureinuAs, LEN_12);
  560. ZeroMemory(strImageAreaDoseProduct, LEN_16);
  561. ZeroMemory(strRelativeXRayExposure, LEN_12);
  562. nEntranceDose = 0;
  563. ZeroMemory(strEntranceDoseinmGy, LEN_16);
  564. nExposedArea = 0;
  565. ZeroMemory(strDistanceSourcetoEntrance, LEN_16);
  566. ZeroMemory(strXRayOutput, LEN_16);
  567. ZeroMemory(strHalfValueLayer, LEN_16);
  568. ZeroMemory(strOrganDose, LEN_16);
  569. ZeroMemory(strAnodeTargetMaterial, LEN_16);
  570. ZeroMemory(strRectificationType, LEN_16);
  571. }
  572. tagXrayAcquisitionDoseModule& operator=(const tagXrayAcquisitionDoseModule& txa)
  573. {
  574. strcpy_s(strKVP, LEN_16, txa.strKVP);
  575. strcpy_s(strXRayTubeCurrent, LEN_12, txa.strXRayTubeCurrent);
  576. strcpy_s(strXRayTubeCurrentinuA, LEN_16, txa.strXRayTubeCurrentinuA);
  577. strcpy_s(strExposureTime, LEN_12, txa.strExposureTime);
  578. strcpy_s(strExposureTimeinuS, LEN_16, txa.strExposureTimeinuS);
  579. strcpy_s(strExposure, LEN_12, txa.strExposure);
  580. strcpy_s(strExposureinuAs, LEN_12, txa.strExposureinuAs);
  581. strcpy_s(strImageAreaDoseProduct, LEN_16, txa.strImageAreaDoseProduct);
  582. strcpy_s(strRelativeXRayExposure, LEN_12, txa.strRelativeXRayExposure);
  583. nEntranceDose = txa.nEntranceDose;
  584. strcpy_s(strEntranceDoseinmGy, LEN_16, txa.strEntranceDoseinmGy);
  585. nExposedArea = txa.nExposedArea;
  586. strcpy_s(strDistanceSourcetoEntrance, LEN_16, txa.strDistanceSourcetoEntrance);
  587. strcpy_s(strXRayOutput, LEN_16, txa.strXRayOutput);
  588. strcpy_s(strHalfValueLayer, LEN_16, txa.strHalfValueLayer);
  589. strcpy_s(strOrganDose, LEN_16, txa.strOrganDose);
  590. strcpy_s(strAnodeTargetMaterial, LEN_16, txa.strAnodeTargetMaterial);
  591. strcpy_s(strRectificationType, LEN_16, txa.strRectificationType);
  592. return *this;
  593. }
  594. }XrayAcquisitionDoseModule;
  595. //X-Ray Tomography Acquisition Module
  596. #define XrayTomographyAcquisitionModuleOffset (XrayAcquisitionDoseModuleOffset+XrayAcquisitionDoseModuleLength)
  597. typedef struct tagXrayTomographyAcquisitionModule
  598. {
  599. char strTomoLayerHeight[LEN_16]; //(0018,1460)
  600. char strTomoAngle[LEN_16]; //(0018,1470)
  601. char strTomoTime[LEN_16]; //(0018,1480)
  602. char strTomoType[LEN_16]; //(0018,1490)
  603. char strTomoClass[LEN_16]; //(0018,1491)
  604. char strNumberofTomosynthesis[LEN_12]; //(0018,1495)
  605. tagXrayTomographyAcquisitionModule()
  606. {
  607. ZeroMemory(strTomoLayerHeight, LEN_16);
  608. ZeroMemory(strTomoAngle, LEN_16);
  609. ZeroMemory(strTomoTime, LEN_16);
  610. ZeroMemory(strTomoType, LEN_16);
  611. ZeroMemory(strTomoClass, LEN_16);
  612. ZeroMemory(strNumberofTomosynthesis, LEN_12);
  613. }
  614. tagXrayTomographyAcquisitionModule& operator=(const tagXrayTomographyAcquisitionModule& txta)
  615. {
  616. strcpy_s(strTomoLayerHeight, LEN_16, txta.strTomoLayerHeight);
  617. strcpy_s(strTomoAngle, LEN_16, txta.strTomoAngle);
  618. strcpy_s(strTomoTime, LEN_16, txta.strTomoTime);
  619. strcpy_s(strTomoType, LEN_16, txta.strTomoType);
  620. strcpy_s(strTomoClass, LEN_16, txta.strTomoClass);
  621. strcpy_s(strNumberofTomosynthesis, LEN_12, txta.strNumberofTomosynthesis);
  622. return *this;
  623. }
  624. }XrayTomographyAcquisitionModule;
  625. //Overlay plane module
  626. //UINT nOffset;
  627. typedef struct tagOverlayplaneModule
  628. {
  629. unsigned short nOverlayRows; //(60xx,0010)
  630. unsigned short nOverlayColumns; //(60xx,0011)
  631. char strOverlayType[LEN_16]; //(60xx,0040)
  632. signed short nOverlayOrigin; //(60xx,0050)
  633. unsigned short nOverlayBitsAllocated; //(60xx,0100)
  634. unsigned short nOverlayBitPosition; //(60xx,0102)
  635. char strROIArea[LEN_12]; //(60xx,1301)
  636. char strROIMean[LEN_16]; //(60xx,1302)
  637. char strROIStandardDeviation[LEN_16]; //(60xx,1303)
  638. tagOverlayplaneModule()
  639. {
  640. nOverlayRows = 0;
  641. nOverlayColumns = 0;
  642. ZeroMemory(strOverlayType, LEN_16);
  643. nOverlayOrigin = 0;
  644. nOverlayBitsAllocated = 0;
  645. nOverlayBitPosition = 0;
  646. ZeroMemory(strROIArea, LEN_12);
  647. ZeroMemory(strROIMean, LEN_16);
  648. ZeroMemory(strROIStandardDeviation, LEN_16);
  649. }
  650. tagOverlayplaneModule& operator=(const tagOverlayplaneModule& top)
  651. {
  652. nOverlayRows = top.nOverlayRows;
  653. nOverlayColumns = top.nOverlayColumns;
  654. strcpy_s(strOverlayType, LEN_16, top.strOverlayType);
  655. nOverlayOrigin = top.nOverlayOrigin;
  656. nOverlayBitsAllocated = top.nOverlayBitsAllocated;
  657. nOverlayBitPosition = top.nOverlayBitPosition;
  658. strcpy_s(strROIArea, LEN_12, top.strROIArea);
  659. strcpy_s(strROIMean, LEN_16, top.strROIMean);
  660. strcpy_s(strROIStandardDeviation, LEN_16, top.strROIStandardDeviation);
  661. return *this;
  662. }
  663. }OverlayplaneModule;
  664. typedef struct tagImageHeader
  665. {
  666. FileHeader stFileHeader;
  667. GeneralImageModule stGeneralImageModule;
  668. ImagePixelModule stImagePixelModule;
  669. ModalityImageModule stModalityImageModule;
  670. DisplayShutterModule stDisplayShutterModule;
  671. XrayGenerationModule stXrayGenerationModule;
  672. XrayGridModule stXrayGridModule;
  673. XrayCollimatorModule stXrayCollimatorModule;
  674. XrayFiltrationModule stXrayFiltrationModule;
  675. ModalityDetectorModule stModalityDetectorModule;
  676. XrayDetectorModule stXrayDetectorModule;
  677. ModalityPositioningModule stModalityPositioningModule;
  678. XrayAcquisitionDoseModule stXrayAcquisitionDoseModule;
  679. XrayTomographyAcquisitionModule stXrayTomographyAcquisitionModule;
  680. tagImageHeader& operator=(const tagImageHeader& tih)
  681. {
  682. stFileHeader = tih.stFileHeader;
  683. stGeneralImageModule = tih.stGeneralImageModule;
  684. stImagePixelModule = tih.stImagePixelModule;
  685. stModalityImageModule = tih.stModalityImageModule;
  686. stDisplayShutterModule = tih.stDisplayShutterModule;
  687. stXrayGenerationModule = tih.stXrayGenerationModule;
  688. stXrayGridModule = tih.stXrayGridModule;
  689. stXrayCollimatorModule = tih.stXrayCollimatorModule;
  690. stXrayFiltrationModule = tih.stXrayFiltrationModule;
  691. stModalityDetectorModule = tih.stModalityDetectorModule;
  692. stXrayDetectorModule = tih.stXrayDetectorModule;
  693. stModalityPositioningModule = tih.stModalityPositioningModule;
  694. stXrayAcquisitionDoseModule = tih.stXrayAcquisitionDoseModule;
  695. stXrayTomographyAcquisitionModule = tih.stXrayTomographyAcquisitionModule;
  696. return *this;
  697. }
  698. }IMAGE_HEADER;
  699. //===========================================================================================================
  700. #define GenInfoLength 256
  701. #define FpdInfoLength 256
  702. #define TomoInfoLength 256
  703. #define MaskInfoLength 128
  704. #define PositionInfoLength 256
  705. #define CollimatorInfoLength 128
  706. #define FrameHeaderOffset 0
  707. typedef struct tagFrameGenInfo
  708. {
  709. char strKVP[LEN_16]; //KV
  710. char strXRayTubeCurrent[LEN_16]; //MA
  711. char strExposureTime[LEN_16]; //MS
  712. char strMAS[LEN_16];
  713. char strAECDensity[LEN_16];
  714. char strAECFilm[LEN_16];
  715. char strAECField[LEN_16];
  716. char strTechMode[LEN_16];
  717. char strFocusSpot[LEN_16]; // Focus
  718. tagFrameGenInfo()
  719. {
  720. ZeroMemory(strKVP, LEN_16);
  721. ZeroMemory(strXRayTubeCurrent, LEN_16);
  722. ZeroMemory(strExposureTime, LEN_16);
  723. ZeroMemory(strMAS, LEN_16);
  724. ZeroMemory(strAECDensity, LEN_16);
  725. ZeroMemory(strAECFilm, LEN_16);
  726. ZeroMemory(strAECField, LEN_16);
  727. ZeroMemory(strTechMode, LEN_16);
  728. ZeroMemory(strFocusSpot, LEN_16);
  729. }
  730. tagFrameGenInfo& operator=(const tagFrameGenInfo& tgi)
  731. {
  732. strcpy_s(strKVP, LEN_16, tgi.strKVP);
  733. strcpy_s(strXRayTubeCurrent, LEN_16, tgi.strXRayTubeCurrent);
  734. strcpy_s(strExposureTime, LEN_16, tgi.strExposureTime);
  735. strcpy_s(strMAS, LEN_16, tgi.strMAS);
  736. strcpy_s(strAECDensity, LEN_16, tgi.strAECDensity);
  737. strcpy_s(strAECFilm, LEN_16, tgi.strAECFilm);
  738. strcpy_s(strAECField, LEN_16, tgi.strAECField);
  739. strcpy_s(strTechMode, LEN_16, tgi.strTechMode);
  740. strcpy_s(strFocusSpot, LEN_16, tgi.strFocusSpot);
  741. return *this;
  742. }
  743. }FrameGenInfo;
  744. #define FPDInfoOffset FrameHeaderOffset + GenInfoLength //256
  745. typedef struct tagFrameFPDInfo
  746. {
  747. unsigned short nImageWidth; // 非DICOM
  748. unsigned short nImageHeight; // 非DICOM
  749. unsigned short nImageBits; // 非DICOM
  750. float fImageCurrentUgy; //DICOM
  751. float fImageReferUgy;
  752. float fImageDI;
  753. float fFPDTemperature;
  754. tagFrameFPDInfo()
  755. {
  756. nImageWidth = 0;
  757. nImageHeight = 0;
  758. nImageBits = 0;
  759. fImageCurrentUgy = 0.0;
  760. fImageReferUgy = 0.0;
  761. fImageDI = 0.0;
  762. fFPDTemperature = 0.0;
  763. }
  764. tagFrameFPDInfo& operator= (const tagFrameFPDInfo& tfi)
  765. {//
  766. nImageWidth = tfi.nImageWidth;
  767. nImageHeight = tfi.nImageHeight;
  768. nImageBits = tfi.nImageBits;
  769. fImageCurrentUgy = tfi.fImageCurrentUgy;
  770. fImageReferUgy = tfi.fImageReferUgy;
  771. fImageDI = tfi.fImageDI;
  772. fFPDTemperature = tfi.fFPDTemperature;
  773. return *this;
  774. }
  775. }FrameFPDInfo;
  776. #define TomoInfoOffset FPDInfoOffset + FpdInfoLength // 512
  777. typedef struct tagFrameTomoInfo
  778. {
  779. char strTomoAngle[LEN_16]; //在曝光过程中,光源(球馆)扫过的角度 DICOM
  780. char strTomoTime[LEN_16]; //在曝光过程中,光源(球馆)旋转重用的时间,单位S DICOM
  781. tagFrameTomoInfo()
  782. {
  783. ZeroMemory(strTomoAngle, LEN_16);
  784. ZeroMemory(strTomoTime, LEN_16);
  785. }
  786. tagFrameTomoInfo& operator=(const tagFrameTomoInfo& txta)
  787. {
  788. strcpy_s(strTomoAngle, LEN_16, txta.strTomoAngle);
  789. strcpy_s(strTomoTime, LEN_16, txta.strTomoTime);
  790. return *this;
  791. }
  792. }FrameTomoInfo;
  793. #define ImageMaskInfoOffset TomoInfoOffset + TomoInfoLength // 768
  794. #define MASK_NODE_NUM 10
  795. typedef struct tagFrameMaskInfo //非DICOM
  796. {
  797. UINT nNodes; //输入遮光器类型0为矩形,1为原型,2为六边形;
  798. UINT nNodeX[MASK_NODE_NUM]; //左上角横坐标;
  799. UINT nNodeY[MASK_NODE_NUM]; //左上角纵坐标;
  800. tagFrameMaskInfo()
  801. {
  802. ZeroMemory(this,sizeof(tagFrameMaskInfo));
  803. }
  804. tagFrameMaskInfo& operator= (const tagFrameMaskInfo& tmi)
  805. {//
  806. memcpy(this,&tmi,sizeof(tagFrameMaskInfo) );
  807. return *this;
  808. }
  809. }FrameMaskInfo;
  810. #define PositionInfoOffset ImageMaskInfoOffset + MaskInfoLength // 896
  811. typedef struct tagPositionInfo // DICOM
  812. {
  813. char strDistanceSourcetoPatient[LEN_16]; //SOD Object
  814. char strDistanceSourcetoDetector[LEN_16]; //SID Imager
  815. char strPositionerPrimaryAngle[LEN_16]; //见DICOM
  816. char strPositionerSecondaryAngle[LEN_16]; //见DICOM
  817. char strDetectorPrimaryAngle[LEN_16]; //见DICOM
  818. char strDetectorSecondaryAngle[LEN_16]; //见DICOM
  819. char strCompressionForce[LEN_16]; //压迫器的压迫力度
  820. tagPositionInfo()
  821. {
  822. ZeroMemory(strDistanceSourcetoPatient, LEN_16);
  823. ZeroMemory(strDistanceSourcetoDetector, LEN_16);
  824. ZeroMemory(strPositionerPrimaryAngle, LEN_16);
  825. ZeroMemory(strPositionerSecondaryAngle, LEN_16);
  826. ZeroMemory(strDetectorPrimaryAngle, LEN_16);
  827. ZeroMemory(strDetectorSecondaryAngle, LEN_16);
  828. ZeroMemory(strCompressionForce, LEN_16);
  829. }
  830. tagPositionInfo& operator=(const tagPositionInfo& tmp)
  831. {
  832. strcpy_s(strDistanceSourcetoPatient, LEN_16, tmp.strDistanceSourcetoPatient);
  833. strcpy_s(strDistanceSourcetoDetector, LEN_16, tmp.strDistanceSourcetoDetector);
  834. strcpy_s(strPositionerPrimaryAngle, LEN_16, tmp.strPositionerPrimaryAngle);
  835. strcpy_s(strPositionerSecondaryAngle, LEN_16, tmp.strPositionerSecondaryAngle);
  836. strcpy_s(strDetectorPrimaryAngle, LEN_16, tmp.strDetectorPrimaryAngle);
  837. strcpy_s(strDetectorSecondaryAngle, LEN_16, tmp.strDetectorSecondaryAngle);
  838. strcpy_s(strCompressionForce, LEN_16, tmp.strCompressionForce);
  839. return *this;
  840. }
  841. }PositionInfo;
  842. #define CollimatorInfoOffset (PositionInfoOffset + PositionInfoLength)
  843. typedef struct tagCollimatorInfo
  844. {
  845. UINT nCollimatorShape;
  846. UINT nCollimatorLeftVerticalEdge;
  847. UINT nCollimatorRightVerticalEdge;
  848. UINT nCollimatorUpperHorizontalEdge;
  849. UINT nCollimatorLowerHorizontalEdge;
  850. UINT nCenterofCircularCollimator;
  851. UINT nRadiusofCircularCollimator;
  852. UINT nVerticesofthePolygonalCollimator;
  853. tagCollimatorInfo()
  854. {
  855. nCollimatorShape = 0;
  856. nCollimatorLeftVerticalEdge = 0;
  857. nCollimatorRightVerticalEdge = 0;
  858. nCollimatorUpperHorizontalEdge = 0;
  859. nCollimatorLowerHorizontalEdge = 0;
  860. nCenterofCircularCollimator = 0;
  861. nRadiusofCircularCollimator = 0;
  862. nVerticesofthePolygonalCollimator = 0;
  863. }
  864. tagCollimatorInfo& operator=(const tagCollimatorInfo& txc)
  865. {
  866. nCollimatorShape = txc.nCollimatorShape;
  867. nCollimatorLeftVerticalEdge = txc.nCollimatorLeftVerticalEdge;
  868. nCollimatorRightVerticalEdge = txc.nCollimatorRightVerticalEdge;
  869. nCollimatorUpperHorizontalEdge = txc.nCollimatorUpperHorizontalEdge;
  870. nCollimatorLowerHorizontalEdge = txc.nCollimatorLowerHorizontalEdge;
  871. nCenterofCircularCollimator = txc.nCenterofCircularCollimator;
  872. nRadiusofCircularCollimator = txc.nRadiusofCircularCollimator;
  873. nVerticesofthePolygonalCollimator = txc.nVerticesofthePolygonalCollimator;
  874. return *this;
  875. }
  876. }CollimatorInfo;
  877. #define OtherInfoOffset (CollimatorInfoOffset + CollimatorInfoLength)
  878. typedef struct tagOtherInfo
  879. {
  880. UINT nFrameID;
  881. float fBuckyRotateAngel;
  882. tagOtherInfo()
  883. {
  884. nFrameID = 0;
  885. fBuckyRotateAngel = 0;
  886. }
  887. tagOtherInfo& operator=(const tagOtherInfo& oih)
  888. {
  889. nFrameID = oih.nFrameID;
  890. fBuckyRotateAngel = oih.fBuckyRotateAngel;
  891. return *this;
  892. }
  893. }OtherInfo;
  894. typedef struct tagFrameHeader
  895. {
  896. FrameGenInfo stFrameGenInfo;
  897. FrameFPDInfo stFrameFPDInfo;
  898. FrameTomoInfo stFrameTomoInfo;
  899. FrameMaskInfo stFrameMaskInfo;
  900. PositionInfo stPositionInfo;
  901. CollimatorInfo stCollimatorInfo;
  902. OtherInfo stOtherInfo;
  903. tagFrameHeader()
  904. {
  905. }
  906. tagFrameHeader& operator=(const tagFrameHeader& tfh)
  907. {
  908. //
  909. stFrameGenInfo = tfh.stFrameGenInfo;
  910. stFrameFPDInfo = tfh.stFrameFPDInfo;
  911. stFrameTomoInfo = tfh.stFrameTomoInfo;
  912. stFrameMaskInfo = tfh.stFrameMaskInfo;
  913. stPositionInfo = tfh.stPositionInfo;
  914. stCollimatorInfo = tfh.stCollimatorInfo;
  915. stOtherInfo = tfh.stOtherInfo;
  916. return *this;
  917. }
  918. }FRAME_HEADER;
  919. typedef struct tagDeviceShareMemHeader
  920. {
  921. double dPixelSpacingX;
  922. double dPixelSpacingY;
  923. FRAME_HEADER stFrameInfo;
  924. tagDeviceShareMemHeader()
  925. {
  926. ZeroMemory(this, sizeof(tagDeviceShareMemHeader));
  927. }
  928. tagDeviceShareMemHeader& operator=(const tagDeviceShareMemHeader& tfh)
  929. {
  930. memcpy(this, &tfh, sizeof(tagDeviceShareMemHeader));
  931. return *this;
  932. }
  933. }DEVICESHAREMEM_HEADER;