View Source ExDicom.Reader.FindEndOfEncapsulatedElement (EX_DICOM v0.1.0)

Internal helper functions for parsing encapsulated DICOM pixel data elements. Handles reading and managing fragments of encapsulated pixel data.

Summary

Types

Type representing a pixel data fragment

Functions

Reads an encapsulated pixel data element and adds an array of fragments to the element containing the offset and length of each fragment and any offsets from the basic offset table.

Types

fragment()

@type fragment() :: %{
  offset: non_neg_integer(),
  position: non_neg_integer(),
  length: non_neg_integer()
}

Type representing a pixel data fragment

Functions

find(byte_stream, element, warnings)

@spec find(
  byte_stream :: ExDicom.ByteStream.t(),
  element :: map(),
  warnings :: list()
) ::
  {:ok, map(), ExDicom.ByteStream.t(), list()} | {:error, String.t()}

Reads an encapsulated pixel data element and adds an array of fragments to the element containing the offset and length of each fragment and any offsets from the basic offset table.

Parameters

  • byte_stream - The byte stream to read from
  • element - The element to add fragment information to
  • warnings - List to collect any warnings during parsing

Returns

The modified element with fragment information added

Raises

  • RuntimeError if required parameters are missing or if basic offset table is not found