Skip to main content

dicom_toolkit_core/
config.rs

1//! Runtime configuration for dcmtk-rs.
2//!
3//! Provides global and per-operation configuration that mirrors DCMTK's
4//! runtime-configurable flags.
5
6/// Global DICOM configuration.
7#[derive(Debug, Clone)]
8pub struct DcmConfig {
9    /// Maximum size of a single value to load into memory (bytes).
10    /// Larger values are read on demand. Default: 4 MiB.
11    pub max_value_size: u64,
12
13    /// Whether to accept unknown (private) tags during parsing.
14    pub accept_unknown_tags: bool,
15
16    /// Whether to use the data dictionary for VR lookup during implicit VR parsing.
17    pub use_dictionary: bool,
18
19    /// Default character set when Specific Character Set (0008,0005) is absent.
20    pub default_charset: String,
21}
22
23impl Default for DcmConfig {
24    fn default() -> Self {
25        Self {
26            max_value_size: 4 * 1024 * 1024,
27            accept_unknown_tags: true,
28            use_dictionary: true,
29            default_charset: String::new(), // ASCII
30        }
31    }
32}