1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! DICOM data model and file I/O.
//!
//! Four 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. **Lean dependencies**: character set decoding uses `encoding_rs`; JPEG decoding uses
//! `zune-jpeg` behind the default `pixel-jpeg` feature, JPEG-LS uses `charls` behind the
//! `pixel-jpegls` feature, JPEG 2000 uses `jpeg2k` (with the pure-Rust `openjp2` port)
//! behind `pixel-j2k`, JPEG XL uses `jxl-oxide` behind `pixel-jxl`, and further codecs stay
//! feature-gated, so `dcm4rs` stays embeddable in long-lived products such as a PACS.
//! 4. **Canonical writing**: sequences are written with defined lengths and group length
//! elements are dropped, so a data set read from an undefined-length file comes back
//! canonicalized while decoded content stays identical.
//!
//! ```
//! 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);
//!
//! let syntax = dcm4rs::TransferSyntax::ExplicitVrLittleEndian;
//! let bytes = ds.write(syntax).unwrap();
//! assert_eq!(DataSet::read(&bytes, syntax).unwrap(), ds);
//! ```
pub use Charset;
pub use DataSet;
pub use ;
pub use Element;
pub use Endian;
pub use ;
pub use DicomFile;
pub use ;
pub use PrivateBlock;
pub use PrivateDictionary;
pub use ReadOptions;
pub use DeferredElement;
pub use Tag;
pub use TransferSyntax;
pub use Uid;
pub use Value;
pub use ;
pub use Vr;