View Source ExDicom.Reader.ReadDicomElement (EX_DICOM v0.2.0)

Provides functions to read a single DICOM element in either Implicit or Explicit VR format.

Summary

Functions

Reads one DICOM element from the byte stream using explicit VR rules.

Reads one DICOM element from the byte stream using implicit VR rules.

Functions

read_dicom_element_explicit(byte_stream, warnings \\ [], until_tag \\ nil)

Reads one DICOM element from the byte stream using explicit VR rules.

Parameters

  • byte_stream: the ByteStream
  • warnings: a list of warnings (if you track them separately from the stream)
  • until_tag: optional tag that, if matched, stops reading

Return Value

{:ok, element, updated_stream, updated_warnings} or {:error, reason}

read_dicom_element_implicit(byte_stream, until_tag \\ nil, vr_callback \\ nil)

Reads one DICOM element from the byte stream using implicit VR rules.

Parameters

  • byte_stream: the ByteStream
  • until_tag: optional tag; if we encounter it, we immediately return the element
  • vr_callback: (optional) a function that returns a VR given a tag (for private dictionary lookups, etc.)

Return Value

Typically returns {:ok, element, updated_stream, warnings} or {:error, reason}.