dicom.parser {espadon}R Documentation

Conversion of DICOM raw data into a dataframe or a list of DICOM TAG information

Description

The dicom.parser function creates a dataframe or a list from DICOM raw data. The created dataframe or list provides information about the content of the DICOM TAGs included in the raw data.

Usage

dicom.parser(
  dicom.raw.data,
  as.txt = TRUE,
  nested.list = FALSE,
  try.parse = FALSE,
  txt.sep = "\\",
  txt.length = 100,
  tag.dictionary = dicom.tag.dictionary()
)

Arguments

dicom.raw.data

Raw vector, representing the binary extraction of the DICOM file.

as.txt

Boolean. If as.txt = TRUE, the function returns a dataframe, a list otherwise.

nested.list

Boolean. Only used if as.txt = FALSE. If nested.list = FALSE, the returned list consists of nested lists.

try.parse

Boolean. If TRUE, the tag with unknown DICOM VR (value representation) is converted into string if possible.

txt.sep

String. Used if as.txt = TRUE. Separator of the tag value elements.

txt.length

Positive integer. Used if as.txt = TRUE. Maximum number of letters in the representation of the TAG value.

tag.dictionary

Dataframe, by default equal to dicom.tag.dictionary, whose structure it must keep. This dataframe is used to parse DICOM files.

Value

Returns a list of elements or a dataframe, depending on as.list.

If it returns a dataframe, the columns are names TAG, VR (value representation), VM (value multiplicity), loadsize and Value. The field $Value is a string representation of the true value.

If it returns a list, each of its elements, named by a TAG, is either a vector or a string, depending of the TAG included in dicom.raw.data.

See Also

dicom.raw.data.loader, dicom.tag.parser

Examples

# content of the dummy raw data toy.dicom.raw (), as a list.
L <- dicom.parser (toy.dicom.raw (), as.txt = FALSE)
str(L[40:57])

L <- dicom.parser (toy.dicom.raw (), as.txt = FALSE, nested.list = TRUE)
str(L[40:45])

# content of the dummy raw data toy.dicom.raw (), as a dataframe.
L <- dicom.parser (toy.dicom.raw (), as.txt = TRUE)
str (L)

[Package espadon version 1.2.0 Index]