# `Dicom.P10.FileMeta`
[🔗](https://github.com/Balneario-de-Cofrentes/dicom/blob/v0.9.1/lib/dicom/p10/file_meta.ex#L1)

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.

# `preamble`

```elixir
@spec preamble() :: binary()
```

Generates a P10 preamble (128 zero bytes + "DICM").

# `sanitize_preamble`

```elixir
@spec sanitize_preamble(binary()) :: {:ok, binary()} | {:error, :invalid_preamble}
```

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.

# `skip_preamble`

```elixir
@spec skip_preamble(binary()) :: {:ok, binary()} | {:error, :invalid_preamble}
```

Validates and skips the 128-byte preamble and "DICM" magic.

Returns the remaining binary after the preamble, or an error.

# `validate_preamble`

```elixir
@spec validate_preamble(binary()) ::
  :ok | {:warning, :non_standard_preamble} | {:error, :invalid_preamble}
```

Validates the preamble content per PS3.10 Section 7.5.

Returns:
- `:ok` if 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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
