Skip to content

source.getDICOMSignedShortsAsArray

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.getDICOMSignedShortsAsArray.

Signature: source.getDICOMSignedShortsAsArray(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 signed 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 signed short values from a DICOM node as a JavaScript array.

// Get an array of signed shorts from the first matching node
var signedShorts = source.getDICOMSignedShortsAsArray(
    "0028,0106" // DICOM tag
);              // e.g. [1, 0, -1, 0]

// Get signed shorts from a specific instance (useful for sequences)
var signedShortsInstance = source.getDICOMSignedShortsAsArray(
    "0028,0106", // DICOM tag
    2            // instance
);