1 #-----------------------------------------------------------------------------
2 # DICOM dictionary stuff
5 INSTALL_FILES(${GDCM_DATA_DIR} FILES
12 # Nice trick to avoid creating a .h file each time we compile gdcm
13 # Since CONFIGURE_FILE do a 'copy if different'
14 # We have to write the file here since is contains 'DICOM_DICTIONARY'
15 # Which is a variable afterward...
17 # Following code contributing by Andy Cedilnik (Kitware)
18 FILE(READ "dicomV3.dic" ENT)
19 STRING(REGEX REPLACE "\n" ";" ENT "${ENT}")
20 SET(DICOM_DATA_DICTIONARY "")
24 "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([A-Z?]+) (.*)$"
25 " { 0x\\1, 0x\\2, \"\\3\" , \"\\4\" , \"\\5\" }, " nline "${line}")
26 SET(DICOM_DATA_DICTIONARY "${DICOM_DATA_DICTIONARY}\n${nline}")
29 SET(DICOM_DATA_DICTIONARY "${DICOM_DATA_DICTIONARY} \n { 0,0,0,0,0 }")
31 FILE(READ "dicomTS.dic" ENT_TS)
32 STRING(REGEX REPLACE "\n" ";" ENT_TS "${ENT_TS}")
33 SET(DICOM_TS_DICTIONARY "")
35 FOREACH(line ${ENT_TS})
38 " ts[\"\\1\"] = \"\\2\"; " nline "${line}")
39 SET(DICOM_TS_DICTIONARY "${DICOM_TS_DICTIONARY}\n${nline}")
42 FILE(READ "dicomVR.dic" ENT_VR)
43 STRING(REGEX REPLACE ";" "/" ENT_VR "${ENT_VR}") # CMake doesn't like ';'
44 STRING(REGEX REPLACE "\n" ";" ENT_VR "${ENT_VR}")
45 SET(DICOM_VR_DICTIONARY "")
47 FOREACH(line ${ENT_VR})
49 "^([A-Z][A-Z]) (.*)/ +//.*$"
50 " vr[\"\\1\"] = \"\\2\"; " nline "${line}")
51 SET(DICOM_VR_DICTIONARY "${DICOM_VR_DICTIONARY}\n${nline}")
54 FILE(READ "DicomDir.dic" ENT_DIR)
55 STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ENT_DIR "${ENT_DIR}")
56 STRING(REGEX REPLACE ";" "/" ENT_DIR "${ENT_DIR}") # CMake doesn't like ';'
57 STRING(REGEX REPLACE "\n" ";" ENT_DIR "${ENT_DIR}")
58 SET(DICOM_DIR_DICTIONARY "")
60 FOREACH(line ${ENT_DIR})
62 "^(metaElem|patientElem|studyElem|serieElem|imageElem) *([a-f0-9]+) ([a-f0-9]+) [\"](.*)[\"](.*)$"
63 " { \"\\1\" , 0x\\2 , 0x\\3 , \"\\4\" }, \\5" nline "${line}")
64 SET(DICOM_DIR_DICTIONARY "${DICOM_DIR_DICTIONARY}\n${nline}")
67 SET(DICOM_DIR_DICTIONARY "${DICOM_DIR_DICTIONARY} \n { 0,0,0,0 }")
70 CONFIGURE_FILE("${GDCM_SOURCE_DIR}/src/gdcmDefaultDicts.cxx.in" "${GDCM_BINARY_DIR}/src/gdcmDefaultDicts.cxx" IMMEDIATE)
73 #FILE(READ "dicomV3VM2004.dic" ENT2)
74 #STRING(REGEX REPLACE "\n" ";" ENT2 "${ENT2}")
75 #SET(DICOM_DICTIONARY2 "")
77 #FOREACH(line ${ENT2})
78 # STRING(REGEX REPLACE
79 ## "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([A-Z]+) (.*)([ \(RET\)]*)$"
80 # "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([0-9]|[1]-[0-9n]|[2]-[2][n]|[3]-[3][n]) (.*)$"
81 ## " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\", \"\\6\"}," nline "${line}")
82 # " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\"}," nline "${line}")
83 # SET(DICOM_DICTIONARY2 "${DICOM_DICTIONARY2}\n${nline}")
88 ##FILE(READ "04_06PU.txt" ENT3)
89 #FILE(READ "extract.txt" ENT3)
91 #STRING(REGEX REPLACE "\n" ";" ENT3 "${ENT3}")
92 #SET(DICOM_DICTIONARY3 "")
94 #FOREACH(line ${ENT3})
95 # STRING(REGEX REPLACE
96 ## "^[(]([0-9a-fA-F]+),([0-9a-fA-F]+)[)] (.*) ([A-ZA-Z]*) ([[0-3][-][1-3n]*|[1-]*[0-9]+]*) ?([RET|Retired]*)$"
97 # "^[(]([0-9a-fA-F]+),([0-9a-fA-F]+)[)] +(.*) +([A-ZA-Z [[0-3][-][1-3n]*|[1-]*[0-9]+]]*)([ RET]*)$"
98 # " { \\1 , \\2, \\3, \\4, \\5 }," nline "${line}")
99 # STRING(COMPARE NOTEQUAL "${line}" "${nline}" add)
101 # #SET(DICOM_DICTIONARY3 "${DICOM_DICTIONARY3}\n${nline}")
102 # MESSAGE("${nline}")
104 # MESSAGE("WRONG:${nline}")
110 # ~/Software/xpdf-3.00-linux/pdftotext -f 9 -l 81 -raw -nopgbrk 04_06PU.PDF 04_06PU-3.txt