Skip to content

source.getDICOMUnsignedShortsAsArray

Use when: You want to read values from the original incoming message before any mapping changes. If you need the modified message during mapping, use message.getDICOMUnsignedShortsAsArray.

Signature: source.getDICOMUnsignedShortsAsArray(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 unsigned shorts 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

// Example: Retrieve unsigned short values from a DICOM node as a JavaScript array.

// Retrieve values from the first matching node at nodePath.
var unsignedShorts = source.getDICOMUnsignedShortsAsArray("0010,0010"); // e.g. [123, 456, ...]

// Retrieve values from the 2nd occurrence (instance is 1-based: 1 = first instance).
var unsignedShortsArrayInstance = source.getDICOMUnsignedShortsAsArray(
    "0010,0010",    // DICOM tag
    2               // instance (1-based)
);