pub enum Value {
Show 21 variants
Empty,
Strings(Vec<String>),
PersonNames(Vec<PersonName>),
Uid(String),
Date(Vec<DicomDate>),
Time(Vec<DicomTime>),
DateTime(Vec<DicomDateTime>),
Ints(Vec<i64>),
Decimals(Vec<f64>),
U8(Vec<u8>),
U16(Vec<u16>),
I16(Vec<i16>),
U32(Vec<u32>),
I32(Vec<i32>),
U64(Vec<u64>),
I64(Vec<i64>),
F32(Vec<f32>),
F64(Vec<f64>),
Tags(Vec<Tag>),
Sequence(Vec<DataSet>),
PixelData(PixelData),
}Expand description
The value held by a DICOM data element.
Each variant corresponds to one or more DICOM VRs. Numeric string VRs
(DS, IS) are stored already decoded as f64/i64.
Variants§
Empty
No value (zero-length element).
Strings(Vec<String>)
AE, CS, LO, LT, SH, ST, UC, UR, UT — multi-valued via backslash.
PersonNames(Vec<PersonName>)
PN — person name with up to three component groups.
Uid(String)
UI — UID string.
Date(Vec<DicomDate>)
DA — date values.
Time(Vec<DicomTime>)
TM — time values.
DateTime(Vec<DicomDateTime>)
DT — datetime values.
Ints(Vec<i64>)
IS — integer string, decoded.
Decimals(Vec<f64>)
DS — decimal string, decoded.
U8(Vec<u8>)
OB, UN — raw bytes.
U16(Vec<u16>)
US, OW — raw 16-bit words (interpret by VR).
I16(Vec<i16>)
SS — signed 16-bit integers.
U32(Vec<u32>)
UL, OL — 32-bit unsigned integers.
I32(Vec<i32>)
SL — 32-bit signed integers.
U64(Vec<u64>)
UV, OV — 64-bit unsigned integers.
I64(Vec<i64>)
SV — 64-bit signed integers.
F32(Vec<f32>)
FL, OF — 32-bit floats.
F64(Vec<f64>)
FD, OD — 64-bit floats.
Tags(Vec<Tag>)
AT — attribute tag pairs.
Sequence(Vec<DataSet>)
SQ — sequence of items (datasets).
PixelData(PixelData)
Pixel data — (7FE0,0010).
Implementations§
Source§impl Value
impl Value
Sourcepub fn multiplicity(&self) -> usize
pub fn multiplicity(&self) -> usize
Returns the number of values (VM).
pub fn is_empty(&self) -> bool
Sourcepub fn as_string(&self) -> Option<&str>
pub fn as_string(&self) -> Option<&str>
Returns the first string value, if this is a Strings or Uid variant.
pub fn as_strings(&self) -> Option<&[String]>
pub fn as_u16(&self) -> Option<u16>
pub fn as_u32(&self) -> Option<u32>
pub fn as_i32(&self) -> Option<i32>
pub fn as_f64(&self) -> Option<f64>
pub fn as_bytes(&self) -> Option<&[u8]>
Sourcepub fn to_display_string(&self) -> String
pub fn to_display_string(&self) -> String
Returns a human-readable string representation (like dcmdump output).