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

DICOM P10 file writer.

Serializes a `Dicom.DataSet` to DICOM Part 10 binary format.
File Meta Information is always written in Explicit VR Little Endian.
Pixel Data must already match the selected transfer syntax; the writer
validates that relationship but does not reinterpret raw Pixel Data bytes.

Auto-populates required Type 1 File Meta elements per PS3.10 Section 7.1:
- (0002,0000) File Meta Information Group Length
- (0002,0001) File Meta Information Version
- (0002,0012) Implementation Class UID

Reference: DICOM PS3.10 Section 7.

# `serialize`

```elixir
@spec serialize(Dicom.DataSet.t()) :: {:ok, binary()} | {:error, term()}
```

Serializes a data set to P10 binary.

# `serialize_data_set`

```elixir
@spec serialize_data_set(Dicom.DataSet.t(), String.t()) ::
  {:ok, binary()} | {:error, term()}
```

Serializes a raw DICOM data set using the given transfer syntax UID.

The output contains only the encoded data set payload used in DIMSE
messages, with no Part 10 preamble or file meta information.

# `validate_file_meta`

```elixir
@spec validate_file_meta(Dicom.DataSet.t()) ::
  :ok
  | {:error, {:missing_required_meta, Dicom.Tag.t()}}
  | {:error, {:invalid_meta_vr, Dicom.Tag.t(), atom()}}
  | {:error, {:invalid_meta_value, Dicom.Tag.t()}}
  | {:error, {:invalid_uid_in_file_meta, Dicom.Tag.t()}}
```

Validates that a data set contains all required File Meta Information elements.

Required Type 1 elements per PS3.10 Section 7.1:
- (0002,0002) Media Storage SOP Class UID
- (0002,0003) Media Storage SOP Instance UID
- (0002,0010) Transfer Syntax UID

---

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