dcm4rs 0.1.0

DICOM 数据模型与数据字典
Documentation
//! Core DICOM data model.
//!
//! Three constraints shape this crate:
//!
//! 1. **Stored as-is**: element values are kept as the raw bytes defined by the standard; number
//!    and text interpretation is deferred until read time. Data under any transfer syntax
//!    (explicit/implicit VR, big endian, and whatever is added later) can therefore be written
//!    back byte for byte, and the parser never has to guess.
//! 2. **Explicit endianness**: numeric decoding always takes an [`Endian`]; there is no hidden
//!    global byte-order state.
//! 3. **Zero dependencies**: `dcm4rs` depends on no third-party crate, so it can be embedded in
//!    long-lived products such as a PACS.
//!
//! ```
//! use dcm4rs::{DataSet, Tag, Value, Vr};
//!
//! let mut ds = DataSet::new();
//! ds.set(Tag::new(0x0010, 0x0010), Vr::Pn, Value::from_str("Doe^John"));
//! ds.set(Tag::new(0x0028, 0x0010), Vr::Us, Value::from_u16s(&[512]));
//!
//! assert_eq!(ds.string(Tag::new(0x0010, 0x0010)).unwrap(), "Doe^John");
//! assert_eq!(ds.u16(Tag::new(0x0028, 0x0010)).unwrap(), 512);
//! ```

#![forbid(unsafe_code)]
#![deny(rust_2018_idioms)]
#![warn(missing_docs)]

mod dataset;
mod element;
mod endian;
mod error;
mod tag;
mod value;
mod vr;

pub mod dictionary;

pub use dataset::DataSet;
pub use element::Element;
pub use endian::Endian;
pub use error::{Error, Result};
pub use tag::Tag;
pub use value::Value;
pub use vr::Vr;