message.getDICOMSignedShortsAsArray¶
Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getDICOMSignedShortsAsArray.
Signature: message.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¶
// assumes `message` is a DICOM message model object
// Retrieve signed short values as a JS Array of Numbers
var signedShortsArray = message.getDICOMSignedShortsAsArray(
"0028,0106" // Example DICOM tag
);
// Optionally retrieve a specific instance
var signedShortsArrayInstance = message.getDICOMSignedShortsAsArray(
"0028,0106", // node path
2 // instance (1 = first instance)
);
// Result:
// - signedShortsArray contains all signed short values for the node
// - signedShortsArrayInstance contains values for the specified instance