Struct dicom_object::file::OpenFileOptions

source ·
#[non_exhaustive]
pub struct OpenFileOptions<D = StandardDataDictionary, T = TransferSyntaxRegistry> { /* private fields */ }
Expand description

A builder type for opening a DICOM file with additional options.

This builder exposes additional properties to configure the reading of a DICOM file.

§Example

Create a OpenFileOptions, call adaptor methods in a chain, and finish the operation with either open_file() or from_reader().

let file = OpenFileOptions::new()
    .read_until(dicom_dictionary_std::tags::PIXEL_DATA)
    .open_file("path/to/file.dcm")?;

Implementations§

source§

impl OpenFileOptions

source

pub fn new() -> Self

source§

impl<D, T> OpenFileOptions<D, T>

source

pub fn read_until(self, tag: Tag) -> Self

Set the operation to read only until the given tag is found.

The reading process ends immediately after this tag, or any other tag that is next in the standard DICOM tag ordering, is found in the object’s root data set. An element with the exact tag will be excluded from the output.

source

pub fn read_all(self) -> Self

Set the operation to read all elements of the data set to the end.

This is the default behavior.

source

pub fn read_preamble(self, option: ReadPreamble) -> Self

Set whether to read the 128-byte DICOM file preamble.

source

pub fn tranfer_syntax_index<Tr>(self, ts_index: Tr) -> OpenFileOptions<D, Tr>

Set the transfer syntax index to use when reading the file.

source

pub fn dictionary<Di>(self, dict: Di) -> OpenFileOptions<Di, T>
where Di: DataDictionary + Clone,

Set the data element dictionary to use when reading the file.

source

pub fn open_file<P>(self, path: P) -> Result<DefaultDicomObject<D>>

Open the file at the given path.

source

pub fn from_reader<R>(self, from: R) -> Result<DefaultDicomObject<D>>

Obtain a DICOM object by reading from a byte source.

This method assumes the standard file encoding structure without the preamble: file meta group, followed by the rest of the data set.

Trait Implementations§

source§

impl<D: Clone, T: Clone> Clone for OpenFileOptions<D, T>

source§

fn clone(&self) -> OpenFileOptions<D, T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<D: Debug, T: Debug> Debug for OpenFileOptions<D, T>

source§

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

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

impl<D: Default, T: Default> Default for OpenFileOptions<D, T>

source§

fn default() -> OpenFileOptions<D, T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D, T> Freeze for OpenFileOptions<D, T>
where D: Freeze, T: Freeze,

§

impl<D, T> RefUnwindSafe for OpenFileOptions<D, T>

§

impl<D, T> Send for OpenFileOptions<D, T>
where D: Send, T: Send,

§

impl<D, T> Sync for OpenFileOptions<D, T>
where D: Sync, T: Sync,

§

impl<D, T> Unpin for OpenFileOptions<D, T>
where D: Unpin, T: Unpin,

§

impl<D, T> UnwindSafe for OpenFileOptions<D, T>
where D: UnwindSafe, 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> 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<T> ToOwned for T
where T: Clone,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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