Skip to content

message.getDICOMDoublesAsArray

Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getDICOMDoublesAsArray.

Signature: message.getDICOMDoublesAsArray(nodePath, instance*)

Returns: Number[] result - the first node as a JS Array of JS Numbers that matches the nodePath and instance

Get the result as an array of doubles of the first node that matches the nodePath.

Note

When the optional instance value is specified, the nodePath should not include an instance identifier.

Parameters

Type Name Description Default
String nodePath the DICOM node path
Integer instance* (optional) the match instance to return. Use 1 for the first instance. 1

Example

// assumes `message` is a DICOM message model object

// Retrieve an array of doubles for a specific DICOM tag
var dicomDoublesArray = message.getDICOMDoublesAsArray("0010,0030");

// Retrieve the values for a specific instance of the tag
// (useful when the tag appears multiple times, e.g. in sequences)
var dicomDoublesArrayInstance = message.getDICOMDoublesAsArray(
    "0010,0030",
    2 // instance (1 = first instance)
);

// Result:
// - Returned value is a JavaScript Array of Numbers
// - Example: [12.3, 45.6, 78.9]