From 70e24c6c61481f9836e26b6b44a9670d92a4f43b Mon Sep 17 00:00:00 2001 From: frog Date: Thu, 17 Oct 2002 12:12:48 +0000 Subject: [PATCH] * Truckload of changes. Parsing of header is barely functional (see Test/test) with the standard dictionary (see Dicts/dicomV3.dic). --- ChangeLog | 4 + Dicts/dicomV3.dic | 1390 +++++++++++++++++++++++++++++++++++++++++ TODO | 5 +- Testing/.cvsignore | 1 + Testing/TestHash.cxx | 24 + src/.cvsignore | 1 + src/Makefile | 12 +- src/gdcmDict.cxx | 46 ++ src/gdcmDictEntry.cxx | 23 + src/gdcmDictSet.cxx | 36 ++ src/gdcmElValSet.cxx | 16 + src/gdcmElValue.cxx | 15 +- src/gdcmFile.cxx | 5 + src/gdcmHeader.cxx | 216 ++++--- src/gdcmUtil.cxx | 48 ++ src/gdcmUtil.h | 15 + src/gdcmlib.h | 119 ++-- 17 files changed, 1803 insertions(+), 173 deletions(-) create mode 100644 Dicts/dicomV3.dic create mode 100644 Testing/.cvsignore create mode 100644 Testing/TestHash.cxx create mode 100644 src/gdcmDict.cxx create mode 100644 src/gdcmDictEntry.cxx create mode 100644 src/gdcmDictSet.cxx create mode 100644 src/gdcmElValSet.cxx create mode 100644 src/gdcmFile.cxx create mode 100644 src/gdcmUtil.cxx create mode 100644 src/gdcmUtil.h diff --git a/ChangeLog b/ChangeLog index 50d0273c..e30a8c23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-10-7 Eric Boix + * Truckload of changes. Parsing of header is barely functional + (see Test/test) with the standard dictionary (see Dicts/dicomV3.dic). + 2002-10-10 Eric Boix * src/gdcmHeader.cxx many addons of low level methods diff --git a/Dicts/dicomV3.dic b/Dicts/dicomV3.dic new file mode 100644 index 00000000..e6c4cf58 --- /dev/null +++ b/Dicts/dicomV3.dic @@ -0,0 +1,1390 @@ +0000 0000 UL CMD Group Length +0000 0002 UI CMD Affected SOP Class UID +0000 0003 UI CMD Requested SOP Class UID +0000 0100 US CMD Command Field +0000 0110 US CMD Message ID +0000 0120 US CMD Message ID Responded to +0000 0600 AE CMD Move Destination +0000 0700 US CMD Priority +0000 0800 US CMD Data Set Type +0000 0900 US CMD Status +0000 0901 AT CMD Offending Element +0000 0902 LO CMD Error Comment +0000 0903 US CMD Error ID +0000 1001 UI CMD SOP Requested Instance UID +0000 1000 UI CMD SOP Affected Instance UID +0000 1002 US CMD Event Type ID +0000 1008 US CMD Action Type ID +0000 1020 US CMD Remaining Suboperations +0000 1021 US CMD Completed Suboperations +0000 1022 US CMD Failed Suboperations +0000 1023 US CMD Warning Suboperations +0000 1030 AE CMD AE Title +0000 1031 US CMD Message ID +0000 1005 AT CMD Attribute Identifier List +0002 0000 UL META Group Length +0002 0001 OB META File Meta Information Version +0002 0002 UI META Media Stored SOP Class UID +0002 0003 UI META Media Stored SOP Instance UID +0002 0010 UI META Transfer Syntax UID +0002 0012 UI META Implementation Class UID +0002 0013 SH META Implementation Version Name +0002 0016 AE META Source Application Entity Title +0002 0100 UI META Private Information Creator +0002 0102 OB META Private Information +0004 1130 CS DIR File-set ID +0004 1141 CS DIR File-set descriptor ID +0004 1142 CS DIR Specific character set +0004 1200 UL DIR Offset of the first dir of root dir entity +0004 1202 UL DIR Offset of the last dir of root dir entity +0004 1212 US DIR File-set consistency flag +0004 1220 SQ DIR Directory record sequence +0004 1400 UL DIR Offset of next directory record +0004 1410 US DIR Record in use flag +0004 1420 UL DIR Offset of referenced lower-level dir entity +0004 1430 CS DIR Directory Record Type +0004 1432 UI DIR Private Record UID +0004 1500 CS DIR Referenced File ID +0004 1504 UL DIR Directory Record Offset +0004 1510 UI DIR Referenced SOP Class UID in File +0004 1511 UI DIR Referenced SOP Instance UID in File +0004 1512 UI DIR Referenced Transfer Syntax in File +0004 1600 UL DIR Number of References +0008 0000 UL ID Group Length +0008 0001 UL ID Length to End (RET) +0008 0005 CS ID Specific Character Set +0008 0008 CS ID Image Type +0008 0010 RET ID Recognition Code (RET) +0008 0012 DA ID Instance Creation Date +0008 0013 TM ID Instance Creation Time +0008 0014 UI ID Instance Creator UID +0008 0016 UI ID SOP Class UID +0008 0018 UI ID SOP Instance UID +0008 0020 DA ID Study Date +0008 0021 DA ID Series Date +0008 0022 DA ID Acquisition Date +0008 0023 DA ID Image Date +0008 0024 DA ID Overlay Date +0008 0025 DA ID Curve Date +0008 0030 TM ID Study Time +0008 0031 TM ID Series Time +0008 0032 TM ID Acquisition Time +0008 0033 TM ID Image Time +0008 0034 TM ID Overlay Time +0008 0035 TM ID Curve Time +0008 0040 RET ID Data Set Type (RET) +0008 0041 RET ID Data Set Subtype (RET) +0008 0042 CS ID Nuc Med Series Type (RET) +0008 0050 SH ID Accession Number +0008 0052 CS ID Query Level +0008 0054 AE ID Retrieve AE Title +0008 0058 UI ID Failed SOP Instances +0008 0060 CS ID Modality +0008 0062 SQ ID Modality Subtype +0008 0064 CS ID Conversion Type +0008 0070 LO ID Manufacturer +0008 0080 LO ID Institution Name +0008 0081 ST ID Institution Address +0008 0082 SQ ID Institution Code Sequence +0008 0090 PN ID Referring Physician's Name +0008 0092 ST ID Referring Physician's Address +0008 0094 SH ID Referring Physician's Telephone +0008 0100 SH ID Code Value +0008 0102 SH ID Coding Scheme Designator +0008 0103 SH ID Coding Scheme Version +0008 0104 LO ID Code Meaning +0008 0105 CS ID Mapping Resource +0008 0106 DT ID Context Group Version +0008 010b CS ID Code Set Extension Flag +0008 010c UI ID Private Coding Scheme Creator UID +0008 010d UI ID Coding Scheme Creator UID +0008 010e SQ ID Mapping Resource Sequence +0008 010f CS ID Context Identifier +0008 1000 LO ID Network ID (RET) +0008 1010 SH ID Station Name +0008 1030 LO ID Study Description +0008 1032 SQ ID Procedure Code Sequence +0008 103e LO ID Series Description +0008 1040 LO ID Institutional Department Name +0008 1048 PN ID Physician of Record +0008 1050 PN ID Performing Physician's Name +0008 1060 PN ID Name of Physician(s) Reading Study +0008 1070 PN ID Operator's Name +0008 1080 LO ID Admitting Diagnoses Description +0008 1084 SQ ID Admitting Diagnosis Code Sequence +0008 1090 LO ID Manufacturer Model Name +0008 1100 SQ ID Referenced Results Sequence +0008 1110 SQ ID Referenced Study Sequence +0008 1111 SQ ID Referenced Study Component Sequence +0008 1115 SQ ID Referenced Series Sequence +0008 1120 SQ ID Referenced Patient Sequence +0008 1125 SQ ID Referenced Visit Sequence +0008 1130 SQ ID Referenced Overlay Sequence +0008 1140 SQ ID Referenced Image Sequence +0008 1145 SQ ID Referenced Curve Sequence +0008 1148 SQ ID Referenced Previous Waveform +0008 114a SQ ID Referenced Simultaneous Waveforms +0008 114c SQ ID Referenced Subsequent Waveform +0008 1150 UI ID Referenced SOP Class UID +0008 1155 UI ID Referenced SOP Instance UID +0008 1160 IS ID Referenced Frame Number +0008 1195 UI ID Transaction UID +0008 1197 US ID Failure Reason +0008 1198 SQ ID Failed SOP Sequence +0008 1199 SQ ID Referenced SOP Sequence +0008 2110 CS ID Lossy Image Compression (RET) +0008 2111 ST ID Derivation Description +0008 2112 SQ ID Source Image Sequence +0008 2120 SH ID Stage Name +0008 2122 IS ID Stage Number +0008 2124 IS ID Number of Stages +0008 2128 IS ID View Number +0008 2129 IS ID Number of Event Timers +0008 212a IS ID Number of Views in Stage +0008 2130 DS ID Event Elapsed Time(s) +0008 2132 LO ID Event Event Timer Name(s) +0008 2142 IS ID Start Trim +0008 2143 IS ID Stop Trim +0008 2144 IS ID Recommended Display Frame Rate +0008 2200 CS ID Transducer Position (RET) +0008 2204 CS ID Transducer Orientation (RET) +0008 2208 CS ID Anatomic Structure (RET) +0008 2218 SQ ID Anatomic Region of Interest Sequence +0008 2220 SQ ID Anatomic Region Modifier Sequence +0008 2228 SQ ID Primary Anatomic Structure Sequence +0008 2230 SQ ID Primary Anatomic Structure Modifier Sequence +0008 2240 SQ ID Transducer Position Sequence +0008 2242 SQ ID Transducer Position Modifer Sequence +0008 2244 SQ ID Transducer Orientation Sequence +0008 2246 SQ ID Transducer Orientation Modifer Sequence +0008 4000 RET ID Comments (RET) +0010 0000 UL PAT Group Length +0010 0010 PN PAT Patient Name +0010 0020 LO PAT Patient ID +0010 0021 LO PAT Issuer of Patient ID +0010 0030 DA PAT Patient Birthdate +0010 0032 TM PAT Patient Birth Time +0010 0040 CS PAT Patient Sex +0010 0050 SQ PAT Patient's Insurance Plan Code Sequence +0010 1000 LO PAT Other Patient IDs +0010 1001 PN PAT Other Patient Names +0010 1005 PN PAT Patient's Birth Name +0010 1010 AS PAT Patient Age +0010 1020 DS PAT Patient Size +0010 1030 DS PAT Patient Weight +0010 1040 LO PAT Patient Address +0010 1050 RET PAT Insurance Plan Identifier +0010 1060 PN PAT Patient's Mother's Birth Name +0010 1080 LO PAT Military Rank +0010 1081 LO PAT Branch of Service +0010 1090 LO PAT Medical Record Locator +0010 2000 LO PAT Medical Alerts +0010 2110 LO PAT Contrast Allergies +0010 2150 LO PAT Country of Residence +0010 2152 LO PAT Region of Residence +0010 2154 SH PAT Patient's Telephone Numbers +0010 2160 SH PAT Ethnic Group +0010 2180 SH PAT Occupation +0010 21a0 CS PAT Smoking Status +0010 21b0 LT PAT Additional Patient History +0010 21c0 US PAT Pregnancy Status +0010 21d0 DA PAT Last Menstrual Date +0010 21f0 LO PAT Religious Preference +0010 4000 LT PAT Comments +0018 0000 UL ACQ Group Length +0018 0010 LO ACQ Contrast/Bolus Agent +0018 0012 SQ ACQ Contrast/Bolus Agent Sequence +0018 0014 SQ ACQ Contrast/Bolus Administration Route Seq +0018 0015 CS ACQ Body Part Examined +0018 0020 CS ACQ Scanning Sequence +0018 0021 CS ACQ Sequence Variant +0018 0022 CS ACQ Scan Options +0018 0023 CS ACQ MR Acquisition Type +0018 0024 SH ACQ Sequence Name +0018 0025 CS ACQ Angio Flag +0018 0026 SQ ACQ Intervention Drug Information Sequence +0018 0027 TM ACQ Intervention Drug Stop Time +0018 0028 DS ACQ Intervention Drug Dose +0018 0029 SQ ACQ Intervention Drug Code Sequence +0018 002a SQ ACQ Additional Drug Sequence +0018 0030 LO ACQ Radionuclide (RET) +0018 0031 LO ACQ Radiopharmaceutical +0018 0032 DS ACQ Energy Window Centerline (RET) +0018 0033 DS ACQ Energy Window Total Width (RET) +0018 0034 LO ACQ Intervention Drug Name +0018 0035 TM ACQ Intervention Drug Start Time +0018 0036 SQ ACQ Interventional Therapy Sequence +0018 0037 CS ACQ Therapy type +0018 0038 CS ACQ Interventional status +0018 0039 CS ACQ Therapy descriptionm +0018 0040 IS ACQ Cine Rate +0018 0050 DS ACQ Slice Thickness +0018 0060 DS ACQ KVP +0018 0070 IS ACQ Counts Accumulated +0018 0071 CS ACQ Acquisition Termination Condition +0018 0072 DS ACQ Effective Series Duration +0018 0073 CS ACQ Start Condition +0018 0074 IS ACQ Start Condition Data +0018 0075 IS ACQ Termination Condition Data +0018 0080 DS ACQ Repetition Time +0018 0081 DS ACQ Echo Time +0018 0082 DS ACQ Inversion Time +0018 0083 DS ACQ Number of Averages +0018 0084 DS ACQ Imaging Frequency +0018 0085 SH ACQ Imaged Nucleus +0018 0086 IS ACQ Echo Number +0018 0087 DS ACQ Magnetic Field Strength +0018 0088 DS ACQ Spacing Between Slices +0018 0089 IS ACQ Number of Phase Encoding Steps +0018 0090 DS ACQ Data Collection Diameter +0018 0091 IS ACQ Echo Train Length +0018 0093 DS ACQ Percent Sampling +0018 0094 DS ACQ Percent Phase Field of View +0018 0095 DS ACQ Pixel Bandwidth +0018 1000 LO ACQ Device Serial Number +0018 1004 LO ACQ Plate ID +0018 1010 LO ACQ Secondary Capture Device ID +0018 1012 DA ACQ Date of Secondary Capture +0018 1014 TM ACQ Time of Secondary Capture +0018 1016 LO ACQ Secondary Capture Device Manufacturer +0018 1018 LO ACQ Secondary Capture Device Model Name +0018 1019 LO ACQ Secondary Capture Device Software Version +0018 1020 LO ACQ Software Version +0018 1022 SH ACQ Video Image Format Acquired +0018 1023 LO ACQ Digital Image Format Acquired +0018 1030 LO ACQ Protocol Name +0018 1040 LO ACQ Contrast/Bolus Route +0018 1041 DS ACQ Contrast/Bolus Volume +0018 1042 TM ACQ Contrast/Bolus Start Time +0018 1043 TM ACQ Contrast/Bolus Stop Time +0018 1044 DS ACQ Contrast/Bolus Total Dose +0018 1045 IS ACQ Syringe Counts +0018 1046 DS ACQ Contrast Flow Rate (ml/sec) +0018 1047 DS ACQ Contrast Flow Duration (sec) +0018 1048 CS ACQ Contrast Bolus Ingredient +0018 1049 DS ACQ Contrast Bolus Ingredient Concentration +0018 1050 DS ACQ Spatial Resolution +0018 1060 DS ACQ Trigger Time +0018 1061 LO ACQ Trigger Source or Type +0018 1062 IS ACQ Nominal Interval +0018 1063 DS ACQ Frame Time +0018 1064 LO ACQ Framing Type +0018 1065 DS ACQ Frame Time Vector +0018 1066 DS ACQ Frame Delay +0018 1067 DS ACQ Image Trigger Delay +0018 1068 DS ACQ Group Time Offset +0018 1069 DS ACQ Trigger Time Offset +0018 106a CS ACQ Synchronization Trigger +0018 106b UI ACQ Synchronization Frame of Reference +0018 106e UL ACQ Trigger Sample Position +0018 1070 LO ACQ Radiopharmaceutical Route +0018 1071 DS ACQ Radiopharmaceutical Volume +0018 1072 TM ACQ Radiopharmaceutical Start Time +0018 1073 TM ACQ Radiopharmaceutical Stop Time +0018 1074 DS ACQ Radionuclide Total Dose +0018 1075 DS ACQ Radionuclide Half Life +0018 1076 DS ACQ Radionuclide Positron Fraction +0018 1077 DS ACQ Radiopharmaceutical Specific Activity +0018 1080 CS ACQ Beat Rejection Flag +0018 1081 IS ACQ Low R-R Value +0018 1082 IS ACQ High R-R Value +0018 1083 IS ACQ Intervals Acquired +0018 1084 IS ACQ Intervals Rejected +0018 1085 LO ACQ PVC Rejection +0018 1086 IS ACQ Skip Beats +0018 1088 IS ACQ Heart Rate +0018 1090 IS ACQ Cardiac Number of Images +0018 1094 IS ACQ Trigger Window +0018 1100 DS ACQ Reconstruction Diameter +0018 1110 DS ACQ Distance Source-Detector +0018 1111 DS ACQ Distance Source-Patient +0018 1114 DS ACQ Estimated Radiographic Mag Factor +0018 1120 DS ACQ Gantry/Detector Tilt +0018 1121 DS ACQ Gantry/Detector Slew +0018 1130 DS ACQ Table Height +0018 1131 DS ACQ Table Traverse +0018 1134 CS ACQ Table Motion (STATIC DYNAMIC) +0018 1135 DS ACQ Table Vertical Increment (mm) +0018 1136 DS ACQ Table Lateral Increment (mm) +0018 1137 DS ACQ Table Longitudinal Increment (mm) +0018 1138 DS ACQ Table Angle (relative to horizontal: deg) +0018 1140 CS ACQ Rotation Direction +0018 1141 DS ACQ Angular Position +0018 1142 DS ACQ Radial Position +0018 1143 DS ACQ Scan Arc +0018 1144 DS ACQ Angular Step +0018 1145 DS ACQ Center of Rotation Offset +0018 1146 DS ACQ Rotation Offset (RET) +0018 1147 CS ACQ Field of View Shape +0018 1149 IS ACQ Field of View Dimension(s) +0018 1150 IS ACQ Exposure Time +0018 1151 IS ACQ X-ray Tube Current +0018 1152 IS ACQ Exposure +0018 1154 DS ACQ Average width of X-Ray pulse (ms) +0018 1155 CS ACQ General level of X-Ray dose exposure +0018 115a CS ACQ X-Ray radiation mode (CONTINUOUS PULSED) +0018 115e DS ACQ X-Ray dose to which patient was exposed +0018 1160 SH ACQ Filter Type extremity +0018 1161 LO ACQ Type of filter(s) inserted into X-Ray beam +0018 1162 DS ACQ Intensifier Size (mm) +0018 1164 DS ACQ Image Pixel Spacing +0018 1166 CS ACQ Grid (IN NONE) +0018 1170 IS ACQ Generator Power +0018 1180 SH ACQ Collimator/Grid Name +0018 1181 CS ACQ Collimator Type +0018 1182 IS ACQ Focal Distance +0018 1183 DS ACQ X Focus Center +0018 1184 DS ACQ Y Focus Center +0018 1190 DS ACQ Focal Spot +0018 1200 DA ACQ Date of Last Calibration +0018 1201 TM ACQ Time of Last Calibration +0018 1210 SH ACQ Convolution Kernel +0018 1240 RET ACQ Upper/Lower Pixel Values (RET) +0018 1242 IS ACQ Actual Frame Duration +0018 1243 IS ACQ Count Rate +0018 1244 US ACQ Preferred Playback Sequencing +0018 1250 SH ACQ Receiving Coil +0018 1251 SH ACQ Transmitting Coil +0018 1260 SH ACQ Plate Type +0018 1261 LO ACQ Phosphor Type +0018 1300 DS ACQ Scan Velocity +0018 1301 CS ACQ Whole Body Technique +0018 1302 IS ACQ Scan Length +0018 1310 US ACQ Acquisition Matrix +0018 1312 CS ACQ Phase Encoding Direction +0018 1314 DS ACQ Flip Angle +0018 1315 CS ACQ Variable Flip Angle +0018 1316 DS ACQ SAR +0018 1318 DS ACQ DB/DT +0018 1400 LO ACQ Acquisition Device Processing Description +0018 1401 LO ACQ Acquisition Device Processing Code +0018 1402 CS ACQ Cassette Orientation +0018 1403 CS ACQ Cassette Size +0018 1404 US ACQ Exposures on Plate +0018 1405 IS ACQ Relative X-ray Exposure +0018 1450 CS ACQ Column Angulation +0018 1460 DS ACQ Tomo Layer Height (mm) +0018 1470 DS ACQ Tomo Angle +0018 1480 DS ACQ Tomo Time +0018 1500 CS ACQ Positioner Motion +0018 1510 DS ACQ Positioner Primary Angle +0018 1511 DS ACQ Positioner Secondary Angle +0018 1520 DS ACQ Positioner Primary Angle Increment +0018 1521 DS ACQ Positioner Secondary Angle Increment +0018 1530 DS ACQ Detector Primary Angle +0018 1531 DS ACQ Detector Secondary Angle +0018 1600 CS ACQ Shutter Shape +0018 1602 IS ACQ Shutter Left Vertical Edge +0018 1604 IS ACQ Shutter Right Vertical Edge +0018 1606 IS ACQ Shutter Upper Horizontal Edge +0018 1608 IS ACQ Shutter Lower Horizontal Edge +0018 1610 IS ACQ Center of Circular Shutter +0018 1612 IS ACQ Radius of Circular Shutter +0018 1620 IS ACQ Vertices of the Polygonal Shutter +0018 1700 CS ACQ Collimator Shape +0018 1702 IS ACQ Collimator Left Vertical Edge +0018 1704 IS ACQ Collimator Right Vertical Edge +0018 1706 IS ACQ Collimator Upper Horizontal Edge +0018 1708 IS ACQ Collimator Lower Horizontal Edge +0018 1710 IS ACQ Center of Circular Collimator +0018 1712 IS ACQ Radius of Circular Collimator +0018 1720 IS ACQ Vertices of the Polygonal Collimator +0018 1800 CS ACQ Acquisition Time Synchronized +0018 1801 SH ACQ Time Source +0018 1802 CS ACQ Time Distribution Protocol +0018 4000 RET ACQ Comments +0018 5000 SH ACQ Output Power +0018 5010 LO ACQ Transducer Data +0018 5012 DS ACQ Focus Depth +0018 5020 LO ACQ Processing Function +0018 5021 LO ACQ Postprocessing Function +0018 5022 DS ACQ Mechanical Index +0018 5024 DS ACQ Thermal Index +0018 5026 DS ACQ Cranial Thermal Index +0018 5027 DS ACQ Soft Tissue Thermal Index +0018 5028 DS ACQ Soft Tissue-focus Thermal Index +0018 5029 CS ACQ Soft Tissue-surface Thermal Index +0018 5050 IS ACQ Depth of Scan Field +0018 5100 CS ACQ Patient Position +0018 5101 CS ACQ View Position +0018 5210 DS ACQ Image Transformation Matrix +0018 5212 DS ACQ Image Translation Vector +0018 6000 DS ACQ Sensitivity +0018 6011 SQ ACQ Ultrasound Region Sequence +0018 6012 US ACQ Region Spatial Format +0018 6014 US ACQ Region Data Type +0018 6016 UL ACQ Region Flags +0018 6018 UL ACQ Region Location Min X(0) +0018 601a UL ACQ Region Location Min Y(0) +0018 601c UL ACQ Region Location Max X(1) +0018 601e UL ACQ Region Location Max Y(1) +0018 6020 SL ACQ Reference Pixel X +0018 6022 SL ACQ Reference Pixel Y +0018 6024 US ACQ Physical Units X Direction +0018 6026 US ACQ Physical Units Y Direction +0018 6028 FD ACQ Reference Pixel Physical Value X +0018 602a FD ACQ Reference Pixel Physical Value Y +0018 602c FD ACQ Physical Delta X +0018 602e FD ACQ Physical Delta Y +0018 6030 UL ACQ Transducer Frequency +0018 6031 CS ACQ Transducer Type +0018 6032 UL ACQ Pulse Repetition Frequency +0018 6034 FD ACQ Doppler Correction Angle +0018 6036 FD ACQ Sterring Angle +0018 6038 UL ACQ Doppler Sample Volume X Position +0018 603a UL ACQ Doppler Sample Volume Y Position +0018 603c UL ACQ TM-Line Position X(0) +0018 603e UL ACQ TM-Line Position Y(0) +0018 6040 UL ACQ TM-Line Position X(1) +0018 6042 UL ACQ TM-Line Position Y(1) +0018 6044 US ACQ Pixel Component Organization +0018 6046 UL ACQ Pixel Component Mask +0018 6048 UL ACQ Pixel Component Range Start +0018 604a UL ACQ Pixel Component Range Stop +0018 604c US ACQ Pixel Component Physical Units +0018 604e US ACQ Pixel Component Data Type +0018 6050 UL ACQ Number of Table Break Points +0018 6052 UL ACQ Table of X Break Points +0018 6054 FD ACQ Table of Y Break Points +0018 6056 UL ACQ Number of Table Entries +0018 6058 UL ACQ Table of Pixel Values +0018 605a FL ACQ Table of Parameter Values +0020 0000 UL REL Group Length +0020 000d UI REL Study Instance UID +0020 000e UI REL Series Instance UID +0020 0010 SH REL Study ID +0020 0011 IS REL Series Number +0020 0012 IS REL Acquisition Number +0020 0013 IS REL Image Number +0020 0014 IS REL Isotope Number (RET) +0020 0015 IS REL Phase Number (RET) +0020 0016 IS REL Interval Number (RET) +0020 0017 IS REL Time Slot Number (RET) +0020 0018 IS REL Angle Number (RET) +0020 0020 CS REL Patient Orientation +0020 0022 IS REL Overlay Number +0020 0024 IS REL Curve Number +0020 0026 IS REL Lookup Table Number +0020 0030 RET REL Image Position (RET) +0020 0032 DS REL Image Position Patient +0020 0035 RET REL Image Orientation +0020 0037 DS REL Image Orientation (Patient) +0020 0050 RET REL Location (RET) +0020 0052 UI REL Frame of Reference UID +0020 0060 CS REL Laterality +0020 0070 RET REL Image Geometry Type (RET) +0020 0080 RET REL Masking Image (RET) +0020 0100 IS REL Temporal Position Identifier +0020 0105 IS REL Number of Temporal Positions +0020 0110 DS REL Temporal Resolution +0020 1000 IS REL Series in Study +0020 1001 RET REL Acquisitions in Series +0020 1002 IS REL Images in Acquisition +0020 1004 IS REL Acquisitions in Study +0020 1020 RET REL Reference (RET) +0020 1040 LO REL Position Reference Indicator +0020 1041 DS REL Slice Location +0020 1070 IS REL Other Study Numbers +0020 1200 IS REL Number of Patient Related Studies +0020 1202 IS REL Number of Patient Related Series +0020 1204 IS REL Number of Patient Related Images +0020 1206 IS REL Number of Study Related Series +0020 1208 IS REL Number of Study Related Images +0020 3100 RET REL Source Image IDs (RET) +0020 3401 RET REL Modifying Device ID (RET) +0020 3402 RET REL Modified Image ID (RET) +0020 3403 RET REL Modified Image Date (RET) +0020 3404 RET REL Modifying Device Mfr (RET) +0020 3405 RET REL Modified Image Time +0020 3406 RET REL Modified Image Description (RET) +0020 4000 LT REL Image Comments +0020 5000 RET REL Original Image ID (RET) +0020 5002 RET REL Orig Image ID Nomenclature (RET) +0028 0000 UL IMG Group Length +0028 0002 US IMG Samples Per Pixel +0028 0004 CS IMG Photometric Interpretation +0028 0005 RET IMG Image Dimensions (RET) +0028 0006 US IMG Planar Configuration +0028 0008 IS IMG Number of Frames +0028 0009 AT IMG Frame Increment Pointer +0028 0010 US IMG Rows +0028 0011 US IMG Columns +0028 0012 US IMG Planes +0028 0012 US IMG Instants (special LibIDO) +0028 0014 US IMG Ultrasound Color Data Present +0028 0015 US IMG UsedNbX ACR Libido special +0028 0016 US IMG UsedNbY ACR Libido special +0028 0017 US IMG UsedNbZ ACR Libido special +0028 0018 US IMG UsedNbT ACR Libido special +0028 0030 DS IMG Pixel Spacing +0028 0031 DS IMG Zoom Factor +0028 0032 DS IMG Zoom Center +0028 0034 IS IMG Pixel Aspect Ratio +0028 0040 RET IMG Image Format (RET) +0028 0050 RET IMG Manipulated Image (RET) +0028 0051 CS IMG Corrected Image +0028 0060 RET IMG Compression Code +0028 0100 US IMG Bits Allocated +0028 0101 US IMG Bits Stored +0028 0102 US IMG High Bit +0028 0103 US IMG Pixel Representation +0028 0104 RET IMG Smallest Pixel Value (RET) +0028 0105 RET IMG Largest Pixel Value (RET) +0028 0106 CTX IMG Smallest Image Pixel Value +0028 0107 CTX IMG Largest Image Pixel Value +0028 0108 CTX IMG Smallest Pixel Value in Series +0028 0109 CTX IMG Largest Pixel Value in Series +0028 0110 CTX IMG Smallest Pixel Value in Plane +0028 0111 CTX IMG Largest Pixel Value in Plane +0028 0120 CTX IMG Pixel Padding Value +0028 0122 CTX IMG Waveform Padding Value +0028 0199 US IMG LibIDO code +0028 0200 RET IMG Image Location +0028 1040 CS IMG Pixel Intensity Relationship +0028 1050 DS IMG Window Center +0028 1051 DS IMG Window Width +0028 1052 DS IMG Rescale Intercept +0028 1053 DS IMG Rescale Slope +0028 1054 LO IMG Rescale Type +0028 1055 LO IMG Window Center & Width Explanation +0028 1080 RET IMG Gray Scale (RET) +0028 1090 CS IMG Recommended Viewing Mode +0028 1100 RET IMG Lookup Table Desc-Gray (RET) +0028 1101 US IMG Lookup Table Desc-Red +0028 1102 US IMG Lookup Table Desc-Green +0028 1103 US IMG Lookup Table Desc-Blue +0028 1199 UI IMG Palette Color Lookup Table UID +0028 1200 RET IMG Lookup Data-Gray +0028 1201 CTX IMG Lookup Data-Red +0028 1202 CTX IMG Lookup Data-Green +0028 1203 CTX IMG Lookup Data-Blue +0028 1221 OW IMG Segmented Red Palette Color LUT Data +0028 1222 OW IMG Segmented Green Palette Color LUT Data +0028 1223 OW IMG Segmented Blue Palette Color LUT Data +0028 2110 CS IMG Lossy Image Compression +0028 3000 SQ IMG Modality LUT Sequence +0028 3002 CTX IMG LUT Descriptor +0028 3003 LO IMG LUT Explanation +0028 3004 LO IMG Modality LUT Type +0028 3006 CTX IMG LUT Data +0028 3010 SQ IMG VOI LUT Sequence +0028 4000 RET IMG Comments (RET) +0028 5000 SQ IMG Bi-Plane Acquisition Sequence +0028 6010 US IMG Representative Frame Number +0028 6020 US IMG Frame Numbers of Interest +0028 6022 LO IMG Frame of Interest Description +0028 6030 US IMG Mask Pointer(s) +0028 6040 US IMG R Wave Pointer +0028 6100 SQ IMG Mask Subtraction Sequence +0028 6101 CS IMG Mask Operation +0028 6102 US IMG Applicable Frame Range +0028 6110 US IMG Mask Frame Numbers +0028 6112 US IMG Contrast Frame Averaging +0028 6114 FL IMG Mask Sub-pixel shift +0028 6120 SS IMG TID Offset +0028 6190 ST IMG Mask Operation Explanation +0032 0000 UL SDY Study Group length +0032 000a CS SDY Study Status ID +0032 000c CS SDY Study Priority ID +0032 0012 LO SDY Study ID Issuer +0032 0032 DA SDY Study Verified Date +0032 0033 TM SDY Study Verified Time +0032 0034 DA SDY Study Read Date +0032 0035 TM SDY Study Read Time +0032 1000 DA SDY Scheduled Study Start Date +0032 1001 TM SDY Scheduled Study Start Time +0032 1010 DA SDY Scheduled Study Stop Date +0032 1011 TM SDY Scheduled Study Stop Time +0032 1020 LO SDY Scheduled Study Location +0032 1021 AE SDY Scheduled Study Location AE Title(s) +0032 1030 LO SDY Study Reason +0032 1032 PN SDY Requesting Physician +0032 1033 LO SDY Requesting Service +0032 1040 DA SDY Study Arrival Date +0032 1041 TM SDY Study Arrival Time +0032 1050 DA SDY Study Completion Date +0032 1051 TM SDY Study Completion Time +0032 1055 CS SDY Study Component Status ID +0032 1060 LO SDY Requested Procedure Description +0032 1064 SQ SDY Requested Procedure Code +0032 1070 LO SDY Requested Contrast Agent +0032 4000 LT SDY Comments +0038 0000 UL VIS Group Length +0038 0004 SQ VIS Referenced Patient Alias Sequence +0038 0008 CS VIS Visit Status ID +0038 0010 LO VIS Admission ID +0038 0011 LO VIS Issuer of Admission ID +0038 0016 LO VIS Route of Admission +0038 001a DA VIS Scheduled Admission Date +0038 001b TM VIS Scheduled Admission Time +0038 001c DA VIS Scheduled Discharge Date +0038 001d TM VIS Scheduled Discharge Time +0038 001e LO VIS Scheduled Patient Institution Residence +0038 0020 DA VIS Admitting Date +0038 0021 TM VIS Admitting Time +0038 0030 DA VIS Discharge Date +0038 0032 TM VIS Discharge Time +0038 0040 LO VIS Discharge Diagnosis Description +0038 0044 SQ VIS Discharge Diagnosis Code Sequence +0038 0050 LO VIS Special Needs +0038 0300 LO VIS Current Patient Location +0038 0400 LO VIS Patient's Institution Residence +0038 0500 LO VIS Patient State +0038 4000 LT VIS Comments +003a 0000 UL WAV Group Length +003a 0002 SQ WAV Waveform Sequence +003a 0005 US WAV Number of Channels +003a 0010 UL WAV Number of Samples +003a 001a DS WAV Sampling Frequency +003a 0020 SH WAV Group Label +003a 0103 CS WAV Data Value Representation +003a 0200 SQ WAV Channel Definition +003a 0202 IS WAV Channel Number +003a 0203 SH WAV Channel Label +003a 0205 CS WAV Channel Status +003a 0208 SQ WAV Waveform Source +003a 0209 SQ WAV Waveform Source Modifiers +003a 020a SQ WAV Differential Waveform Source +003a 020b SQ WAV Differential Waveform Source Modifiers +003a 0210 DS WAV Channel Sensitivity +003a 0211 SQ WAV Channel Sensitivity Units +003a 0212 DS WAV Channel Sensitivity Correction Factor +003a 0213 DS WAV Channel Baseline +003a 0214 DS WAV Channel Time Skew +003a 0215 DS WAV Channel Sample Skew +003a 0218 DS WAV Channel Offset +003a 021a US WAV Bits Per Sample +003a 0216 CTX WAV Channel Minimum Value +003a 0217 CTX WAV Channel Maximum Value +003a 0220 DS WAV Filter Low Frequency +003a 0221 DS WAV Filter High Frequency +003a 0222 DS WAV Notch Filter Frequency +003a 0223 DS WAV Notch Filter Bandwidth +003a 1000 CTX WAV Waveform Data +0040 0000 UL PRC Group Length +0040 0001 AE PRC Scheduled Station AE Title +0040 0002 DA PRC Scheduled Procedure Step Start Date +0040 0003 TM PRC Scheduled Procedure Step Start Time +0040 0004 DA PRC Scheduled Procedure Step End Date +0040 0005 TM PRC Scheduled Procedure Step End Time +0040 0006 PN PRC Scheduled Performing Physician's Name +0040 0007 LO PRC Scheduled Step Description +0040 0008 SQ PRC Scheduled Action Item Code Sequence +0040 0009 SH PRC Scheduled Step ID +0040 0010 SH PRC Scheduled Station Name +0040 0011 SH PRC Scheduled Procedure Step Location +0040 0012 LO PRC Pre-Medication +0040 0020 CS PRC Schedule Procedure Step Status +0040 0100 SQ PRC Scheduled Procedure Step Sequence +0040 0220 SQ PRC Referenced Standalone SOP Instance Sequence +0040 0241 AE PRC Performed Station AE Title +0040 0242 SH PRC Performed Station Name +0040 0243 SH PRC Performed Location +0040 0244 DA PRC Performed Procedure Step Start Date +0040 0245 TM PRC Performed Procedure Step Start Time +0040 0250 DA PRC Performed Procedure Step End Date +0040 0251 TM PRC Performed Procedure Step End Time +0040 0252 CS PRC Performed Procedure Step Status +0040 0253 SH PRC Performed Procedure Step ID +0040 0254 LO PRC Performed Procedure Step Description +0040 0255 LO PRC Performed Procedure Type Description +0040 0260 SQ PRC Performed Protocol Code Sequence +0040 0270 SQ PRC Scheduled Step Attributes Sequence +0040 0275 SQ PRC Requested Attributes Sequence +0040 0280 ST PRC Comments on the Performed Procedure Step +0040 0293 SQ PRC Quantity Sequence +0040 0294 DS PRC Quantity +0040 0295 SQ PRC Measuring Units Sequence +0040 0296 SQ PRC Billing Item Sequence +0040 0300 US PRC Total Time of Fluoroscopy} +0040 0301 US PRC Total Number of Exposures +0040 0302 US PRC Entrance Dose +0040 0303 US PRC Exposed Area +0040 0306 DS PRC Distance Source to Entrance +0040 0307 DS PRC Distance Source to Support +0040 0310 ST PRC Comments on Radiation Dose +0040 0312 DS PRC X-Ray Output +0040 0314 DS PRC Half Value Layer +0040 0316 DS PRC Organ Dose +0040 0318 CS PRC Organ Exposed +0040 0320 SQ PRC Biling Procedure Step Sequence +0040 0321 SQ PRC Film Consumption Sequence +0040 0324 SQ PRC Biling Supplies and Devices Sequence +0040 0330 SQ PRC Referenced Procedure Step Sequence +0040 0340 SQ PRC Performed Series Sequence +0040 0400 LT PRC Comments on the Scheduled Procedure Step +0040 050a LO PRC Specimen Accession Number +0040 0550 SQ PRC Specimen Sequence +0040 0551 LO PRC Specimen Identifier +0040 0552 SQ PRC Specimen Description Sequence +0040 0553 ST PRC Specimen Description +0040 0555 SQ PRC Acquisition Context Sequence +0040 0556 ST PRC Acquisition Context Description +0040 059a SQ PRC Specimen Type Code Sequence +0040 06fa LO PRC Slide Identifier +0040 071a SQ PRC Image Center Point Coordinates Sequence +0040 072a DS PRC X offset in Slide Coordinate System +0040 073a DS PRC Y offset in Slide Coordinate System +0040 074a DS PRC Z offset in Slide Coordinate System +0040 08d8 SQ PRC Pixel Spacing Sequence +0040 08da SQ PRC Coordinate System Axis Code Sequence +0040 08ea SQ PRC Measurement Units Code Sequence +0040 09f8 SQ PRC Vital Stain Code Sequence +0040 1001 SH PRC Requested Procedure ID +0040 1002 LO PRC Reason for the Requested Procedure +0040 1003 SH PRC Requested Procedure Priority +0040 1004 LO PRC Patient Transport Arrangements +0040 1005 LO PRC Requested Procedure Location +0040 1006 SH PRC Placer Order Number / Procedure +0040 1007 SH PRC Filler Order Number / Procedure +0040 1008 LO PRC Confidentiality Code +0040 1009 SH PRC Reporting Priority +0040 1010 PN PRC Names of Intended Recipients of Results +0040 1400 LT PRC Requested Procedure Comments +0040 2001 LO PRC Reason for teh Imaging Service Request +0040 2004 DA PRC Issue Date of Imaging Service Request +0040 2005 TM PRC Issue Time of Imaging Service Request +0040 2006 SH PRC Placer Order Number/Imaging Service Request +0040 2007 SH PRC Filler Order Number/Imaging Service Request +0040 2008 PN PRC Order Entered By +0040 2009 SH PRC Order Enterer's Location +0040 2010 SH PRC Order Callback Phone Number +0040 2400 LT PRC Imaging Service Request Comments +0040 3001 LO PRC Confidentiality Constraint Patient Data Description +0040 4001 SQ PRC General Purpose Scheduled Procedure Step Status +0040 4002 SQ PRC General Purpose Performed Procedure Step Status +0040 4003 SQ PRC General Purpose Performed Procedure Step Priority +0040 4004 SQ PRC Scheduled Processing Applications Code Sequence +0040 4005 SQ PRC Scheduled Procedure Step Start Date and Time +0040 4006 SQ PRC Concept-name Code Sequence +0040 4007 SQ PRC Concept-name Code Sequence +0040 4009 SQ PRC Concept-name Code Sequence +0040 4011 SQ PRC Concept-name Code Sequence +0040 4015 SQ PRC Concept-name Code Sequence +0040 4016 SQ PRC Concept-name Code Sequence +0040 4018 SQ PRC Concept-name Code Sequence +0040 4019 SQ PRC Concept-name Code Sequence +0040 4020 SQ PRC Concept-name Code Sequence +0040 4021 SQ PRC Concept-name Code Sequence +0040 4022 SQ PRC Concept-name Code Sequence +0040 4023 SQ PRC Concept-name Code Sequence +0040 4025 SQ PRC Scheduled Station Name Code Sequence +0040 4026 SQ PRC Scheduled Station Class Code Sequence +0040 4027 SQ PRC Scheduled Station Geographic Location Code Sequence +0040 4028 SQ PRC Performed Station Name Code Sequence +0040 4029 SQ PRC Performed Station Class Code Sequence +0040 4030 SQ PRC Performed Station Geographic Location Code Sequence +0040 4031 SQ PRC Requested Subsequent Workitem Code Sequence +0040 4032 SQ PRC Non-DICOM Output Code Sequence +0040 4033 SQ PRC Output Information Sequence +0040 4035 SQ PRC Actual Human Performers Sequence +0040 4036 LO PRC Human Performer's Organization +0040 4037 PN PRC Human Performer's Name +0040 8302 DS PRC Entrance Dose in mGy +0040 a010 CS PRC Relationship Type +0040 a027 LO PRC Verifying Organization +0040 a030 DT PRC Verification DateTime +0040 a032 DT PRC Observation DateTime +0040 a040 CS PRC Value Type +0040 a043 SQ PRC Concept-name Code Sequence +0040 a050 SQ PRC Continuity of Content +0040 a073 SQ PRC Verifying Observer Sequence +0040 a075 PN PRC Verifying Observer Name +0040 a088 SQ PRC Verifying Observer Identification Code Sequence +0040 a0b0 US PRC Referenced Waveform Channels +0040 a121 DA PRC Date +0040 a122 TM PRC Time +0040 a123 PN PRC Person Name +0040 a130 CS PRC Temporal Range Type +0040 a132 UL PRC Referenced Sample Offsets +0040 a138 DS PRC Referenced Time Offsets +0040 a13a DT PRC Referenced Datetime +0040 a168 SQ PRC Concept Code Sequence +0040 a16a ST PRC Bibliographics Citation +0040 a180 US PRC Annotation Group Number +0040 a195 SQ PRC Concept-name Code Sequence Modifier +0040 a30a DS PRC Numeric Value +0040 a353 ST PRC Address +0040 a354 LO PRC Telephone Number +0040 a992 ST PRC Uniform Resource Locator +0040 b020 SQ PRC Annotation Sequence +0050 0004 CS DEV Calibration Object +0050 0010 SQ DEV Device Sequence +0050 0014 DS DEV Device Length +0050 0016 DS DEV Device Diameter +0050 0017 CS DEV Device Diameter Units +0050 0018 DS DEV Device Volume +0050 0019 DS DEV Inter-Marker Distance +0050 0020 LO DEV Device Description +0054 0000 UL NMI Group Length +0054 0010 US NMI Energy Window Vector +0054 0011 US NMI Number of Energy Windows +0054 0012 SQ NMI Energy Window Information Sequence +0054 0013 SQ NMI Energy Window Range Sequence +0054 0014 DS NMI Energy Window Lower Limit +0054 0015 DS NMI Energy Window Upper Limit +0054 0016 SQ NMI Radiopharmaceutical Information Sequence +0054 0017 IS NMI Residual Syringe Counts +0054 0018 SH NMI Energy Window Name +0054 0020 US NMI Detector Vector +0054 0021 US NMI Number of Detectors +0054 0022 SQ NMI Detector Information Sequence +0054 0030 US NMI Phase Vector +0054 0031 US NMI Number of Phases +0054 0032 SQ NMI Phase Information Sequence +0054 0033 US NMI Number of Frames in Phase +0054 0036 IS NMI Phase Delay +0054 0038 IS NMI Pause between Frames +0054 0050 US NMI Rotation Vector +0054 0051 US NMI Number of rotations +0054 0052 SQ NMI Rotation Information Sequence +0054 0053 US NMI Number of frames in rotation +0054 0060 US NMI R-R Interval Vector +0054 0061 US NMI Number of R-R Intervals +0054 0062 SQ NMI Gated Information Sequence +0054 0063 SQ NMI Data Information Sequence +0054 0070 US NMI Time Slot Vector +0054 0071 US NMI Number of Time Slots +0054 0072 SQ NMI Time Slot Information Sequence +0054 0073 DS NMI Time Slot Time +0054 0080 US NMI Slice Vector +0054 0081 US NMI Number of Slices +0054 0090 US NMI Angular View Vector +0054 0100 US NMI Time Slice Vector +0054 0101 US NMI Number of Time Slices +0054 0200 DS NMI Start Angle +0054 0202 CS NMI Type of Detector Motion +0054 0210 IS NMI Trigger Vector +0054 0211 US NMI Number of Triggers in Phase +0054 0220 SQ NMI View Code Sequence +0054 0222 SQ NMI View Angulation Modifer Code Sequence +0054 0300 SQ NMI Radionuclide Code Sequence +0054 0302 SQ NMI Radiopharmaceutical Route Code Sequence +0054 0304 SQ NMI Radiopahrmaceutical Code Sequence +0054 0306 SQ NMI Calibration Data Sequence +0054 0308 US NMI Energy Window Number +0054 0400 SH NMI Image ID +0054 0410 SQ NMI Patient Orientation Code Sequence +0054 0412 SQ NMI Patient Orientation Modifier Code Sequence +0054 0414 SQ NMI Patient Gantry Relationship Code Sequence +0054 1000 CS NMI Series Type +0054 1001 CS NMI Units +0054 1002 CS NMI Counts Source +0054 1004 CS NMI Reprojection Method +0054 1100 CS NMI Randoms Correction Method +0054 1101 LO NMI Attenuation Correction Method +0054 1102 CS NMI Decay Correction +0054 1103 LO NMI Reconstruction Method +0054 1104 LO NMI Detector Lines of Response Used +0054 1105 LO NMI Scatter Correction Method +0054 1200 DS NMI Axial Acceptance +0054 1201 IS NMI Axial Mash +0054 1202 IS NMI Transverse Mash +0054 1203 DS NMI Detector Element Size +0054 1210 DS NMI Coincidence Window Width +0054 1220 CS NMI Secondary Counts Type +0054 1300 DS NMI Frame Reference Time +0054 1310 IS NMI Primary (Prompts) Counts Accumulated +0054 1311 IS NMI Secondary Counts Accumulated +0054 1320 DS NMI Slice Sensitivity Factor +0054 1321 DS NMI Decay Factor +0054 1322 DS NMI Dose Calibration Factor +0054 1323 DS NMI Scatter Fraction Factor +0054 1324 DS NMI Dead Time Factor +0054 1330 US NMI Image Index +0054 1400 CS NMI Counts Included +0054 1401 CS NMI Dead Time Correction Flag +0088 0000 UL MED Media Group Length +0088 0130 SH MED Storage Media File-set ID +0088 0140 UI MED Storage Media File-setUID +0088 0200 SQ MED Icon Image Sequence +0088 0904 LO MED Topic Title +0088 0906 ST MED Topic Subject +0088 0910 LO MED Topic Author +0088 0912 LO MED Topic Keywords +2000 0000 UL BFS Group Length +2000 0010 IS BFS Number of copies printed for each film +2000 0020 CS BFS Specifies priority of print job +2000 0030 CS BFS Medium on which page will be printed +2000 0040 CS BFS Film destination +2000 0050 LO BFS Human readable label to identify film +2000 0060 IS BFS Amount of mem allocated for film session +2000 0500 SQ BFS seq of UIDs of diff FILMBOX instances +2010 0000 UL BFB Group Length +2010 0010 ST BFB Type of image display format +2010 0030 CS BFB Id of annotation display format +2010 0040 CS BFB Film orientation +2010 0050 CS BFB Film size identification +2010 0060 CS BFB Interpol. type by which printer mag image +2010 0080 CS BFB Specifies type of interpolation function +2010 0100 CS BFB density of film areas around/between images +2010 0110 CS BFB density of image box area having no image +2010 0120 US BFB Minimum density of images on the film +2010 0130 US BFB Maximum density of images on the film +2010 0140 CS BFB specifies whether to trim or not +2010 0150 ST BFB ID of configuration table +2010 0500 SQ BFB seq. of film session instance +2010 0510 SQ BFB seq. of basic image box SOP instance +2010 0520 SQ BFB seq. of basic annotation box SOP instance +2020 0000 UL BIB Group Length +2020 0010 US BIB Specifies position of the image in the film +2020 0020 CS BIB Specifies image polarity +2020 0030 DS BIB Requested image size +2020 0110 SQ BIB Preformatted Greyscale image +2020 0111 SQ BIB Preformatted Color image +2020 0130 SQ BIB Referenced Image Overlay Box seq +2020 0140 SQ BIB Referenced VOI LUT seq. +2030 0000 UL BAB Group Length +2030 0010 US BAB posn of the annot. box in parent film box +2030 0020 LO BAB text string +2040 0000 UL IOB Group Length +2040 0010 SQ IOB Ref Overlay Plane Sequence +2040 0011 US IOB Ref Overlay Plane Groups +2040 0060 CS IOB Overlay Magnification Type +2040 0070 CS IOB Overlay Smoothing Type +2040 0080 CS IOB Overlay Foreground Density +2040 0090 CS IOB Overlay Mode +2040 0100 CS IOB Threshold Density +2040 0500 SQ IOB Ref Image Box Sequence (RET) +2100 0000 UL PJ Group Length +2100 0020 CS PJ execution status of print job +2100 0030 CS PJ additional information +2100 0040 DA PJ date of print job creation +2100 0050 TM PJ time of print job creation +2100 0070 AE PJ Appln entity title that issued the print opn +2100 0500 SQ PJ Referenced print job seq. +2110 0000 UL PRINTER Group Length +2110 0010 CS PRINTER printer device status +2110 0020 CS PRINTER additional information +2110 0030 LO PRINTER printer name +2110 0099 SH PRINTER Queue ID +3002 0000 UL RT Group Length +3002 0002 SH RT Image Label +3002 0003 LO RT Image Name +3002 0004 ST RT Image Description +3002 000a CS RT Reported Values Origin +3002 000c CS RT Image Plane +3002 000e DS RT X-Ray Image Receptor Angle +3002 0010 DS RT Image Orientation +3002 0011 DS RT Image Plane Pixel Spacing +3002 0012 DS RT Image Position +3002 0020 SH RT Radiation Machine Name +3002 0022 DS RT Radiation Machine SAD +3002 0024 DS RT Radiation Machine SSD +3002 0026 DS RT Image SID +3002 0028 DS RT Source to Reference Object Distance +3002 0029 IS RT Fraction Number +3002 0030 SQ RT Exposure Sequence +3002 0032 DS RT Meterset Exposure +3004 0000 UL DVH Group Length +3004 0001 CS DVH Type +3004 0002 CS DVH Dose Units +3004 0004 CS DVH Dose Type +3004 0006 LO DVH Dose Comment +3004 0008 DS DVH Normalization Point +3004 000a CS DVH Dose Summation Type +3004 000c DS DVH Grid Frame Offset Vector +3004 000e DS DVH Dose Grid Scaling +3004 0010 SQ DVH RT Dose ROI Sequence +3004 0012 DS DVH Dose Value +3004 0040 DS DVH Normalization Point +3004 0042 DS DVH Normalization Dose Value +3004 0050 SQ DVH Sequence +3004 0052 DS DVH Dose Scaling +3004 0054 CS DVH Volume Units +3004 0056 IS DVH Number of Bins +3004 0058 DS DVH Data +3004 0060 SQ DVH Referenced ROI Sequence +3004 0062 CS DVH ROI Contribution Type +3004 0070 DS DVH Minimum Dose +3004 0072 DS DVH Maximum Dose +3004 0074 DS DVH Mean Dose +3006 0000 UL SSET Group Length +3006 0002 SH SSET Structure Set Label +3006 0004 LO SSET Structure Set Name +3006 0006 ST SSET Structure Set Description +3006 0008 DA SSET Structure Set Date +3006 0009 TM SSET Structure Set Time +3006 0010 SQ SSET Referenced Frame of Reference Sequence +3006 0012 SQ SSET RT Referenced Study Sequence +3006 0014 SQ SSET RT Referenced Series Sequence +3006 0016 SQ SSET Contour Image Sequence +3006 0020 SQ SSET Structure Set ROI Sequence +3006 0022 IS SSET ROI Number +3006 0024 UI SSET Referenced Frame of Reference UID +3006 0026 LO SSET ROI Name +3006 0028 ST SSET ROI Description +3006 002a IS SSET ROI Display Color +3006 002c DS SSET ROI Volume +3006 0030 SQ SSET RT Related ROI Sequence +3006 0033 CS SSET RT ROI Relationship +3006 0036 CS SSET ROI Generation Algorithm +3006 0038 LO SSET ROI Generation Description +3006 0039 SQ SSET ROI Contour Sequence +3006 0040 SQ SSET Contour Sequence +3006 0042 CS SSET Contour Geometric Type +3006 0044 DS SSET Contour Slab Thickness +3006 0045 DS SSET Contour Offset Vector +3006 0046 IS SSET Number of Contour Points +3006 0050 DS SSET Contour Data +3006 0080 SQ SSET RT ROI Observations Sequence +3006 0082 IS SSET Observation Number +3006 0084 IS SSET Referenced ROI Number +3006 0085 SH SSET ROI Observation Label +3006 0086 SQ SSET RT ROI Identification Code Sequence +3006 0088 ST SSET ROI Observation Description +3006 00a0 SQ SSET Relation RT ROI Observations Sequence +3006 00a4 CS SSET RT ROI Interpreted Type +3006 00a6 PN SSET ROI Interpreter +3006 00b0 SQ SSET ROI Physical Properties Sequence +3006 00b2 CS SSET ROI Physical Property +3006 00b4 DS SSET ROI Physical Property Value +3006 00c0 SQ SSET Frame of Referenced Relationship Sequence +3006 00c2 UI SSET Related Frame of Reference UID +3006 00c4 CS SSET Frame of Reference Transformation Type +3006 00c6 DS SSET Frame of Reference Transformation Matrix +3006 00c8 LO SSET Frame of Reference Transformation Comment +300a 0000 UL Group Length +300a 0002 SH RT Plan Label +300a 0003 LO RT Plan Name +300a 0004 ST RT Plan Description +300a 0006 DA RT Plan Date +300a 0007 TM RT Plan Time +300a 0009 LO RT Treatment Protocols +300a 000a CS Treatment Intent +300a 000b LO Treatment Sites +300a 000c CS RT Plan Geometry +300a 000e ST Prescription Description +300a 0010 SQ Dose Reference Sequence +300a 0012 IS Dose Reference Number +300a 0014 CS Dose Reference Structure Type +300a 0016 LO Dose Reference Description +300a 0018 DS Dose Reference Point Coordinates +300a 001a DS Nominal Prior Dose +300a 0020 CS Dose Reference Type +300a 0021 DS Constraint Weight +300a 0022 DS Delivery Warning Dose +300a 0023 DS Delivery Maximum Dose +300a 0025 DS Target Minimum Dose +300a 0026 DS Target Prescription Dose +300a 0027 DS Target Maximum Dose +300a 0028 DS Target Underdose Volume Fraction +300a 002a DS Organ at Risk Full-volume Dose +300a 002b DS Organ at Risk Limit Dose +300a 002c DS Organ at Risk Maximum Dose +300a 002d DS Organ at Risk Overdose Volume Fraction +300a 0040 SQ Tolerance Table Sequence +300a 0042 IS Tolerance Table Number +300a 0043 SH Tolerance Table Label +300a 0044 DS Gantry Angle Tolerance +300a 0046 DS Beam Limiting Device Angle Tolerance +300a 0048 SQ Beam Limiting Device Tolerance Sequence +300a 004a DS Beam Limiting Device Position Tolerance +300a 004c DS Patient Support Angle Tolerance +300a 004e DS Table Top Eccentric Angle Tolerance +300a 0051 DS Table Top Vertical Position Tolerance +300a 0052 DS Table Top Longitudinal Position Tolerance +300a 0053 DS Table Top Lateral Position Tolerance +300a 0055 CS RT Plan Relationship +300a 0070 SQ Fraction Group Sequence +300a 0071 IS Fraction Group Number +300a 0078 IS Number of Fractions Planned +300a 0079 IS Number of Fractions Per Day +300a 007a IS Repeat Fraction Cycle Length +300a 007b LT Fraction Pattern +300a 0080 IS Number of Beams +300a 0082 DS Beam Dose Specification Point +300a 0084 DS Beam Dose +300a 0086 DS Beam Meterset +300a 00a0 IS Number of Brachy Application Setups +300a 00a2 DS Brachy App Setup Dose Specification Point +300a 00a4 DS Brachy Application Setup Dose +300a 00b0 SQ Beam Sequence +300a 00b2 SH Treatment Machine Name +300a 00b3 CS Primary Dosimeter Unit +300a 00b4 DS Source-Axis Distance +300a 00b6 SQ Beam Limiting Device Sequence +300a 00b8 CS RT Beam Limiting Device Type +300a 00ba DS Source to Beam Limiting Device Distance +300a 00bc IS Number of Leaf/Jaw Pairs +300a 00be DS Leaf Position Boundaries +300a 00c0 IS Beam Number +300a 00c2 LO Beam Name +300a 00c3 ST Beam Description +300a 00c4 CS Beam Type +300a 00c6 CS Radiation Type +300a 00c8 IS Reference Image Number +300a 00ca SQ Planned Verification Image Sequence +300a 00cc LO Imaging Device-Specific Acq Parameters +300a 00ce CS Treatment Delivery Type +300a 00d0 IS Number of Wedges +300a 00d1 SQ Wedge Sequence +300a 00d2 IS Wedge Number +300a 00d3 CS Wedge Type +300a 00d4 SH Wedge ID +300a 00d5 IS Wedge Angle +300a 00d6 DS Wedge Factor +300a 00d8 DS Wedge Orientation +300a 00da DS Source to Wedge Tray Distance +300a 00e0 IS Number of Compensators +300a 00e1 SH Material ID +300a 00e2 DS Total Compensator Tray Factor +300a 00e3 SQ Compensator Sequence +300a 00e4 IS Compensator Number +300a 00e5 SH Compensator ID +300a 00e6 DS Source to Compensator Tray Distance +300a 00e7 IS Compensator Rows +300a 00e8 IS Compensator Columns +300a 00e9 DS Compensator Pixel Spacing +300a 00ea DS Compensator Position +300a 00eb DS Compensator Transmission Data +300a 00ec DS Compensator Thickness Data +300a 00ed IS Number of Boli +300a 00f0 IS Number of Blocks +300a 00f2 DS Total Block Tray Factor +300a 00f4 SQ Block Sequence +300a 00f5 SH Block Tray ID +300a 00f6 DS Source to Block Tray Distance +300a 00f8 CS Block Type +300a 00fa CS Block Divergence +300a 00fc IS Block Number +300a 00fe LO Block Name +300a 0100 DS Block Thickness +300a 0102 DS Block Transmission +300a 0104 IS Block Number of Points +300a 0106 DS Block Data +300a 0107 SQ Applicator Sequence +300a 0108 SH Applicator ID +300a 0109 CS Applicator Type +300a 010a LO Applicator Description +300a 010c DS Cumulative Dose Reference COefficient +300a 010e DS Final Cumulative Meterset Weight +300a 0110 IS Number of Control Points +300a 0111 SQ Control Point Sequence +300a 0112 IS Control Point Index +300a 0114 DS Nominal Beam Energy +300a 0115 DS Dose Rate Set +300a 0116 SQ Wedge Position Sequence +300a 0118 CS Wedge Position +300a 011a SQ Beam Limiting Device Position Sequence +300a 011c DS Leaf/Jaw Positions +300a 011e DS Gantry Angle +300a 011f CS Gantry Rotation Direction +300a 0120 DS Beam Limiting Device Angle +300a 0121 CS Beam Limiting Device Rotation Direction +300a 0122 DS Patient Support Angle +300a 0123 CS Patient Support Rotation Direction +300a 0124 DS Table Top Eccentric Axis Distance +300a 0125 DS Table Top Eccentric Angle +300a 0126 CS Table Top Eccentric Rotation Direction +300a 0128 DS Table Top Vertical Position +300a 0129 DS Table Top Longitudinal Position +300a 012a DS Table Top Lateral Position +300a 012c DS Isocenter Position +300a 012e DS Surface Entry Point +300a 0130 DS Source to Surface Distance +300a 0134 DS Cumulative Meterset Weight +300a 0180 SQ Patient Setup Sequence +300a 0182 IS Patient Setup Number +300a 0184 LO Patient Additional Position +300a 0190 SQ Fixation Device Sequence +300a 0192 CS Fixation Device Type +300a 0194 SH Fixation Device Label +300a 0196 ST Fixation Device Description +300a 0198 SH Fixation Device Position +300a 01a0 SQ Shielding Device Sequence +300a 01a2 CS Shielding Device Type +300a 01a4 SH Shielding Device Label +300a 01a6 ST Shielding Device Description +300a 01a8 SH Shielding Device Position +300a 01b0 CS Setup Technique +300a 01b2 ST Setup Technique Description +300a 01b4 SQ Setup Device Sequence +300a 01b6 CS Setup Device Type +300a 01b8 SH Setup Device Label +300a 01ba ST Setup Device Description +300a 01bc DS Setup Device Parameter +300a 01d0 ST Setup Reference Description +300a 01d2 DS Table Top Vertical Setup Displacement +300a 01d4 DS Table Top Longitudinal Setup Displacement +300a 01d6 DS Table Top Lateral Setup Displacement +300a 0200 CS Brachy Treatment Technique +300a 0202 CS Brachy Treatment Type +300a 0206 SQ Treatment Machine Sequence +300a 0210 SQ Source Sequence +300a 0212 IS Source Number +300a 0214 CS Source Type +300a 0216 LO Source Manufacturer +300a 0218 DS Active Source Diameter +300a 021a DS Active Source Length +300a 0222 DS Source Encapsulation Nominal Thickness +300a 0224 DS Source Encapsulation Nominal Transmission +300a 0226 LO Source Isotope Name +300a 0228 DS Source Isotope Half Life +300a 022a DS Reference Air Kerma Rate +300a 022c DA Air Kerma Rate Reference Date +300a 022e TM Air Kerma Rate Reference Time +300a 0230 SQ Application Setup Sequence +300a 0232 CS Application Setup Type +300a 0234 IS Application Setup Number +300a 0236 LO Application Setup Name +300a 0238 LO Application Setup Manufacturer +300a 0240 IS Template Number +300a 0242 SH Template Type +300a 0244 LO Template Name +300a 0250 DS Total Reference Air Kerma +300a 0260 SQ Brachy Acessory Device Sequence +300a 0262 IS Brachy Accessory Device Number +300a 0263 SH Brachy Accessory Device ID +300a 0264 CS Brachy Accessory Device Type +300a 0266 LO Brachy Accessory Device Name +300a 026a DS Brachy Accessory Device Nominal Thickness +300a 026c DS Brachy Acc'ry Device Nominal Transmission +300a 0280 SQ Channel Sequence +300a 0282 IS Channel Number +300a 0284 DS Channel Length +300a 0286 DS Channel Total Time +300a 0288 CS Source Movement Type +300a 028a IS Number of Pulses +300a 028c DS Pulse Repetition Interval +300a 0290 IS Source Applicator Number +300a 0291 SH Source Applicator ID +300a 0292 CS Source Applicator Type +300a 0294 LO Source Applicator Name +300a 0296 DS Source Applicator Length +300a 0298 LO Source Applicator Manufacturer +300a 029c DS Source Applicator Wall Nominal Thickness +300a 029e DS Src Applicator Wall Nominal Transmission +300a 02a0 DS Source Applicator Step Size +300a 02a2 IS Transfer Tube Number +300a 02a4 DS Transfer Tube Length +300a 02b0 SQ Channel Shield Sequence +300a 02b2 IS Channel Shield Number +300a 02b3 SH Channel Shield ID +300a 02b4 LO Channel Shield Name +300a 02b8 DS Channel Shield Nominal Thickness +300a 02ba DS Channel Shield Nominal Transmission +300a 02c8 DS Final Cumulative Time Weight +300a 02d0 SQ Brachy Control Point Sequence +300a 02d2 DS Control Point Relative Position +300a 02d4 DS Control Point 3D Position +300a 02d6 DS Cumulative Time Weight +300c 0000 UL Group Length +300c 0002 SQ Referenced RT Plan Sequence +300c 0004 SQ Referenced Beam Sequence +300c 0006 IS Referenced Beam Number +300c 0007 IS Referenced Reference Image Number +300c 0008 DS Start Cumulative Meterset Weight +300c 0009 DS End Cumulative Meterset Weight +300c 000a SQ Referenced Brachy Application Setup Seq +300c 000c IS Referenced Brachy Application Setup Number +300c 000e IS Referenced Source Number +300c 0020 SQ Referenced Fraction Group Sequence +300c 0022 IS Referenced Fraction Group Number +300c 0040 SQ Referenced Verification Image Sequence +300c 0042 SQ Referenced Reference Image Sequence +300c 0050 SQ Referenced Dose Reference Sequence +300c 0051 IS Referenced Dose Reference Numer +300c 0055 SQ Brachy Referenced Dose Reference Sequence +300c 0060 SQ Referenced Structure Set Sequence +300c 006a IS Referenced Patient Setup Number +300c 0080 SQ Referenced Dose Sequence +300c 00a0 IS Referenced Tolerance Table Number +300c 00b0 SQ Referenced Bolus Sequence +300c 00c0 IS Referenced Wedge Number +300c 00d0 IS Referenced Compensator Number +300c 00e0 IS Referenced Block Number +300c 00f0 IS Referenced Control Point Index +300e 0000 UL Group Length +300e 0002 CS Approval Status +300e 0004 DA Review Date +300e 0005 TM Review Time +300e 0008 PN Reviewer Name +4008 0000 UL RES Group Length +4008 0040 SH RES Results ID +4008 0042 LO RES Results ID Issuer +4008 0050 SQ RES Referenced Interpretation Sequence +4008 0100 DA RES Interpretation Recorded Date +4008 0101 TM RES Interpretation Recorded Time +4008 0102 PN RES Interpretation Recorder +4008 0103 LO RES Reference to Recorded Sound +4008 0108 DA RES Interpretation Transcription Date +4008 0109 TM RES Interpretation Transcription Time +4008 010a PN RES Interpretation Transcriber +4008 010b ST RES Interpretation Text +4008 010c PN RES Interpretation Author +4008 0111 SQ RES Interpretation Approver Sequence +4008 0112 DA RES Interpretation Approval Date +4008 0113 TM RES Interpretation Approval Time +4008 0114 PN RES Physician Approving Interpretation +4008 0115 LT RES Diagnosis +4008 0117 SQ RES Diagnosis Code Sequence +4008 0118 SQ RES Results Distribution List Sequence +4008 0119 PN RES Distribution Name +4008 011a LO RES Distribution Address +4008 0200 SH RES Interpretation ID +4008 0202 LO RES Interpretation ID Issuer +4008 0210 CS RES Interpretation Type ID +4008 0212 CS RES Interpretation Status ID +4008 0300 ST RES Impressions +4008 4000 ST RES Comments +5000 0000 UL CRV Group Length +5000 0005 US CRV Curve Dimensions +5000 0010 US CRV Number of points +5000 0020 CS CRV Type of Data +5000 0022 LO CRV Curve Description +5000 0030 SH CRV Axis Units +5000 0040 SH CRV Axis Labels +5000 0103 US CRV Data Value Representation +5000 0104 US CRV Minimum Coordinate Value +5000 0105 US CRV Maximum Coordinate Value +5000 0106 SH CRV Curve Range +5000 0110 US CRV Data Descriptor +5000 0112 US CRV Coordinate Start Value +5000 0114 US CRV Coordinate Step Value +5000 2000 US CRV Audio Type +5000 2002 US CRV Audio Sample Format +5000 2004 US CRV Number of Channels +5000 2006 UL CRV Number of Samples +5000 2008 UL CRV Sample Rate +5000 200a UL CRV Total Time +5000 200c OW CRV Audio Sample Data +5000 200e LT CRV Audio Comments +5000 2500 LO CRV Curve Label +5000 2600 SQ CRV Referenced Overlay Sequence +5000 2610 US CRV Referenced Overlay Group +5000 3000 OW CRV Curve Data +6000 0000 UL OLY Group Length +6000 0010 US OLY Rows +6000 0011 US OLY Columns +6000 0012 US OLY Planes +6000 0015 IS OLY Number of frames in Overlay +6000 0022 LO OLY Overlay Description +6000 0040 CS OLY Type +6000 0045 LO OLY Subtype +6000 0050 SS OLY Origin +6000 0051 US OLY Image Frame Origin +6000 0052 US OLY Overlay Plane Origin +6000 0060 LO OLY Compression Code (RET) +6000 0100 US OLY Overlay Bits Allocated +6000 0102 US OLY Overlay Bit Position +6000 0110 LO OLY Overlay Format (RET) +6000 0200 US OLY Overlay Location (RET) +6000 1100 US OLY Overlay Descriptor - Gray +6000 1101 US OLY Overlay Descriptor - Red +6000 1102 US OLY Overlay Descriptor - Green +6000 1103 US OLY Overlay Descriptor - Blue +6000 1200 US OLY Overlays - Gray +6000 1201 US OLY Overlays - Red +6000 1202 US OLY Overlays - Green +6000 1203 US OLY Overlays - Blue +6000 1301 IS OLY ROI Area +6000 1302 DS OLY ROI Mean +6000 1303 DS OLY ROI Standard Deviation +6000 1500 LO OLY Overlay Label +6000 3000 OW OLY Data +6000 4000 LO OLY Comments (RET) +7fe0 0000 UL PXL Group Length +7fe0 0010 OT PXL Pixel Data +fffe e000 UL XX item +ffff ffff UKN UKN Unknown Code diff --git a/TODO b/TODO index 4461948f..f7a7dd60 100644 --- a/TODO +++ b/TODO @@ -8,11 +8,10 @@ gdcmHeader::ReadNextElement: retarder le stockage en mem des gros elements comme a charger plus tard * a l'acces (pour le groupe des pixels par exemple) retourner au fichier pour trouver la bonne valeur (GetPixelData). - + * fournir une method qui ne fait que lire les elements passes en arguments + sous forme d'une liste. grep str2num *.c: c'est une macro sans doute proprifiable gdcmHeader::CheckSwap() dans le cas ACR pas propre, degager tout de suite si on a deduit que c'en est pas... - -gdcmHeader::_IdDcmRecupLgr return type should be long int. diff --git a/Testing/.cvsignore b/Testing/.cvsignore new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/Testing/.cvsignore @@ -0,0 +1 @@ +test diff --git a/Testing/TestHash.cxx b/Testing/TestHash.cxx new file mode 100644 index 00000000..f8d58bcc --- /dev/null +++ b/Testing/TestHash.cxx @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() +{ + typedef map dict; + + dict current; + dict::iterator im = current.find("00380010"); + current["00100010"] = "Patient Name"; + current["7fe00010"] = "Pixel Data"; + current["50000010"] = "Number of points"; + current["00380010"] = "Admission ID"; + + cout << "Traversal of dictionary (note the proper ordering on key)." << endl; + for ( dict::iterator im = current.begin(); im != current.end(); ++im ) + cout << " \"" << im->first << "\" = " << im->second << endl; + cout << "End of dictionary." << endl; + + cout << "Find request on key 00380010" << endl; + im = current.find("00380010"); + cout << " \"" << im->first << "\" = " << im->second << endl; +} diff --git a/src/.cvsignore b/src/.cvsignore index 5761abcf..9d22eb46 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -1 +1,2 @@ *.o +*.so diff --git a/src/Makefile b/src/Makefile index 64faab30..c175aa7d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,13 +10,22 @@ PYTHON_VERSION =`$(PYTHON) -c "import sys; print sys.version[:3]"` PYTHON_INCLUDES="-I$(PYTHON_PREFIX)/include/python$(PYTHON_VERSION)" CXXFLAGS=`glib-config --cflags` +CPPFLAGS=-g +LDFLAGS=`glib-config --libs` -g %.o : %.cxx $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ %_wrap.cxx : %.i $(SWIG) $(SWIGFLAGS) $(PYTHON_INCLUDES) -o $@ $< -all: gdcmHeader.o gdcmElValue.o dcm_wrap.o +all: gdcmUtil.o \ + gdcmHeader.o \ + gdcmElValue.o \ + gdcmDictEntry.o \ + gdcmDict.o \ + gdcmDictSet.o \ + gdcmElValSet.o + g++ -shared -o gdcmlib.so $^ $(LDFLAGS) test: gdcmHeader.o @@ -24,4 +33,3 @@ clean: rm -f *_wrap* *.so *.o *.pyc .SECONDARY: dcm_wrap.cxx - diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx new file mode 100644 index 00000000..f21e37a1 --- /dev/null +++ b/src/gdcmDict.cxx @@ -0,0 +1,46 @@ +#include +#include "gdcmlib.h" +#include "gdcmUtil.h" + +gdcmDict::gdcmDict(char * FileName) { + std::ifstream from(FileName); + dbg.Error(!from, "gdcmDictSet::gdcmDictSet:", + "can't open dictionary"); + guint16 group, element; + // CLEANME : use defines for all those constants + char buff[1024]; + char trash[10]; + TagKey key, vr, fourth, name; + while (!from.eof()) { + from >> hex >> group >> element; + eatwhite(from); + from.getline(buff, 256, ' '); + vr = buff; + eatwhite(from); + from.getline(buff, 256, ' '); + fourth = buff; + from.getline(buff, 256, '\n'); + name = buff; + gdcmDictEntry * newEntry = new gdcmDictEntry(group, element, + vr, fourth, name); + entries[gdcmDictEntry::TranslateToKey(group, element)] = newEntry; + } + from.close(); +} + +void gdcmDict::Print(ostream& os) { + for (TagHT::iterator tag = entries.begin(); tag != entries.end(); ++tag){ + os << "Tag : "; + os << "(" << hex << tag->second->GetGroup() << ','; + os << hex << tag->second->GetElement() << ") = " << dec; + os << tag->second->GetVR() << ", "; + os << tag->second->GetFourth() << ", "; + os << tag->second->GetName() << "." << endl; + } +} + +gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) { + TagKey key = gdcmDictEntry::TranslateToKey(group, element); + TagHT::iterator found = entries.find(key); + return found->second; +} diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx new file mode 100644 index 00000000..5bcacb34 --- /dev/null +++ b/src/gdcmDictEntry.cxx @@ -0,0 +1,23 @@ +#include "gdcmlib.h" + +gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement, + string InVr, string InFourth, string InName) +{ + group = InGroup; + element = InElement; + vr = InVr; + fourth = InFourth; + name = InName; + key = TranslateToKey(group, element); +} + +TagKey gdcmDictEntry::TranslateToKey(guint16 group, guint16 element) { + char trash[10]; + TagKey key; + // CLEAN ME: better call the iostream<< with the hex manipulator on. + // This requires some reading of the stdlibC++ sources to make the + // proper call (or copy). + sprintf(trash, "%04x|%04x", group , element); + key = trash; // Convertion through assignement + return key; +} diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx new file mode 100644 index 00000000..5352bcae --- /dev/null +++ b/src/gdcmDictSet.cxx @@ -0,0 +1,36 @@ +#include +#include "gdcmlib.h" +#include "gdcmUtil.h" + + +gdcmDictSet::gdcmDictSet(void) { + if (! LoadDicomV3Dict()) + return; +} + +int gdcmDictSet::LoadDicomV3Dict(void) { + if (dicts.count(PUBDICTNAME)) + return 1; + return LoadDictFromFile(PUBDICTFILENAME, PUBDICTNAME); +} + +int gdcmDictSet::LoadDictFromFile(char * FileName, DictKey Name) { + gdcmDict *NewDict = new gdcmDict(FileName); + dicts[Name] = NewDict; +} + +void gdcmDictSet::Print(ostream& os) { + for (DictSetHT::iterator dict = dicts.begin(); dict != dicts.end(); ++dict){ + os << "Printing dictionary " << dict->first << " \n"; + dict->second->Print(os); + } +} + +gdcmDict * gdcmDictSet::GetDict(DictKey DictName) { + DictSetHT::iterator dict = dicts.find(DictName); + return dict->second; +} + +gdcmDict * gdcmDictSet::GetDefaultPublicDict() { + return GetDict(PUBDICTNAME); +} diff --git a/src/gdcmElValSet.cxx b/src/gdcmElValSet.cxx new file mode 100644 index 00000000..57512516 --- /dev/null +++ b/src/gdcmElValSet.cxx @@ -0,0 +1,16 @@ +#include "gdcmlib.h" + +int ElValSet::Add(ElValue * newElValue) { + tagHt[newElValue->GetKey()] = newElValue; + NameHt[newElValue->GetName()] = newElValue; +} + +int ElValSet::Print(ostream & os) { + for (TagElValueHT::iterator tag = tagHt.begin(); + tag != tagHt.end(); + ++tag){ + os << tag->first << ": ["; + os << tag->second->GetValue() << "] ["; + os << tag->second->GetName() << "]" << endl; + } +} diff --git a/src/gdcmElValue.cxx b/src/gdcmElValue.cxx index 20a75e86..6ed2b007 100644 --- a/src/gdcmElValue.cxx +++ b/src/gdcmElValue.cxx @@ -1,14 +1,7 @@ #include "gdcmlib.h" -#define DEBUG 1 -void ElValue::SetVR(string ValRep) { - if (!entry && DEBUG) { - printf ("ElValue::SetVR: no known entry\n"); - return; - } - entry->SetVR(ValRep); -} +void ElValue::SetVR(string ValRep) { entry->SetVR(ValRep); } -void ElValue::SetLgrLue(guint32 lgr) { - LgrLueElem = lgr; -} +void ElValue::SetLgrLue(guint32 lgr) { LgrLueElem = lgr; } + +ElValue::ElValue(gdcmDictEntry* in) { entry = in; } diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx new file mode 100644 index 00000000..37672ec0 --- /dev/null +++ b/src/gdcmFile.cxx @@ -0,0 +1,5 @@ +#include "gdcmlib.h" + +gdcmFile::gdcmFile(string & filename) { + +} diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 363a3260..f0027e15 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -10,26 +10,43 @@ extern "C" { #include #endif #include +#include +#include "gdcmUtil.h" #define LGR_ENTETE_A_LIRE 256 // on ne lit plus que le debut -#define DEBUG 1 //FIXME: this looks dirty to me... #define str2num(str, typeNum) *((typeNum *)(str)) VRHT * gdcmHeader::dicom_vr = (VRHT*)0; +gdcmDictSet* gdcmHeader::Dicts = new gdcmDictSet(); -gdcmHeader::gdcmHeader () { +void gdcmHeader::Initialise(void) { if (!gdcmHeader::dicom_vr) InitVRDict(); bool grPixelTrouve = false; PixelPosition = (size_t)0; PixelsTrouves = false; + RefPubDict = gdcmHeader::Dicts->GetDefaultPublicDict(); + RefShaDict = (gdcmDict*)0; +} + +gdcmHeader::gdcmHeader (char* InFilename) { + filename = InFilename; + Initialise(); + fp=fopen(InFilename,"rw"); + dbg.Error(!fp, "gdcmHeader::gdcmHeader cannot open file", InFilename); + BuildHeader(); + fclose(fp); +} + +gdcmHeader::~gdcmHeader (void) { + return; } void gdcmHeader::InitVRDict (void) { - if (dicom_vr && DEBUG) { - printf ("InitVRDict : VR dictionary allready set\n"); + if (dicom_vr) { + dbg.Verbose(0, "gdcmHeader::InitVRDict:", "VR dictionary allready set"); return; } VRHT *vr = new VRHT; @@ -104,10 +121,10 @@ void gdcmHeader::CheckSwap() entCur = deb+128; if(memcmp(entCur, "DICM", (size_t)4) == 0) { filetype = TrueDicom; - if (DEBUG) printf ("_IdDcmCheckSwap : C est du DICOM actuel \n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", "looks like DICOM Version3"); } else { filetype = Unknown; - if (DEBUG) printf ("_IdDcmCheckSwap : Ce n'est PAS du DICOM actuel\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", "not a DICOM Version3 file"); } if(filetype == TrueDicom) { @@ -117,18 +134,22 @@ void gdcmHeader::CheckSwap() if(memcmp(entCur, "UL", (size_t)2) == 0) { // les 2 premiers octets de la lgr peuvent valoir UL --> Explicit VR filetype = ExplicitVR; - if (DEBUG) printf ("_IdDcmCheckSwap : Explicit VR\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "explicit Value Representation"); } else { filetype = ImplicitVR; - if (DEBUG) printf ("_IdDcmCheckSwap : PAS Explicit VR\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "not an explicit Value Representation"); } if (net2host) { // HostByteOrder is different from NetworkByteOrder sw = 0; // on est sur PC ou DEC --> LITTLE-ENDIAN -> Rien a faire - if (DEBUG) printf("HostByteOrder = NetworkByteOrder\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "HostByteOrder = NetworkByteOrder"); } else { /* on est sur une Sun ou une SGI */ sw = 4321; - if (DEBUG) printf("HostByteOrder != NetworkByteOrder\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "HostByteOrder != NetworkByteOrder"); } rewind(fp); @@ -143,24 +164,25 @@ void gdcmHeader::CheckSwap() switch (s) { case 0x00040000 : - sw=3412; if(DEBUG) printf("s : %08x sw : %d\n",s,sw); + sw=3412; filetype = ACR; break; case 0x04000000 : - sw=4321; if(DEBUG) printf("s : %08x sw : %d\n",s,sw); + sw=4321; filetype = ACR; break; case 0x00000400 : - sw=2143; if(DEBUG) printf("s : %08x sw : %d\n",s,sw); + sw=2143; filetype = ACR; break; case 0x00000004 : - sw=0; if(DEBUG) printf("s : %08x sw : %d\n",s,sw); + sw=0; filetype = ACR; break; default : sw = -1; - if (DEBUG) printf (" Pas trouve l info de Swap; On va parier\n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "unfound swap info (time to raise bets)"); } if(sw!=-1) { rewind(fp); // les info commencent au debut @@ -176,7 +198,8 @@ void gdcmHeader::CheckSwap() // * si on est sur une DEC ou un PC alors swap=0, // * si on est sur SUN ou SGI, alors swap=4321 // Si c'est du RAW, ca degagera + tard - if (DEBUG) printf("On force la chance \n"); + dbg.Verbose(0, "gdcmHeader::CheckSwap:", + "time for wild guesses..."); if (x!=ntohs(x)) // HostByteOrder is different from NetworkByteOrder // on est sur PC ou DEC --> LITTLE-ENDIAN -> Rien a faire @@ -252,11 +275,7 @@ void gdcmHeader::setAcrLibido() { * @return longueur retenue pour le champ */ -// FIXME sw n'est plus un argument necessaire -long int gdcmHeader::RecupLgr( - ElValue *pleCourant, - int *skippedLength) -{ +long int gdcmHeader::RecupLgr( ElValue *pleCourant, int *skippedLength) { guint32 l_gr; unsigned short int l_gr_2; int i; @@ -292,58 +311,41 @@ long int gdcmHeader::RecupLgr( // mais ce n'est pas un code connu ... // On reconstitue la longueur - if(DEBUG) - printf("IdDcmRecupLgr : Explicit VR, mais pas de code connu\n"); + dbg.Verbose(1, "gdcmHeader::RecupLgr:", + "Explicit VR, but no known code"); memcpy(&l_gr, VR,(size_t)2); - lgrLue=fread ( ((char*)&l_gr)+2, (size_t)2, (size_t)1, fp); - - l_gr = SWAP_LONG((guint32)l_gr); - - if(DEBUG) - printf("IdDcmRecupLgr : lgr deduite : %08x , %d\n",l_gr,l_gr); - + l_gr = SwapLong((guint32)l_gr); pleCourant->SetLgrLue(l_gr); if ( (int)l_gr == -1) l_gr=0; *skippedLength = 4; - if (DEBUG) - printf(" 1 : lgr %08x (%d )skippedLength %d\n", - l_gr,l_gr, *skippedLength); return(l_gr); } // On repart dans la sequence 'sensee' - - if(DEBUG) - printf("VR : [%01x , %01x] (%c%c) en position %d du tableau\n", - VR[0],VR[1],VR[0],VR[1],i); - if ( (!memcmp( VR,"OB",(size_t)2 )) || (!memcmp( VR,"OW",(size_t)2 )) || (!memcmp( VR,"SQ",(size_t)2 )) || (!memcmp( VR,"UN",(size_t)2 )) ) { // les 2 octets suivants sont reserves: on les saute - if(DEBUG) - printf("IdDcmRecupLgr : les 2 octets suivants sont reserves\n"); fseek(fp, 2L,SEEK_CUR); //on lit la lgr sur QUATRE octets lgrLue=fread (&l_gr, (size_t)4,(size_t)1, fp); - l_gr = SWAP_LONG((guint32)l_gr); + l_gr = SwapLong((guint32)l_gr); *skippedLength = 8; } else { //on lit la lgr sur DEUX octets lgrLue=fread (&l_gr_2, (size_t)2,(size_t)1, fp); - if(sw) l_gr_2 = SWAP_SHORT((unsigned short)l_gr_2); + if(sw) l_gr_2 = SwapShort((unsigned short)l_gr_2); pleCourant->SetLgrLue(l_gr_2); - if ( l_gr_2 == 0xffff) { l_gr = 0; } else { @@ -357,7 +359,7 @@ long int gdcmHeader::RecupLgr( lgrLue=fread (&l_gr, (size_t)4,(size_t)1, fp); - l_gr= SWAP_LONG((long)l_gr); + l_gr= SwapLong((long)l_gr); *skippedLength = 4; } @@ -370,11 +372,8 @@ long int gdcmHeader::RecupLgr( if(!memcmp( VR,"SQ",(size_t)2 )) { // ca annonce une SEQUENCE d'items ?! l_gr=0; // on lira donc les items de la sequence - if (DEBUG) printf(" SQ trouve : lgr %d \n",l_gr); } - if (DEBUG) - printf(" 2 : lgr %08x (%d) skippedLength %d\n",l_gr,l_gr, *skippedLength); return(l_gr); } @@ -384,9 +383,11 @@ long int gdcmHeader::RecupLgr( * @return longueur retenue pour le champ */ -guint32 gdcmHeader::SWAP_LONG(guint32 a) { +guint32 gdcmHeader::SwapLong(guint32 a) { // FIXME: il pourrait y avoir un pb pour les entiers negatifs ... switch (sw) { + case 0 : + break; case 4321 : a=( ((a<<24) & 0xff000000) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | ((a>>24) & 0x000000ff) ); @@ -400,7 +401,7 @@ guint32 gdcmHeader::SWAP_LONG(guint32 a) { a=( ((a<<8) & 0xff00ff00) | ((a>>8) & 0x00ff00ff) ); break; default : - printf("\n\n\n *******\n erreur code swap ?!?\n\n\n"); + dbg.Error(" gdcmHeader::SwapLong : unset swap code"); a=0; } return(a); @@ -412,7 +413,7 @@ guint32 gdcmHeader::SWAP_LONG(guint32 a) { * @return longueur retenue pour le champ */ -short int gdcmHeader::SWAP_SHORT(short int a) { +short int gdcmHeader::SwapShort(short int a) { if ( (sw==4321) || (sw==2143) ) a =(((a<<8) & 0x0ff00) | ((a>>8)&0x00ff)); return (a); @@ -439,70 +440,49 @@ ElValue * gdcmHeader::ReadNextElement(void) { //CLEANME DICOM_ELEMENTS *t; ElValue * nouvDcmElem; - if (DEBUG) printf(" ===> entree ds _IdDcmReadNextElement\n"); - // FIXME la probabilte pour depasser sans s'en rendre compte // est grande avec le test d'egalite' suivant ! if(offsetCourant == taille_fich) { // On a atteint la fin du fichier - if (DEBUG) printf(" On a atteint la fin du fichier\n"); + dbg.Verbose(1, "ReadNextElement: EOF reached"); return(NULL); - } else { - if (DEBUG) { - posFich = ftell(fp); - printf("lgrFich %f positionDsFich %f offset courant %f\n", - (float)taille_fich, - (float)posFich, - (float)offsetCourant); - } - } + } // ------------------------- Lecture Num group : g lgrLue=fread (&g, (size_t)2,(size_t)1, fp); if (feof(fp)) { - if (DEBUG) printf("_IdDcmReadNextElement : eof trouve\n"); + dbg.Verbose(1, "ReadNextElement: EOF encountered"); return (NULL); } if (ferror(fp)){ - if (DEBUG) printf(" IdDcmReadNextElement : echec lecture NumGr\n"); + dbg.Verbose(1, "ReadNextElement: failed to read NumGr"); return (NULL); } - if (DEBUG) printf("_IdDcmReadNextElement : gr %04x\n",g ); + if (sw) g= SwapShort(((short)g)); - if (sw) g= SWAP_SHORT(((short)g)); - - //CLEANME nouvDcmElem->Gr=g; - //FIXME this might be usefull for detecting at parse time that - //something is screwy in the file - //e->__NumeroGroupePrecedent =g; - - // ------------------------- Lecture Num Elem : n lgrLue=fread (&n, (size_t)2,(size_t)1, fp); if (feof(fp)) { - if (DEBUG) printf("_IdDcmReadNextElement : eof trouve\n"); + dbg.Verbose(1, "ReadNextElement: EOF encountered"); return (NULL); } if (ferror(fp)){ - if (DEBUG) printf(" IdDcmReadNextElement : echec lecture NumElem\n"); + dbg.Verbose(1, "ReadNextElement: failed to read NumElem"); return (NULL); } - if (DEBUG) printf("_IdDcmReadNextElement : num %04x\n",n ); - - if(sw) n= SWAP_SHORT(((short)n)); - //CLEANMEnouvDcmElem->Num=n; + if(sw) n= SwapShort(((short)n)); // Find out if the tag we encountered is in the dictionaries: - DictEntry * NewTag = IsInDicts(g, n); + gdcmDictEntry * NewTag = IsInDicts(g, n); if (!NewTag) - NewTag = new DictEntry(g, n, "Unknown", "Unknown"); + NewTag = new gdcmDictEntry(g, n, "Unknown", "Unknown", "Unkown"); nouvDcmElem = new ElValue(NewTag); if (!nouvDcmElem) { - printf("Echec alloc ElValue *nouvDcmElem\n"); + dbg.Verbose(1, "ReadNextElement: failed to allocate ElValue"); return(NULL); } @@ -514,11 +494,6 @@ ElValue * gdcmHeader::ReadNextElement(void) { nouvDcmElem->LgrElem=l; - if (DEBUG) - if (n!=0) - printf("_IdDcmReadNextElement : " - " gr %04x\tnum %04x\tlong %08x (%d)\n", g,n,l,l); - // ------------------------- Lecture Valeur element // FIXME The exact size should be l if we move to strings or whatever @@ -527,8 +502,6 @@ ElValue * gdcmHeader::ReadNextElement(void) { if(NewValue) { NewValue[l]= 0; } else { - if (DEBUG) - printf(" IdDcmReadNextElement : echec Alloc valeurElem lgr : %d\n",l); return (NULL); } @@ -543,16 +516,13 @@ ElValue * gdcmHeader::ReadNextElement(void) { // ------------------------- Doit-on le Swapper ? if ((n==0) && sw) { // n=0 : lgr du groupe : guint32 - *(guint32 *) NewValue = SWAP_LONG ((*(guint32 *) NewValue)); + *(guint32 *) NewValue = SwapLong ((*(guint32 *) NewValue)); } else { if(sw) { if ( (g/2)*2-g==0) { /* on ne teste pas les groupes impairs */ if ((l==4)||(l==2)) { // pour eviter de swapper les chaines // de lgr 2 ou 4 - if (DEBUG) - printf("Consultation Dictionary DICOM g %04x n %0xx l %d\n", - g,n,l); // FIXME make reference to nouvDcmElem->GetTag string VR = NewTag->GetVR(); @@ -564,11 +534,11 @@ ElValue * gdcmHeader::ReadNextElement(void) { if(l==4) { *(guint32 *) NewValue = - SWAP_LONG ((*(guint32 *) NewValue)); + SwapLong ((*(guint32 *) NewValue)); } else { if(l==2) *(unsigned short *) NewValue = - SWAP_SHORT ((*(unsigned short *)NewValue)); + SwapShort ((*(unsigned short *)NewValue)); } } } /* fin if l==2 ==4 */ @@ -576,7 +546,8 @@ ElValue * gdcmHeader::ReadNextElement(void) { } /* fin sw */ } nouvDcmElem->value = NewValue; - SetAsidePixelData(nouvDcmElem); + // CLEAN ME: simply trash the following line and postpone the process ! + // SetAsidePixelData(nouvDcmElem); return nouvDcmElem; } @@ -618,9 +589,6 @@ void gdcmHeader::SetAsidePixelData(ElValue* elem) { grPixel = 0x7FE0; numPixel = 0x0010; grPixelTrouve = true; - if (DEBUG) - printf("------------------------grPixel %04x numPixel %04x\n", - grPixel,numPixel); } } else { // on est sur (28,200) if (g == 0x0028) { @@ -632,16 +600,10 @@ void gdcmHeader::SetAsidePixelData(ElValue* elem) { *((char*)(&grPixel)+i) = *(NewValue+i); elem->SetValue(NewValue); - if (DEBUG) - printf("------------------------GrPixel %04x\n", grPixel); - if (grPixel != 0x7FE0) // Vieux pb Philips numPixel = 0x1010; // encore utile ?? else numPixel = 0x0010; - if (DEBUG) - printf("------------------------grPixel %04x numPixel %04x\n", - grPixel,numPixel); } } } @@ -650,15 +612,15 @@ void gdcmHeader::SetAsidePixelData(ElValue* elem) { if (n == numPixel) { PixelPosition = elem->Offset; PixelsTrouves = true; - if (DEBUG) - printf(" \t===> Pixels Trouves\n"); + dbg.Verbose(0, "gdcmHeader::SetAsidePixelData:", + "Pixel data found"); } } } } -DictEntry * gdcmHeader::IsInDicts(guint32 group, guint32 element) { - DictEntry * found = (DictEntry*)0; +gdcmDictEntry * gdcmHeader::IsInDicts(guint32 group, guint32 element) { + gdcmDictEntry * found = (gdcmDictEntry*)0; if (!RefPubDict && !RefShaDict) { //FIXME build a default dictionary ! printf("FIXME in gdcmHeader::IsInDicts\n"); @@ -675,3 +637,39 @@ DictEntry * gdcmHeader::IsInDicts(guint32 group, guint32 element) { } return found; } + +string gdcmHeader::GetPubElValByNumber(unsigned short, unsigned short) { +} + +/** + * \ingroup gdcmHeader + * \brief renvoie un pointeur sur le ID_DCM_HDR correspondant au fichier + * @param filename Nom du fichier ACR / LibIDO / DICOM + * @return le ID_DCM_HDR + */ + +void gdcmHeader::BuildHeader(void) { + ElValue * newElValue = (ElValue *)0; + + rewind(fp); + fseek(fp, 0L, SEEK_END); + /* + * obtains the current value of the file-position + * indicator for the stream pointed to by stream + */ + taille_fich = ftell(fp); + rewind(fp); + CheckSwap(); + while ( (newElValue = ReadNextElement()) ) { + PubElVals.Add(newElValue); + } + setAcrLibido(); +} + +int gdcmHeader::PrintPubElVal(ostream & os) { + return PubElVals.Print(os); +} + +void gdcmHeader::PrintPubDict(ostream & os) { + RefPubDict->Print(os); +} diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx new file mode 100644 index 00000000..16653989 --- /dev/null +++ b/src/gdcmUtil.cxx @@ -0,0 +1,48 @@ +#include +#include "gdcmUtil.h" + +gdcmDebug::gdcmDebug(int level = 0) { + DebugLevel = level; +} + +void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2 = "") { + if (Level > DebugLevel) + return ; + cerr << Msg1 << ' ' << Msg2 << '\n'; +} + +void gdcmDebug::Assert(int Level, bool Test, + const char * Msg1, const char * Msg2 = "") { + if (Level > DebugLevel) + return ; + if (!Test) + cerr << Msg1 << ' ' << Msg2 << '\n'; +} + +void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2 = "") { + if (!Test) + return; + std::cerr << Msg1 << ' ' << Msg2 << '\n'; + std::exit(1); +} + +void gdcmDebug::Error(const char* Msg1, const char* Msg2 ="", + const char* Msg3 ="") { + std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << '\n'; + std::exit(1); +} + +gdcmDebug dbg; + +// Because is not yet available in g++2.06 +istream& eatwhite(istream& is) { + char c; + while (is.get(c)) { + if (!isspace(c)) { + is.putback(c); + break; + } + } + return is; +} + diff --git a/src/gdcmUtil.h b/src/gdcmUtil.h new file mode 100644 index 00000000..bfa1373d --- /dev/null +++ b/src/gdcmUtil.h @@ -0,0 +1,15 @@ +#include +class gdcmDebug { +private: + int DebugLevel; +public: + gdcmDebug(int); + void Verbose(int, const char*, const char* =""); + void Error(bool, const char*, const char*); + void Error(const char*, const char* ="", const char* =""); + void Assert(int, bool, const char*, const char*); +}; + +istream& eatwhite(istream& is); + +extern gdcmDebug dbg; diff --git a/src/gdcmlib.h b/src/gdcmlib.h index a923f4c8..7ba3d4d0 100644 --- a/src/gdcmlib.h +++ b/src/gdcmlib.h @@ -22,29 +22,29 @@ // around 4500 entries which is the average dictionary size (said JPR) #include + // Tag based hash tables. // We shall use as keys the strings (as the C++ type) obtained by // concatenating the group value and the element value (both of type // unsigned 16 bit integers in Dicom) expressed in hexadecimal. // Example: consider the tag given as (group, element) = (0x0010, 0x0010). -// Then the corresponding TagKey shall be the string 00100010 (or maybe -// 0x00100x0010, we need some checks here). +// Then the corresponding TagKey shall be the string 0010|0010 (where +// the | (pipe symbol) acts as a separator). Refer to +// gdcmDictEntry::TranslateToKey for this conversion function. typedef string TagKey; -typedef map TagHT; - -class DictEntry { +class gdcmDictEntry { private: -////// QUESTION: it is not sure that we need to store the group and -////// and the element within a DictEntry. What is the point -////// of storing the equivalent of a TagKey within the information -////// accessed through that TagKey !? guint16 group; // e.g. 0x0010 guint16 element; // e.g. 0x0010 - string name; // e.g. "Patient_Name" - string ValRep; // Value Representation i.e. some clue about the nature + string vr; // Value Representation i.e. some clue about the nature // of the data represented e.g. "FD" short for // "Floating Point Double" + // CLEAN ME: find the official dicom name for this field ! + string fourth; // Fourth field containing some semantics. + string name; // e.g. "Patient_Name" + TagKey key; // This is redundant zith (group, element) but we add + // on efficiency purposes. // DCMTK has many fields for handling a DictEntry (see below). What are the // relevant ones for gdcmlib ? // struct DBI_SimpleEntry { @@ -61,55 +61,70 @@ private: // DcmDictRangeRestriction elementRestriction; // }; public: - DictEntry(); - DictEntry(guint16 group, guint16 element, string name, string VR); - void SetVR(string); - string GetVR(void); - guint16 GetGroup(void) { return group;}; - guint16 GetElement(void) {return element;}; + //CLEANME gdcmDictEntry(); + gdcmDictEntry(guint16 group, guint16 element, + string vr, string fourth, string vr); + static TagKey TranslateToKey(guint16 group, guint16 element); + guint16 GetGroup(void) { return group;}; + guint16 GetElement(void){return element;}; + string GetVR(void) {return vr; }; + void SetVR(string in){vr = in; }; + string GetFourth(void) {return fourth;}; + string GetName(void) {return name;}; + string GetKey(void) {return key;}; }; + +typedef map TagHT; // A single DICOM dictionary i.e. a container for a collection of dictionary // entries. There should be a single public dictionary (THE dictionary of // the actual DICOM v3) but as many shadow dictionaries as imagers // combined with all software versions... -class Dict { +class gdcmDict { string name; string filename; TagHT entries; public: - Dict(); - Dict(string filename); // Read Dict from disk - int AppendEntry(DictEntry* NewEntry); - DictEntry * GetTag(guint32, guint32); // Is this tag in this Dict ? + gdcmDict(); + gdcmDict(char *FileName); // Read Dict from disk + int AppendEntry(gdcmDictEntry* NewEntry); + gdcmDictEntry * GetTag(guint32 group, guint32 element); + void Print(ostream&); }; // Container for managing a set of loaded dictionaries. Sharing dictionaries // should avoid : // * reloading an allready loaded dictionary. // * having many in memory representations of the same dictionary. -typedef int DictId; -class DictSet { +#define PUBDICTNAME "DicomV3Dict" +#define PUBDICTFILENAME "../Dicts/dicomV3.dic" +typedef string DictKey; +typedef map DictSetHT; +class gdcmDictSet { private: - map dicts; - int AppendDict(Dict* NewDict); + DictSetHT dicts; + int AppendDict(gdcmDict* NewDict); public: - DictSet(); // Default constructor loads THE DICOM v3 dictionary + gdcmDictSet(void); // loads THE DICOM v3 dictionary int LoadDictFromFile(string filename); ///// QUESTION: the following function might not be thread safe !? Maybe ///// we need some mutex here, to avoid concurent creation of ///// the same dictionary !?!?! int LoadDictFromName(string filename); - int LoadAllDictFromDirectory(string directorynanme); + int LoadDictFromFile(char*, DictKey); + int LoadAllDictFromDirectory(string DirectoryName); + int LoadDicomV3Dict(void); string* GetAllDictNames(); - Dict* GetDict(string DictName); + void Print(ostream&); + gdcmDict* GetDict(DictKey DictName); + gdcmDict* GetDefaultPublicDict(void); }; // The dicom header of a Dicom file contains a set of such ELement VALUES // (when successfuly parsed against a given Dicom dictionary) class ElValue { private: - DictEntry *entry; + gdcmDictEntry *entry; guint32 LgrLueElem; // Longueur Lue // Might prove of some interest (see _ID_DCM_ELEM) // int Swap; @@ -117,24 +132,27 @@ public: guint32 LgrElem; // FIXME probably for bad reasons at parse time ! string value; // used to be char * valeurElem size_t Offset; // Offset from the begining of file for direct user access - ElValue(DictEntry*); - void SetVR(string); + ElValue(gdcmDictEntry*); + void SetVR(string); void SetLgrLue(guint32); + void SetValue(string val){ value = val; }; + string GetValue(void) { return value; }; + guint32 GetLgrElem(void) { return LgrElem; }; guint16 GetGroup(void) { return entry->GetGroup(); }; guint16 GetElement(void) { return entry->GetElement(); }; - guint32 GetLgrElem(void) { return LgrElem; }; - void SetValue(string val) { value = val; }; + string GetKey(void) { return entry->GetKey(); }; + string GetName(void) { return entry->GetName();}; }; +typedef map TagElValueHT; // Container for a set of succefully parsed ElValues. -typedef map TagHT; class ElValSet { // We need both accesses with a TagKey and the Dicentry.Name -////// QUESTION: this leads to a double storage of a single ElValue - map tagHt; - map NameHt; + TagElValueHT tagHt; + map NameHt; public: - int Add(ElValue); + int Add(ElValue*); + int Print(ostream &); }; // The various entries of the explicit value representation (VR) shall @@ -167,13 +185,14 @@ class gdcmHeader { private: // All instances share the same valur representation dictionary static VRHT *dicom_vr; - static DictSet* Dicts; // Global dictionary container - Dict* RefPubDict; // Public Dictionary - Dict* RefShaDict; // Shadow Dictionary (optional) + static gdcmDictSet* Dicts; // Global dictionary container + gdcmDict* RefPubDict; // Public Dictionary + gdcmDict* RefShaDict; // Shadow Dictionary (optional) ElValSet PubElVals; // Element Values parsed with Public Dictionary ElValSet ShaElVals; // Element Values parsed with Shadow Dictionary FileType filetype; // In order to inspect/navigate through the file + string filename; size_t taille_fich; FILE * fp; size_t offsetCourant; @@ -187,14 +206,16 @@ private: bool grPixelTrouve; size_t PixelPosition; int sw; + + void Initialise(void); void CheckSwap(void); void setAcrLibido(void); long int RecupLgr(ElValue *, int *); - guint32 SWAP_LONG(guint32); - short int SWAP_SHORT(short int); + guint32 SwapLong(guint32); + short int SwapShort(short int); void InitVRDict(void); ElValue * ReadNextElement(void); - DictEntry * IsInDicts(guint32, guint32); + gdcmDictEntry * IsInDicts(guint32, guint32); void SetAsidePixelData(ElValue*); protected: ///// QUESTION: Maybe Print is a better name than write !? @@ -203,8 +224,8 @@ protected: ///// See below for an example of how anonymize might be implemented. int anonymize(ostream&); public: - gdcmHeader(); - gdcmHeader(string filename); + void BuildHeader(void); + gdcmHeader(char* filename); ~gdcmHeader(); int SetPubDict(string filename); @@ -225,6 +246,8 @@ public: // of C/C++ vs Python). string GetPubElValRepByName(string TagName); string GetPubElValRepByNumber(guint16 group, guint16 element); + int PrintPubElVal(ostream &); + void PrintPubDict(ostream &); // Same thing with the shadow : string* GetShaTagNames(); @@ -271,7 +294,7 @@ public: // This avoid a double parsing of public part of the header when // one sets an a posteriori shadow dictionary (efficiency can be // seen a a side effect). - gdcmFile(string filename); + gdcmFile(string & filename); // For promotion (performs a deepcopy of pointed header object) gdcmFile(gdcmHeader* header); ~gdcmFile(); -- 2.45.1