pydicom.tag.BaseTag

class pydicom.tag.BaseTag[source]

Represents a DICOM element (group, element) tag.

Tags are represented as an int.

__init__()

Methods

__init__()

as_integer_ratio()

Return integer ratio.

bit_length()

Number of bits necessary to represent self in binary.

conjugate

Returns self, the complex conjugate of any int.

from_bytes(byteorder, *[, signed])

Return the integer represented by the given array of bytes.

to_bytes(length, byteorder, *[, signed])

Return an array of bytes representing an integer.

Attributes

denominator

the denominator of a rational number in lowest terms

elem

Return the tag's element number as int.

element

Return the tag's element number as int.

group

Return the tag's group number as int.

imag

the imaginary part of a complex number

is_private

Return True if the tag is private (has an odd group number).

is_private_creator

Return True if the tag is a private creator.

json_key

Return the tag value as a JSON key string 'GGGGEEEE'.

numerator

the numerator of a rational number in lowest terms

private_creator

Return the private creator tag for the given tag.

real

the real part of a complex number

property elem: int

Return the tag’s element number as int.

property element: int

Return the tag’s element number as int.

property group: int

Return the tag’s group number as int.

property is_private: bool

Return True if the tag is private (has an odd group number).

property is_private_creator: bool

Return True if the tag is a private creator.

New in version 1.1.

property json_key: str

Return the tag value as a JSON key string ‘GGGGEEEE’.

property private_creator: BaseTag

Return the private creator tag for the given tag. The result is meaningless if this is not a private tag.

New in version 2.4.