pydicom.tag.Tag(arg: Union[int, str, Tuple[int, int], pydicom.tag.BaseTag], arg2: Optional[int] = None) pydicom.tag.BaseTag[source]

Create a BaseTag.

General function for creating a BaseTag in any of the standard forms:

  • Tag(0x00100015)

  • Tag((0x10, 0x50))

  • Tag(0x0010, 0x0015)

  • Tag("PatientName")

Changed in version 1.3: Added support for creating a BaseTag using an element keyword

  • arg (int or str or 2-tuple of int) –

    • If int then either the group number or the combined group and element numbers of the tag

    • If str then the corresponding element’s keyword

    • If tuple then the (group, element) numbers as (int, int).

  • arg2 (int, optional) – The element number of the DICOM tag, required when arg only contains the group number of the tag.

Return type