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 .open_file()
.
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 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>>where
P: AsRef<Path>,
D: DataDictionary + Clone,
T: TransferSyntaxIndex,
pub fn open_file<P>(self, path: P) -> Result<DefaultDicomObject<D>>where
P: AsRef<Path>,
D: DataDictionary + Clone,
T: TransferSyntaxIndex,
Open the file at the given path.
sourcepub fn from_reader<R>(self, from: R) -> Result<DefaultDicomObject<D>>where
R: Read,
D: DataDictionary + Clone,
T: TransferSyntaxIndex,
pub fn from_reader<R>(self, from: R) -> Result<DefaultDicomObject<D>>where
R: Read,
D: DataDictionary + Clone,
T: TransferSyntaxIndex,
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 more