DICOM P10 File Meta Information (Group 0002).
The File Meta Information header is always encoded in Explicit VR Little Endian regardless of the Transfer Syntax used for the data set.
Reference: DICOM PS3.10 Section 7.1.
Summary
Functions
Generates a P10 preamble (128 zero bytes + "DICM").
Sanitizes the preamble by zeroing it out.
Validates and skips the 128-byte preamble and "DICM" magic.
Validates the preamble content per PS3.10 Section 7.5.
Functions
@spec preamble() :: binary()
Generates a P10 preamble (128 zero bytes + "DICM").
Sanitizes the preamble by zeroing it out.
Per PS3.10 Section 7.5, the preamble can contain malicious content. This function replaces the 128-byte preamble with zeros while preserving the DICM prefix and all subsequent data.
Validates and skips the 128-byte preamble and "DICM" magic.
Returns the remaining binary after the preamble, or an error.
@spec validate_preamble(binary()) :: :ok | {:warning, :non_standard_preamble} | {:error, :invalid_preamble}
Validates the preamble content per PS3.10 Section 7.5.
Returns:
:okif preamble is all zeros or starts with recognized dual-format magic (TIFF){:warning, :non_standard_preamble}if preamble contains non-standard content{:error, :invalid_preamble}if the binary is not a valid DICOM file