Constructor
new DicomParser()
- Source
Example
// XMLHttpRequest onload callback
const onload = function (event) {
// setup the dicom parser
const dicomParser = new dwv.DicomParser();
// parse the buffer
dicomParser.parse(event.target.response);
// get the dicom tags
const tags = dicomParser.getDicomElements();
// display the modality
const div = document.getElementById('dwv');
div.appendChild(document.createTextNode(
'Modality: ' + tags['00080060'].value[0]
));
};
// DICOM file request
const request = new XMLHttpRequest();
const url = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm';
request.open('GET', url);
request.responseType = 'arraybuffer';
request.onload = onload;
request.send();
Methods
getDefaultCharacterSet() → {string}
Get the default character set.
- Source
Returns:
The default character set.
- Type:
- string
getDicomElements() → {Object.<string, DataElement>}
Get the DICOM data elements.
- Source
Returns:
The data elements.
- Type:
- Object.<string, DataElement>
parse(buffer)
Parse the complete DICOM file (given as input to the class). Fills in the member object 'dataElements'.
Parameters:
Name | Type | Description |
---|---|---|
buffer | ArrayBuffer | The input array buffer. |
setDecoderCharacterSet(characterSet)
Set the text decoder character set.
Parameters:
Name | Type | Description |
---|---|---|
characterSet | string | The input character set. |
- Source
setDefaultCharacterSet(characterSet)
Set the default character set.
Parameters:
Name | Type | Description |
---|---|---|
characterSet | string | The input character set. |
- Source