Trait dicom_encoding::adapters::PixelDataObject
source · pub trait PixelDataObject {
fn rows(&self) -> Option<u16>;
fn cols(&self) -> Option<u16>;
fn samples_per_pixel(&self) -> Option<u16>;
fn bits_allocated(&self) -> Option<u16>;
fn number_of_frames(&self) -> Option<u16>;
fn number_of_fragments(&self) -> Option<u32>;
fn fragment(&self, fragment: usize) -> Option<Vec<u8>>;
fn raw_pixel_data(&self) -> Option<RawPixelData>;
}Expand description
A DICOM object trait to be interpreted as pixel data.
This trait extends the concept of DICOM object
as defined in dicom_object,
in order to retrieve important pieces of the object
for pixel data decoding into images or multi-dimensional arrays.
It is defined in this crate so that
transfer syntax implementers only have to depend on dicom_encoding.
Required Methods§
sourcefn samples_per_pixel(&self) -> Option<u16>
fn samples_per_pixel(&self) -> Option<u16>
Return the SamplesPerPixel attribute or None if it is not found
sourcefn bits_allocated(&self) -> Option<u16>
fn bits_allocated(&self) -> Option<u16>
Return the BitsAllocated attribute or None if it is not set
sourcefn number_of_frames(&self) -> Option<u16>
fn number_of_frames(&self) -> Option<u16>
Return the NumberOfFrames attribute or None if it is not set
sourcefn number_of_fragments(&self) -> Option<u32>
fn number_of_fragments(&self) -> Option<u32>
Returns the number of fragments or None for native pixel data
sourcefn fragment(&self, fragment: usize) -> Option<Vec<u8>>
fn fragment(&self, fragment: usize) -> Option<Vec<u8>>
Return a specific encoded pixel fragment by index as Vec
sourcefn raw_pixel_data(&self) -> Option<RawPixelData>
fn raw_pixel_data(&self) -> Option<RawPixelData>
Should return either a byte slice/vector if native pixel data or byte fragments if encapsulated. Returns None if no pixel data is found