pub struct FileDicomObject<T> { /* private fields */ }Expand description
A DICOM object with its accompanying File Meta Information.
Implementations§
Source§impl<T> FileDicomObject<T>
impl<T> FileDicomObject<T>
pub fn meta(&self) -> &FileMetaTable
pub fn meta_mut(&mut self) -> &mut FileMetaTable
pub fn into_inner(self) -> T
Source§impl FileDicomObject<InMemDicomObject>
impl FileDicomObject<InMemDicomObject>
Sourcepub fn new_empty_with_meta(meta: FileMetaTable) -> Self
pub fn new_empty_with_meta(meta: FileMetaTable) -> Self
Construct a new, empty object already carrying the given meta table.
Sourcepub fn put_str(&mut self, tag: Tag, vr: VR, value: impl Into<String>)
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.
Sourcepub fn open_file(path: impl AsRef<Path>) -> Result<Self, ReadError>
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.
Sourcepub fn from_reader(source: impl Read) -> Result<Self, ReadError>
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.
Sourcepub fn write_to_file(&self, path: impl AsRef<Path>) -> Result<(), WriteError>
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.
Sourcepub fn write_all(&self, to: impl Write) -> Result<(), WriteError>
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.
Sourcepub 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>,
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>
impl<T: Clone> Clone for FileDicomObject<T>
Source§impl<T: Debug> Debug for FileDicomObject<T>
impl<T: Debug> Debug for FileDicomObject<T>
Source§impl<T: PartialEq> PartialEq for FileDicomObject<T>
impl<T: PartialEq> PartialEq for FileDicomObject<T>
Source§impl PixelDataObject for FileDicomObject<InMemDicomObject>
impl PixelDataObject for FileDicomObject<InMemDicomObject>
Source§fn transfer_syntax_uid(&self) -> &str
fn transfer_syntax_uid(&self) -> &str
Source§fn samples_per_pixel(&self) -> Option<u16>
fn samples_per_pixel(&self) -> Option<u16>
None if it is not foundSource§fn bits_allocated(&self) -> Option<u16>
fn bits_allocated(&self) -> Option<u16>
None if it is not definedSource§fn bits_stored(&self) -> Option<u16>
fn bits_stored(&self) -> Option<u16>
None if it is not definedSource§fn photometric_interpretation(&self) -> Option<&str>
fn photometric_interpretation(&self) -> Option<&str>
None if it is not definedSource§fn number_of_frames(&self) -> Option<u32>
fn number_of_frames(&self) -> Option<u32>
None if it is not definedSource§fn number_of_fragments(&self) -> Option<u32>
fn number_of_fragments(&self) -> Option<u32>
None for native pixel dataSource§fn offset_table(&self) -> Option<Cow<'_, [u32]>>
fn offset_table(&self) -> Option<Cow<'_, [u32]>>
None if no offset table is available.Source§fn raw_pixel_data(&self) -> Option<RawPixelData>
fn raw_pixel_data(&self) -> Option<RawPixelData>
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> 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§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