dicom_object::meta

Struct FileMetaTable

Source
pub struct FileMetaTable {
    pub information_group_length: u32,
    pub information_version: [u8; 2],
    pub media_storage_sop_class_uid: String,
    pub media_storage_sop_instance_uid: String,
    pub transfer_syntax: String,
    pub implementation_class_uid: String,
    pub implementation_version_name: Option<String>,
    pub source_application_entity_title: Option<String>,
    pub sending_application_entity_title: Option<String>,
    pub receiving_application_entity_title: Option<String>,
    pub private_information_creator_uid: Option<String>,
    pub private_information: Option<Vec<u8>>,
}
Expand description

DICOM File Meta Information Table.

This data type contains the relevant parts of the file meta information table, as specified in part 6, chapter 7 of the standard.

Creating a new file meta table from scratch is more easily done using a FileMetaTableBuilder. When modifying the struct’s public fields, it is possible to update the information group length through method update_information_group_length.

Fields§

§information_group_length: u32

File Meta Information Group Length

§information_version: [u8; 2]

File Meta Information Version

§media_storage_sop_class_uid: String

Media Storage SOP Class UID

§media_storage_sop_instance_uid: String

Media Storage SOP Instance UID

§transfer_syntax: String

Transfer Syntax UID

§implementation_class_uid: String

Implementation Class UID

§implementation_version_name: Option<String>

Implementation Version Name

§source_application_entity_title: Option<String>

Source Application Entity Title

§sending_application_entity_title: Option<String>

Sending Application Entity Title

§receiving_application_entity_title: Option<String>

Receiving Application Entity Title

§private_information_creator_uid: Option<String>

Private Information Creator UID

§private_information: Option<Vec<u8>>

Private Information

Implementations§

Source§

impl FileMetaTable

Source

pub fn from_reader<R: Read>(file: R) -> Result<Self, Error>

Construct a file meta group table by parsing a DICOM data set from a reader.

Source

pub fn transfer_syntax(&self) -> &str

Getter for the transfer syntax UID, with trailing characters already excluded.

Source

pub fn media_storage_sop_instance_uid(&self) -> &str

Getter for the media storage SOP instance UID, with trailing characters already excluded.

Source

pub fn media_storage_sop_class_uid(&self) -> &str

Getter for the media storage SOP class UID, with trailing characters already excluded.

Source

pub fn implementation_class_uid(&self) -> &str

Getter for the implementation class UID, with trailing characters already excluded.

Source

pub fn private_information_creator_uid(&self) -> Option<&str>

Getter for the private information creator UID, with trailing characters already excluded.

Source

pub fn set_transfer_syntax<D, R, W>(&mut self, ts: &TransferSyntax<D, R, W>)

Set the file meta table’s transfer syntax according to the given transfer syntax descriptor.

This replaces the table’s transfer syntax UID to the given transfer syntax, without padding to even length. The information group length field is automatically recalculated.

Source

pub fn update_information_group_length(&mut self)

Calculate the expected file meta group length according to the file meta attributes currently set, and assign it to the field information_group_length.

Source

pub fn into_element_iter( self, ) -> impl Iterator<Item = DataElement<EmptyObject, [u8; 0]>>

Create an iterator over the defined data elements of the file meta group, consuming the file meta table.

See to_element_iter for a version which copies the element from the table.

Source

pub fn to_element_iter( &self, ) -> impl Iterator<Item = DataElement<EmptyObject, [u8; 0]>> + '_

Create an iterator of data elements copied from the file meta group.

See into_element_iter for a version which consumes the table.

Source

pub fn write<W: Write>(&self, writer: W) -> Result<(), Error>

Trait Implementations§

Source§

impl ApplyOp for FileMetaTable

Source§

fn apply(&mut self, op: AttributeOp) -> ApplyResult

Apply the given attribute operation on this file meta information table.

See the dicom_core::ops module for more information.

Source§

type Err = ApplyError

The operation error type
Source§

impl Clone for FileMetaTable

Source§

fn clone(&self) -> FileMetaTable

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 Debug for FileMetaTable

Source§

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

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

impl PartialEq for FileMetaTable

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FileMetaTable

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

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

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