Struct dicom_core::value::PixelFragmentSequence
source · pub struct PixelFragmentSequence<P> { /* private fields */ }Expand description
A sequence of pixel data fragments.
Each fragment (of data type P) is
an even-lengthed sequence of bytes
representing the encoded pixel data.
The first item of the sequence is interpreted as a basic offset table,
which is defined separately.
Implementations§
source§impl<P> PixelFragmentSequence<P>
impl<P> PixelFragmentSequence<P>
sourcepub fn new(offset_table: impl Into<C<u32>>, fragments: impl Into<C<P>>) -> Self
pub fn new(offset_table: impl Into<C<u32>>, fragments: impl Into<C<P>>) -> Self
Construct a DICOM pixel sequence sequence value from a basic offset table and a list of fragments.
Note: This function does not validate the offset table against the given fragments.
sourcepub fn new_fragments(fragments: impl Into<C<P>>) -> Self
pub fn new_fragments(fragments: impl Into<C<P>>) -> Self
Construct a DICOM pixel sequence sequence value from a list of fragments, with an empty basic offset table.
sourcepub fn fragments(&self) -> &[P]
pub fn fragments(&self) -> &[P]
Gets a reference to the pixel data fragments.
This sequence does not include the offset table.
sourcepub fn fragments_mut(&mut self) -> &mut C<P>
pub fn fragments_mut(&mut self) -> &mut C<P>
Gets a mutable reference to the pixel data fragments.
This sequence does not include the offset table.
sourcepub fn into_fragments(self) -> C<P>
pub fn into_fragments(self) -> C<P>
Retrieve the pixel data fragments, discarding the rest of the information.
This sequence does not include the offset table.
sourcepub fn into_parts(self) -> (C<u32>, C<P>)
pub fn into_parts(self) -> (C<u32>, C<P>)
Decompose the sequence into its constituent parts: the basic offset table and the pixel data fragments.
sourcepub fn offset_table(&self) -> &[u32]
pub fn offset_table(&self) -> &[u32]
Gets a reference to the encapsulated pixel data’s offset table.
sourcepub fn offset_table_mut(&mut self) -> &mut C<u32>
pub fn offset_table_mut(&mut self) -> &mut C<u32>
Gets a mutable reference to the encapsulated pixel data’s offset table.
sourcepub fn length(&self) -> Length
pub fn length(&self) -> Length
Get the value data’s length as specified by the sequence’s data element, in bytes.
This is equivalent to HasLength::length.
Trait Implementations§
source§impl<P: Clone> Clone for PixelFragmentSequence<P>
impl<P: Clone> Clone for PixelFragmentSequence<P>
source§fn clone(&self) -> PixelFragmentSequence<P>
fn clone(&self) -> PixelFragmentSequence<P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<P: Debug> Debug for PixelFragmentSequence<P>
impl<P: Debug> Debug for PixelFragmentSequence<P>
source§impl<P> DicomValueType for PixelFragmentSequence<P>
impl<P> DicomValueType for PixelFragmentSequence<P>
source§fn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
source§fn cardinality(&self) -> usize
fn cardinality(&self) -> usize
source§impl<I, P> From<PixelFragmentSequence<P>> for Value<I, P>
impl<I, P> From<PixelFragmentSequence<P>> for Value<I, P>
source§fn from(value: PixelFragmentSequence<P>) -> Self
fn from(value: PixelFragmentSequence<P>) -> Self
source§impl From<Vec<Fragments, Global>> for PixelFragmentSequence<InMemFragment>
impl From<Vec<Fragments, Global>> for PixelFragmentSequence<InMemFragment>
source§impl<P> HasLength for PixelFragmentSequence<P>
impl<P> HasLength for PixelFragmentSequence<P>
source§impl<P: PartialEq> PartialEq<PixelFragmentSequence<P>> for PixelFragmentSequence<P>
impl<P: PartialEq> PartialEq<PixelFragmentSequence<P>> for PixelFragmentSequence<P>
source§fn eq(&self, other: &PixelFragmentSequence<P>) -> bool
fn eq(&self, other: &PixelFragmentSequence<P>) -> bool
self and other values to be equal, and is used
by ==.