Enum dicom_core::value::Value [−][src]
pub enum Value<I = EmptyObject, P = [u8; 0]> {
Primitive(PrimitiveValue),
Sequence {
items: C<I>,
size: Length,
},
PixelSequence {
offset_table: C<u32>,
fragments: C<P>,
},
}Expand description
Representation of a full DICOM value, which may be either primitive or another DICOM object.
I is the complex type for nest data set items, which should usually
implement HasLength.
P is the encapsulated pixel data provider, which should usually
implement AsRef<[u8]>.
Variants
Primitive(PrimitiveValue)Primitive value.
Tuple Fields of Primitive
A complex sequence of items.
An encapsulated pixel data sequence.
Fields of PixelSequence
Implementations
Construct a full DICOM data set sequence value from a list of items and length.
Construct a DICOM value from a primitive value.
This is equivalent to Value::from in behavior,
except that suitable type parameters are specified
instead of inferred.
Obtain the number of individual values. In a primitive, this is the number of individual elements in the value. In a sequence item, this is the number of items. In a pixel sequence, this is currently set to 1 regardless of the number of compressed fragments or frames.
Gets a reference to the primitive value.
Retrieves the primitive value.
Retrieves the items.
Convert the full primitive value into a single string.
If the value contains multiple strings, they are concatenated
(separated by the standard DICOM value delimiter '\\')
into an owned string.
Returns an error if the value is not primitive.
Convert the full primitive value into a clean string.
Returns an error if the value is not primitive.
Convert the full primitive value into a sequence of strings.
If the value is a primitive, it will be converted into
a vector of strings as described in PrimitiveValue::to_multi_str.
Returns an error if the value is not primitive.
Convert the full primitive value into raw bytes.
String values already encoded with the Str and Strs variants
are provided in UTF-8.
Returns an error if the value is not primitive.
pub fn to_int<T>(&self) -> Result<T, ConvertValueError> where
T: Clone,
T: NumCast,
T: FromStr<Err = ParseIntError>,
pub fn to_int<T>(&self) -> Result<T, ConvertValueError> where
T: Clone,
T: NumCast,
T: FromStr<Err = ParseIntError>,
Retrieve and convert the primitive value into an integer.
If the value is a primitive, it will be converted into
an integer as described in PrimitiveValue::to_int.
pub fn to_multi_int<T>(&self) -> Result<Vec<T>, ConvertValueError> where
T: Clone,
T: NumCast,
T: FromStr<Err = ParseIntError>,
pub fn to_multi_int<T>(&self) -> Result<Vec<T>, ConvertValueError> where
T: Clone,
T: NumCast,
T: FromStr<Err = ParseIntError>,
Retrieve and convert the primitive value into a sequence of integers.
If the value is a primitive, it will be converted into a vector of integers as described in PrimitiveValue::to_multi_int.
Retrieve and convert the primitive value into a single-precision floating point number.
If the value is a primitive, it will be converted into
a number as described in PrimitiveValue::to_float32.
Retrieve and convert the primitive value into a sequence of single-precision floating point numbers.
If the value is a primitive, it will be converted into
a vector of numbers as described in PrimitiveValue::to_multi_float32.
Retrieve and convert the primitive value into a double-precision floating point number.
If the value is a primitive, it will be converted into
a number as described in PrimitiveValue::to_float64.
Retrieve and convert the primitive value into a sequence of double-precision floating point numbers.
If the value is a primitive, it will be converted into
a vector of numbers as described in PrimitiveValue::to_multi_float64.
Retrieve and convert the primitive value into a DicomDate.
If the value is a primitive, it will be converted into
a DicomDate as described in PrimitiveValue::to_date.
Retrieve and convert the primitive value into a sequence of DicomDates.
If the value is a primitive, it will be converted into
a vector of DicomDate as described in PrimitiveValue::to_multi_date.
Retrieve and convert the primitive value into a DicomTime.
If the value is a primitive, it will be converted into
a DicomTime as described in PrimitiveValue::to_time.
Retrieve and convert the primitive value into a sequence of DicomTimes.
If the value is a primitive, it will be converted into
a vector of DicomTime as described in PrimitiveValue::to_multi_time.
pub fn to_datetime(
&self,
default_offset: FixedOffset
) -> Result<DicomDateTime, ConvertValueError>
pub fn to_datetime(
&self,
default_offset: FixedOffset
) -> Result<DicomDateTime, ConvertValueError>
Retrieve and convert the primitive value into a DicomDateTime.
If the value is a primitive, it will be converted into
a DateTime as described in PrimitiveValue::to_datetime.
pub fn to_multi_datetime(
&self,
default_offset: FixedOffset
) -> Result<Vec<DicomDateTime>, ConvertValueError>
pub fn to_multi_datetime(
&self,
default_offset: FixedOffset
) -> Result<Vec<DicomDateTime>, ConvertValueError>
Retrieve and convert the primitive value into a sequence of DicomDateTimes.
If the value is a primitive, it will be converted into
a vector of DicomDateTime as described in PrimitiveValue::to_multi_datetime.
Retrieve and convert the primitive value into a DateRange.
If the value is a primitive, it will be converted into
a DateRange as described in PrimitiveValue::to_date_range.
Retrieve and convert the primitive value into a TimeRange.
If the value is a primitive, it will be converted into
a TimeRange as described in PrimitiveValue::to_time_range.
pub fn to_datetime_range(
&self,
offset: FixedOffset
) -> Result<DateTimeRange, ConvertValueError>
pub fn to_datetime_range(
&self,
offset: FixedOffset
) -> Result<DateTimeRange, ConvertValueError>
Retrieve and convert the primitive value into a DateTimeRange.
If the value is a primitive, it will be converted into
a DateTimeRange as described in PrimitiveValue::to_datetime_range.
Retrieves the primitive value as a DICOM tag.
Get a single string value.
If it contains multiple strings, only the first one is returned.
An error is returned if the variant is not compatible.
To enable conversions of other variants to a textual representation,
see to_str() instead.
Get the inner sequence of string values
if the variant is either Str or Strs.
An error is returned if the variant is not compatible.
To enable conversions of other variants to a textual representation,
see to_str() instead.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Get a single value of the requested type.
If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.
Get a sequence of values of the requested type without copying.
An error is returned if the variant is not compatible.
Trait Implementations
Retrieve the specific type of this value.
Retrieve the number of elements contained in the DICOM value. Read more
Performs the conversion.
Auto Trait Implementations
impl<I, P> RefUnwindSafe for Value<I, P> where
I: RefUnwindSafe,
P: RefUnwindSafe,
impl<I, P> UnwindSafe for Value<I, P> where
I: UnwindSafe + RefUnwindSafe,
P: UnwindSafe + RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more