We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38fce1e commit 0b6836aCopy full SHA for 0b6836a
src/dicom-data.c
@@ -1223,6 +1223,11 @@ char *dcm_element_value_to_string(const DcmElement *element)
1223
result = dcm_printf_append(result,
1224
"%"PRIu64,
1225
(uint64_t)i);
1226
+ } else if (element->vr == DCM_VR_AT) {
1227
+ // a ushort with half of a tag
1228
+ result = dcm_printf_append(result,
1229
+ "%04x",
1230
+ i);
1231
} else {
1232
result = dcm_printf_append(result, "%"PRId64, i);
1233
}
@@ -1271,6 +1276,23 @@ char *dcm_element_value_to_string(const DcmElement *element)
1271
1276
1272
1277
1273
1278
1279
+ // AT is a two-element ushort array holding a DICOM tag ... print the tag
1280
+ // name if we can
1281
+ if (element->vr == DCM_VR_AT && element->vm == 2) {
1282
+ int64_t grp;
1283
+ int64_t ele;
1284
+ (void) dcm_element_get_value_integer(NULL, element, 0, &grp);
1285
+ (void) dcm_element_get_value_integer(NULL, element, 1, &ele);
1286
+
1287
+ uint32_t tag = grp << 16 | ele;
1288
1289
+ const char *keyword = dcm_dict_keyword_from_tag(tag);
1290
1291
+ if (keyword) {
1292
+ result = dcm_printf_append(result, " (%s)", keyword);
1293
+ }
1294
1295
1274
1296
return result;
1275
1297
1298
src/dicom-dict.c
@@ -54,7 +54,7 @@ struct _DcmVRTable_hash_entry {
54
static const struct _DcmVRTable vr_table[] = {
55
{DCM_VR_AE, "AE", DCM_VR_CLASS_STRING_MULTI, 0, DCM_CAPACITY_AE, 2},
56
{DCM_VR_AS, "AS", DCM_VR_CLASS_STRING_SINGLE, 0, DCM_CAPACITY_AS, 2},
57
- {DCM_VR_AT, "AT", DCM_VR_CLASS_STRING_MULTI, 0, DCM_CAPACITY_AT, 2},
+ {DCM_VR_AT, "AT", DCM_VR_CLASS_NUMERIC_INTEGER, 2, DCM_CAPACITY_AT, 2},
58
{DCM_VR_CS, "CS", DCM_VR_CLASS_STRING_MULTI, 0, DCM_CAPACITY_CS, 2},
59
{DCM_VR_DA, "DA", DCM_VR_CLASS_STRING_SINGLE, 0, DCM_CAPACITY_DA, 2},
60
{DCM_VR_DS, "DS", DCM_VR_CLASS_STRING_MULTI, 0, DCM_CAPACITY_DS, 2},
src/dicom-file.c
@@ -1275,7 +1275,7 @@ static bool print_element_create(DcmError **error,
filehandle->indent * 2,
" ",
(tag & 0xffff0000) >> 16,
- tag >> 16);
+ tag & 0xffff);
if (dcm_is_public_tag(tag)) {
printf("%s ", dcm_dict_keyword_from_tag(tag));
src/pdicom.h
@@ -67,6 +67,7 @@ int dcm_dict_vr_header_length(DcmVR vr);
67
68
#define DCM_SWITCH_NUMERIC(VR, OPERATION) \
69
switch (VR) { \
70
+ case DCM_VR_AT: OPERATION(uint16_t); break; \
71
case DCM_VR_FL: OPERATION(float); break; \
72
case DCM_VR_FD: OPERATION(double); break; \
73
case DCM_VR_SL: OPERATION(int32_t); break; \
0 commit comments