DICOM Tags
- pumpia.file_handling.dicom_tags.get_tag(dicom_image: Dataset | DataElement, tag: Tag, frame: int | None = None) → DataElement
Returns the dicom element from the pydicom Dataset defined by tag. If the Dataset is a stack then the frame can be provided for frame specific elements.
- Parameters:
dicom_image (Dataset) – pydicom Dataset to be searched
tag (Tag) – tag of element to be returned
frame (int, optional) – frame number (starting at 1) if relevant, by default None
- Returns:
pydicom Dataelement of the provided tag. Use DataElement.value attribute to get the value of the element.
- Return type:
DataElement
- Raises:
KeyError – raised if an element is not found.
- class pumpia.file_handling.dicom_tags.Tag(name: str, keyword: str, group: int, element: int, links: list[~pumpia.file_handling.dicom_tags.bases.TagLink] = <factory>, alternative_tags: list[tuple[int, int]] = <factory>)
dataclass representing a dicom tag
- Parameters:
name (str) – the name of the tag as defined in the dicom standards.
keyword (str) – the keyword of the tag as defined in the dicom standards.
group (int) – the group of the dicom tag
element (int) – the element of the dicom tag
links (list[TagLink]) – a list of TagLinks that hold any sequences the tag may be part of.
alternative_tags (list[tuple[int, int]]) – a list of alternative tuples that could represent this tag
- name
- Type:
str
- keyword
- Type:
str
- group
- Type:
int
- element
- Type:
int
- links
- Type:
list[TagLink]
- alternative_tags
- Type:
list[tuple[int, int]]
- as_tuple
This tag as a tuple of (group, element).
- Type:
list[tuple[int, int]]
- get() → tuple[int, int]
return the dicom tag as a tuple of (group, element).
pumpia.file_handling.dicom_tags.DicomTags
Module containing all DICOM Tags.
pumpia.file_handling.dicom_tags.XRAYTags
Module containing X-ray DICOM Tags.
pumpia.file_handling.dicom_tags.CTTags
Module containing CT DICOM Tags.
pumpia.file_handling.dicom_tags.NucMedTags
Module containing Nuclear Medicine DICOM Tags.
pumpia.file_handling.dicom_tags.MRTags
Module containing MRI DICOM Tags.
pumpia.file_handling.dicom_tags.USTags
Module containing Ultrasound DICOM Tags.