Struct dicom_object::meta::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.

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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