Struct dicom_object::Tag
source · pub struct Tag(pub u16, pub u16);Expand description
The data type for DICOM data element tags.
Tags are composed by a (group, element) pair of 16-bit unsigned integers.
Aside from writing a struct expression,
a Tag may also be built by converting a (u16, u16) or a [u16; 2].
In its text form,
DICOM tags are printed by Display in the form (GGGG,EEEE),
where the group and element parts are in uppercase hexadecimal.
Moreover, its FromStr implementation
support converting strings in the following text formats into DICOM tags:
(GGGG,EEEE)GGGG,EEEEGGGGEEEE
Example
let tag: Tag = "(0010,1005)".parse()?;
assert_eq!(tag, Tag(0x0010, 0x1005));Tuple Fields§
§0: u16§1: u16Implementations§
Trait Implementations§
source§impl FromStr for Tag
impl FromStr for Tag
This parser implementation for DICOM tags accepts strictly one of the following formats:
ggggeeee- or
gggg,eeee - or
(gggg,eeee)
where gggg and eeee are the characters representing
the group part an the element part in hexadecimal,
with four characters each.
Whitespace is not excluded automatically,
and may need to be removed before-parse
depending on the context.
Lowercase and uppercase characters are allowed.
source§impl Ord for Tag
impl Ord for Tag
source§impl PartialOrd for Tag
impl PartialOrd for Tag
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more