pydicom.datadict.keyword_for_tag

pydicom.datadict.keyword_for_tag(tag: int | str | Tuple[int, int] | BaseTag) str[source]

Return the keyword of the element corresponding to tag.

Parameters:

tag (int or str or Tuple[int, int]) – The tag for the element whose keyword is being retrieved, in any of the forms accepted by Tag().

Returns:

If the element is in the DICOM data dictionary then returns the corresponding element’s keyword, otherwise returns ''. For group length elements will always return 'GroupLength'.

Return type:

str