new DicomWriter()
- Source:
DICOM writer.
Example usage: var parser = new dwv.dicom.DicomParser(); parser.parse(this.response);
var writer = new dwv.dicom.DicomWriter(parser.getRawDicomElements()); var blob = new Blob([writer.getBuffer()], {type: 'application/dicom'});
var element = document.getElementById("download"); element.href = URL.createObjectURL(blob); element.download = "anonym.dcm";
Members
anonymisationRules
- Source:
Example anonymisation rules.
rules
- Source:
Public (modifiable) rules. Set of objects as: name : { action: 'actionName', value: 'optionalValue } The names are either 'default', tagName or groupName. Each DICOM element will be checked to see if a rule is applicable. First checked by tagName and then by groupName, if nothing is found the default rule is applied.
Methods
getBuffer(dicomElements) → {ArrayBuffer}
- Source:
Get the ArrayBuffer corresponding to input DICOM elements.
Parameters:
Name | Type | Description |
---|---|---|
dicomElements |
Array | The wrapped elements to write. |
Returns:
The elements as a buffer.
- Type
- ArrayBuffer
getElementToWrite(element) → {object}
- Source:
Get the element to write according to the class rules. Priority order: tagName, groupName, default.
Parameters:
Name | Type | Description |
---|---|---|
element |
object | The element to check |
Returns:
The element to write, can be null.
- Type
- object
writeDataElement(writer, element, byteOffset, isImplicit) → {number}
- Source:
Write a data element.
Parameters:
Name | Type | Description |
---|---|---|
writer |
dwv.dicom.DataWriter | The raw data writer. |
element |
object | The DICOM data element to write. |
byteOffset |
number | The offset to start writing from. |
isImplicit |
boolean | Is the DICOM VR implicit? |
Returns:
The new offset position.
- Type
- number
writeDataElementItems(writer, byteOffset, items, isImplicit) → {number}
- Source:
Write a list of items.
Parameters:
Name | Type | Description |
---|---|---|
writer |
dwv.dicom.DataWriter | The raw data writer. |
byteOffset |
number | The offset to start writing from. |
items |
Array | The list of items to write. |
isImplicit |
boolean | Is the DICOM VR implicit? |
Returns:
The new offset position.
- Type
- number
writeDataElementValue(writer, vr, vl, byteOffset, value, isImplicit) → {number}
- Source:
Write data with a specific Value Representation (VR).
Parameters:
Name | Type | Description |
---|---|---|
writer |
dwv.dicom.DataWriter | The raw data writer. |
vr |
string | The data Value Representation (VR). |
vl |
string | The data Value Length (VL). |
byteOffset |
number | The offset to start writing from. |
value |
Array | The array to write. |
isImplicit |
boolean | Is the DICOM VR implicit? |
Returns:
The new offset position.
- Type
- number
writePixelDataElementValue(writer, vr, vl, byteOffset, value, isImplicit) → {number}
- Source:
Write a pixel data element.
Parameters:
Name | Type | Description |
---|---|---|
writer |
dwv.dicom.DataWriter | The raw data writer. |
vr |
string | The data Value Representation (VR). |
vl |
string | The data Value Length (VL). |
byteOffset |
number | The offset to start writing from. |
value |
Array | The array to write. |
isImplicit |
boolean | Is the DICOM VR implicit? |
Returns:
The new offset position.
- Type
- number