# `Dicom.TransferSyntax`
[🔗](https://github.com/Balneario-de-Cofrentes/dicom/blob/v0.5.1/lib/dicom/transfer_syntax.ex#L1)

Transfer Syntax definitions and properties.

A Transfer Syntax specifies how DICOM data is encoded: byte order,
whether VR is explicit or implicit, and pixel data compression.

Registers 49 DICOM transfer syntaxes currently tracked by this library
(34 active + 15 retired).
Unknown transfer syntaxes are rejected by default — use `encoding/2` with
`lenient: true` to fall back to Explicit VR Little Endian for
unrecognized UIDs.

Reference: DICOM PS3.5 Section 10, PS3.6 Table A-1.

# `endianness`

```elixir
@type endianness() :: :little | :big
```

# `t`

```elixir
@type t() :: %Dicom.TransferSyntax{
  compressed: boolean(),
  endianness: endianness(),
  fragmentable: boolean(),
  name: String.t(),
  retired: boolean(),
  uid: String.t(),
  vr_encoding: vr_encoding()
}
```

# `vr_encoding`

```elixir
@type vr_encoding() :: :implicit | :explicit
```

# `active`

```elixir
@spec active() :: [t()]
```

Returns only active (non-retired) transfer syntaxes.

# `all`

```elixir
@spec all() :: [t()]
```

Returns all registered transfer syntaxes.

# `compressed?`

```elixir
@spec compressed?(String.t()) :: boolean()
```

Returns true if the transfer syntax uses compressed pixel data.

# `encoding`

```elixir
@spec encoding(
  String.t(),
  keyword()
) :: {:ok, {vr_encoding(), endianness()}} | {:error, :unknown_transfer_syntax}
```

Returns the VR encoding and endianness for a given transfer syntax UID.

Returns `{:ok, {vr_encoding, endianness}}` for known transfer syntaxes,
or `{:error, :unknown_transfer_syntax}` for unknown UIDs.

## Options

- `lenient: true` — falls back to `{:ok, {:explicit, :little}}` for
  unknown UIDs instead of returning an error. Use this only when you
  need to attempt parsing files with unrecognized private or future
  transfer syntaxes.

# `extract_uid`

```elixir
@spec extract_uid(%{required(Dicom.Tag.t()) =&gt; Dicom.DataElement.t()}) :: String.t()
```

Extracts the transfer syntax UID from a file meta elements map.

Falls back to Implicit VR Little Endian if the tag is absent.

# `fragmentable?`

```elixir
@spec fragmentable?(String.t()) :: boolean()
```

Returns true if the transfer syntax uses fragmentable encapsulation.

Fragmentable transfer syntaxes (MPEG, HEVC) may have pixel data
fragments that do not correspond one-to-one with frames.

# `from_uid`

```elixir
@spec from_uid(String.t()) :: {:ok, t()} | {:error, :unknown_transfer_syntax}
```

Returns the transfer syntax definition for the given UID.

# `implicit_vr?`

```elixir
@spec implicit_vr?(String.t()) :: boolean()
```

Returns true if the transfer syntax uses implicit VR encoding.

# `known?`

```elixir
@spec known?(String.t()) :: boolean()
```

Returns true if the given UID is a known transfer syntax.

# `retired?`

```elixir
@spec retired?(String.t()) :: boolean()
```

Returns true if the transfer syntax is retired.

---

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