@@ -304,6 +304,7 @@ static const struct _DcmAttribute attribute_table[] = {
304304 {0X00041512 , DCM_VR_TAG_UI , "ReferencedTransferSyntaxUIDInFile" },
305305 {0X0004151A , DCM_VR_TAG_UI , "ReferencedRelatedGeneralSOPClassUIDInFile" },
306306 {0X00041600 , DCM_VR_TAG_UL , "NumberOfReferences" },
307+ {0X00080000 , DCM_VR_TAG_UL , "GenericGroupLength" },
307308 {0X00080001 , DCM_VR_TAG_UL , "LengthToEnd" },
308309 {0X00080005 , DCM_VR_TAG_CS , "SpecificCharacterSet" },
309310 {0X00080006 , DCM_VR_TAG_SQ , "LanguageCodeSequence" },
@@ -5281,6 +5282,13 @@ static const struct _DcmAttribute *attribute_from_tag(uint32_t tag)
52815282
52825283 dcm_init ();
52835284
5285+ // tags with element number 0 are generic group length tags ... map all of
5286+ // these (except 0000,0000) to tag 0008,0000 (GenericGroupLength)
5287+ if (tag != 0 &&
5288+ (tag & 0xffff ) == 0 ) {
5289+ tag = 0x00080000 ;
5290+ }
5291+
52845292 HASH_FIND_INT (attribute_from_tag_dict , & tag , entry );
52855293
52865294 return (const struct _DcmAttribute * )entry ;
@@ -5313,12 +5321,11 @@ DcmVR dcm_vr_from_tag(uint32_t tag)
53135321{
53145322 const struct _DcmAttribute * attribute ;
53155323
5316- if ((attribute = attribute_from_tag (tag )) &&
5317- dcm_dict_str_from_vr ((DcmVR ) attribute -> vr_tag )) {
5318- return (DcmVR ) attribute -> vr_tag ;
5324+ if (!(attribute = attribute_from_tag (tag ))) {
5325+ return DCM_VR_ERROR ;
53195326 }
53205327
5321- return DCM_VR_ERROR ;
5328+ return ( DcmVR ) attribute -> vr_tag ;
53225329}
53235330
53245331
0 commit comments