#[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<D, T> OpenFileOptions<D, T>
impl<D, T> OpenFileOptions<D, T>
Sourcepub fn read_until(self, tag: Tag) -> Self
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.
Sourcepub fn read_all(self) -> Self
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.
Sourcepub fn read_preamble(self, option: ReadPreamble) -> Self
pub fn read_preamble(self, option: ReadPreamble) -> Self
Set whether to read the 128-byte DICOM file preamble.
Sourcepub fn odd_length_strategy(self, option: OddLengthStrategy) -> Self
pub fn odd_length_strategy(self, option: OddLengthStrategy) -> Self
Set how data elements with an odd length should be handled.
Sourcepub fn tranfer_syntax_index<Tr>(self, ts_index: Tr) -> OpenFileOptions<D, Tr>where
Tr: TransferSyntaxIndex,
pub fn tranfer_syntax_index<Tr>(self, ts_index: Tr) -> OpenFileOptions<D, Tr>where
Tr: TransferSyntaxIndex,
Set the transfer syntax index to use when reading the file.
Sourcepub fn dictionary<Di>(self, dict: Di) -> OpenFileOptions<Di, T>where
Di: DataDictionary + Clone,
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.
Sourcepub fn open_file<P>(self, path: P) -> Result<DefaultDicomObject<D>>
pub fn open_file<P>(self, path: P) -> Result<DefaultDicomObject<D>>
Open the file at the given path.
Sourcepub fn from_reader<R>(self, from: R) -> Result<DefaultDicomObject<D>>
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>
impl<D: Clone, T: Clone> Clone for OpenFileOptions<D, T>
Source§fn clone(&self) -> OpenFileOptions<D, T>
fn clone(&self) -> OpenFileOptions<D, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<D, T> Freeze for OpenFileOptions<D, T>
impl<D, T> RefUnwindSafe for OpenFileOptions<D, T>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<D, T> Send for OpenFileOptions<D, T>
impl<D, T> Sync for OpenFileOptions<D, T>
impl<D, T> Unpin for OpenFileOptions<D, T>
impl<D, T> UnwindSafe for OpenFileOptions<D, T>where
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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