]> Creatis software - gdcm.git/blob - src/gdcmVR.cxx
* Memory link hunt (by using valgrind --leak-check=yes PrintHeader).
[gdcm.git] / src / gdcmVR.cxx
1 // gdcmVR.cxx
2
3 #include "gdcmVR.h"
4 #include "gdcmUtil.h"
5
6 gdcmVR::gdcmVR () {
7    // NOTE: making the affectation directely to dicom_vr instead of passing
8    //       through an apparently unncessary local variable vr, crashes with
9    //       gcc... Beware.
10    VRHT *vr = new VRHT;
11    (*vr)["AE"] = "Application Entity";    // At most 16 bytes
12    (*vr)["AS"] = "Age String";            // Exactly 4 bytes
13    (*vr)["AT"] = "Attribute Tag";         // 2 16-bit unsigned short integers
14    (*vr)["CS"] = "Code String";           // At most 16 bytes
15    (*vr)["DA"] = "Date";                  // Exactly 8 bytes
16    (*vr)["DS"] = "Decimal String";        // At most 16 bytes
17    (*vr)["DT"] = "Date Time";             // At most 26 bytes
18    (*vr)["FL"] = "Floating Point Single"; // 32-bit IEEE 754:1985 float
19    (*vr)["FD"] = "Floating Point Double"; // 64-bit IEEE 754:1985 double
20    (*vr)["IS"] = "Integer String";        // At most 12 bytes
21    (*vr)["LO"] = "Long String";           // At most 64 chars
22    (*vr)["LT"] = "Long Text";             // At most 10240 chars
23    (*vr)["OB"] = "Other Byte String";     // String of bytes (vr independant)
24    (*vr)["OW"] = "Other Word String";     // String of 16-bit words (vr dep)
25    (*vr)["PN"] = "Person Name";           // At most 64 chars
26    (*vr)["SH"] = "Short String";          // At most 16 chars
27    (*vr)["SL"] = "Signed Long";           // Exactly 4 bytes
28    (*vr)["SQ"] = "Sequence of Items";     // Not Applicable
29    (*vr)["SS"] = "Signed Short";          // Exactly 2 bytes
30    (*vr)["ST"] = "Short Text";            // At most 1024 chars
31    (*vr)["TM"] = "Time";                  // At most 16 bytes
32    (*vr)["UI"] = "Unique Identifier";     // At most 64 bytes
33    (*vr)["UL"] = "Unsigned Long ";        // Exactly 4 bytes
34    (*vr)["UN"] = "Unknown";               // Any length of bytes
35    (*vr)["US"] = "Unsigned Short ";       // Exactly 2 bytes
36    (*vr)["UT"] = "Unlimited Text";        // At most 2^32 -1 chars
37    dicom_vr = vr;
38 }
39
40 gdcmVR::~gdcmVR() {
41    dicom_vr->clear();
42    delete dicom_vr;
43 }
44
45 int gdcmVR::Count(VRKey key) {
46    return dicom_vr->count(key);
47 }