DicomParser

dwv.dicom. DicomParser

new DicomParser()

Source:

DicomParser class.

Members

dicomElements :Array

Source:

The list of DICOM elements.

Type:
  • Array

Methods

getDefaultCharacterSet() → {string}

Source:

Get the default character set.

Returns:

The default character set.

Type
string

getDicomElements() → {object}

Source:

Get the DICOM data elements.

Returns:

The DICOM elements.

Type
object

getRawDicomElements() → {object}

Source:

Get the raw DICOM data elements.

Returns:

The raw DICOM elements.

Type
object

interpret(elements, reader, pixelRepresentation, bitsAllocated)

Source:

Interpret the data of a list of elements.

Parameters:
Name Type Description
elements Array

A list of data elements.

reader dwv.dicom.DataReader

The raw data reader.

pixelRepresentation number

PixelRepresentation 0->unsigned, 1->signed.

bitsAllocated number

Bits allocated.

interpretElement(element, reader, pixelRepresentation, bitsAllocated) → {object}

Source:

Interpret the data of an element.

Parameters:
Name Type Description
element object

The data element.

reader dwv.dicom.DataReader

The raw data reader.

pixelRepresentation number

PixelRepresentation 0->unsigned, 1->signed (needed for pixel data or VR=xs).

bitsAllocated number

Bits allocated (needed for pixel data).

Returns:

The interpreted data.

Type
object

parse(buffer)

Source:

Parse the complete DICOM file (given as input to the class). Fills in the member object 'dicomElements'.

Parameters:
Name Type Description
buffer object

The input array buffer.

readDataElement(reader, offset, implicit) → {object}

Source:

Read a DICOM data element. Reference: DICOM VRs.

Parameters:
Name Type Description
reader dwv.dicom.DataReader

The raw data reader.

offset number

The offset where to start to read.

implicit boolean

Is the DICOM VR implicit?

Returns:

An object containing the element 'tag', 'vl', 'vr', 'data' and 'endOffset'.

Type
object

readExplicitItemDataElement(reader, offset, implicit) → {object}

Source:

Read an explicit item data element.

Parameters:
Name Type Description
reader dwv.dicom.DataReader

The raw data reader.

offset number

The offset where to start to read.

implicit boolean

Is the DICOM VR implicit?

Returns:

The item data as a list of data elements.

Type
object

readImplicitItemDataElement(reader, offset, implicit) → {object}

Source:

Read an implicit item data element.

Parameters:
Name Type Description
reader dwv.dicom.DataReader

The raw data reader.

offset number

The offset where to start to read.

implicit boolean

Is the DICOM VR implicit?

Returns:

The item data as a list of data elements.

Type
object

readPixelItemDataElement(reader, offset, implicit) → {Array}

Source:

Read the pixel item data element. Ref: Single frame fragments.

Parameters:
Name Type Description
reader dwv.dicom.DataReader

The raw data reader.

offset number

The offset where to start to read.

implicit boolean

Is the DICOM VR implicit?

Returns:

The item data as an array of data elements.

Type
Array

readTag(reader, offset) → {object}

Source:

Read a DICOM tag.

Parameters:
Name Type Description
reader dwv.dicom.DataReader

The raw data reader.

offset number

The offset where to start to read.

Returns:

An object containing the tags 'group', 'element' and 'name'.

Type
object

setDefaultCharacterSet(characterSet)

Source:

Set the default character set. param {String} The character set.

Parameters:
Name Type Description
characterSet string

The input character set.