dicom_object

Module mem

Source
Expand description

This module contains the implementation for an in-memory DICOM object.

Use InMemDicomObject for your DICOM data set construction needs. Values of this type support infallible insertion, removal, and retrieval of elements by DICOM tag, or name (keyword) with a data element dictionary look-up.

If you wish to build a complete DICOM file, you can start from an InMemDicomObject and complement it with a file meta group table (see with_meta and with_exact_meta).

§Example

A new DICOM data set can be built by providing a sequence of data elements. Insertion and removal methods are also available.

let mut obj = InMemDicomObject::from_element_iter([
    DataElement::new(tags::SOP_CLASS_UID, VR::UI, uids::COMPUTED_RADIOGRAPHY_IMAGE_STORAGE),
    DataElement::new(tags::SOP_INSTANCE_UID, VR::UI, "2.25.60156688944589400766024286894543900794"),
    // ...
]);

// continue adding elements
obj.put(DataElement::new(tags::MODALITY, VR::CS, "CR"));

In-memory DICOM objects may have a byte length recorded, if it was part of a data set sequence with explicit length. If necessary, this number can be obtained via the HasLength trait. However, any modifications made to the object will reset this length to undefined.

Structs§

  • A DICOM object that is fully contained in memory.
  • Base iterator type for an in-memory DICOM object.

Type Aliases§