DICOM Tag constants and utilities.
Tags are {group, element} tuples identifying DICOM attributes.
This module provides constants for commonly used tags and lookup
functions for the full PS3.6 data dictionary.
Examples
iex> Dicom.Tag.patient_name()
{0x0010, 0x0010}
iex> Dicom.Tag.name({0x0010, 0x0010})
"PatientName"
Summary
Functions
Formats a tag as a (GGGG,EEEE) hex string.
Finds a tag by its DICOM keyword (e.g., "PatientName").
Returns true if the tag is a group length tag (element 0000).
Returns the human-readable name for a tag, or a hex string if unknown.
Parses a tag string in "(GGGG,EEEE)" or "GGGGEEEE" format.
Returns true if the tag is a private tag (odd group number).
Returns true if the tag belongs to a repeating group (50XX, 60XX, 7FXX).
Types
@type t() :: {non_neg_integer(), non_neg_integer()}
Functions
Formats a tag as a (GGGG,EEEE) hex string.
Examples
iex> Dicom.Tag.format({0x0010, 0x0010})
"(0010,0010)"
Finds a tag by its DICOM keyword (e.g., "PatientName").
Delegates to Dicom.Dictionary.Registry.find_by_keyword/1.
Examples
iex> Dicom.Tag.from_keyword("PatientName")
{:ok, {0x0010, 0x0010}}
Returns true if the tag is a group length tag (element 0000).
Returns the human-readable name for a tag, or a hex string if unknown.
Parses a tag string in "(GGGG,EEEE)" or "GGGGEEEE" format.
Examples
iex> Dicom.Tag.parse("(0010,0010)")
{:ok, {0x0010, 0x0010}}
iex> Dicom.Tag.parse("00100010")
{:ok, {0x0010, 0x0010}}
iex> Dicom.Tag.parse("invalid")
{:error, :invalid_tag_format}
Returns true if the tag is a private tag (odd group number).
Returns true if the tag belongs to a repeating group (50XX, 60XX, 7FXX).
Examples
iex> Dicom.Tag.repeating?({0x5000, 0x0010})
true
iex> Dicom.Tag.repeating?({0x0010, 0x0010})
false