Skip to main content

FileDicomObject

Struct FileDicomObject 

Source
pub struct FileDicomObject<T> { /* private fields */ }
Expand description

A DICOM object with its accompanying File Meta Information.

Implementations§

Source§

impl<T> FileDicomObject<T>

Source

pub fn meta(&self) -> &FileMetaTable

Source

pub fn meta_mut(&mut self) -> &mut FileMetaTable

Source

pub fn into_inner(self) -> T

Source§

impl FileDicomObject<InMemDicomObject>

Source

pub fn new_empty_with_meta(meta: FileMetaTable) -> Self

Construct a new, empty object already carrying the given meta table.

Source

pub fn put_str(&mut self, tag: Tag, vr: VR, value: impl Into<String>)

Insert or replace a text element by tag and VR, creating it if absent.

Source

pub fn open_file(path: impl AsRef<Path>) -> Result<Self, ReadError>

Read a Part 10 file (128-byte preamble + “DICM” magic + meta group + data set) from path.

Source

pub fn from_reader(source: impl Read) -> Result<Self, ReadError>

Read a Part 10 object (128-byte preamble + “DICM” magic + meta group + data set) from any Read source.

Source

pub fn write_to_file(&self, path: impl AsRef<Path>) -> Result<(), WriteError>

Write this object as a full Part 10 file (preamble + “DICM” magic + meta group + data set) to path.

Source

pub fn write_all(&self, to: impl Write) -> Result<(), WriteError>

Write this object as a full Part 10 stream (preamble + “DICM” magic + meta group + data set) to any Write sink.

Source

pub fn write_all_with_pixel_data<W, E, F>( &self, to: W, write_pixel_data: F, ) -> Result<(), E>
where W: Write, E: From<WriteError>, F: for<'w> FnOnce(&mut DataSetWriter<Box<dyn Write + 'w>, DynEncoder<'w, Box<dyn Write + 'w>>>, u64) -> Result<(), E>,

Write this object as a full Part 10 stream, delegating (7FE0,0010) PixelData to write_pixel_data at its exact tag-order position. The second argument passed to the closure is the byte offset within to where the data set starts (right after the Part 10 preamble + File Meta Information).

Trait Implementations§

Source§

impl<T: Clone> Clone for FileDicomObject<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for FileDicomObject<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: PartialEq> PartialEq for FileDicomObject<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PixelDataObject for FileDicomObject<InMemDicomObject>

Source§

fn transfer_syntax_uid(&self) -> &str

Return the object’s transfer syntax UID.
Source§

fn rows(&self) -> Option<u16>

Return the Rows, or None if it is not found
Source§

fn cols(&self) -> Option<u16>

Return the Columns, or None if it is not found
Source§

fn samples_per_pixel(&self) -> Option<u16>

Return the Samples Per Pixel, or None if it is not found
Source§

fn bits_allocated(&self) -> Option<u16>

Return the Bits Allocated, or None if it is not defined
Source§

fn bits_stored(&self) -> Option<u16>

Return the Bits Stored, or None if it is not defined
Source§

fn photometric_interpretation(&self) -> Option<&str>

Return the Photometric Interpretation, with trailing whitespace removed, or None if it is not defined
Source§

fn number_of_frames(&self) -> Option<u32>

Return the Number Of Frames, or None if it is not defined
Source§

fn number_of_fragments(&self) -> Option<u32>

Returns the Number of Fragments, or None for native pixel data
Source§

fn fragment(&self, fragment: usize) -> Option<Cow<'_, [u8]>>

Return a specific encoded pixel fragment by index (where 0 is the first fragment after the basic offset table) as a Cow<[u8]>, or None if no such fragment is available. Read more
Source§

fn offset_table(&self) -> Option<Cow<'_, [u32]>>

Return the object’s offset table, or None if no offset table is available.
Source§

fn raw_pixel_data(&self) -> Option<RawPixelData>

Should return either a byte slice/vector if the pixel data is native or the list of byte fragments and offset table if encapsulated. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for FileDicomObject<T>

Auto Trait Implementations§

§

impl<T> Forget for FileDicomObject<T>

§

impl<T> Freeze for FileDicomObject<T>
where T: Freeze,

§

impl<T> Move for FileDicomObject<T>

§

impl<T> RefUnwindSafe for FileDicomObject<T>
where T: RefUnwindSafe,

§

impl<T> Send for FileDicomObject<T>
where T: Send,

§

impl<T> Sync for FileDicomObject<T>
where T: Sync,

§

impl<T> Unpin for FileDicomObject<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for FileDicomObject<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for FileDicomObject<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more