message.setDICOMDoubles¶
Signature: message.setDICOMDoubles(nodePath, value, instance*, forceNode*)
Returns: void
Set the value as a \\ delimited string 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 | |
| String or Number[] | value | the new node value either as a String or a JS Array of JS Numbers | |
| Integer | instance* | (optional) the match instance to set. Use 1 for the first instance. | 1 |
| Boolean | forceNode* | (optional) create the node if it doesn't exist | true |
Example¶
// Examples of how to use setDICOMDoubles
// assumes `message` is a DICOM message model object
// Example: value as String (backslash-delimited doubles)
message.setDICOMDoubles(
"0013,000C", // nodePath - DICOM tag
"1.5\\0.0\\-1.5\\0.0" // value (String of doubles)
);
// Example: value as Number[] (JS array of numbers)
message.setDICOMDoubles(
"0013,000C", // nodePath
[1.5, 0.0, -1.5, 0.0] // value (Number[])
);
// Example: specify instance (1-based index)
message.setDICOMDoubles(
"0013,000C", // nodePath
[2.5, 1.0, -2.5, 1.0], // value
1 // instance (first match)
);
// Example: create node if it does not exist (forceNode = true)
message.setDICOMDoubles(
"0013,000D", // nodePath (new tag)
"3.5\\2.0\\-3.5\\2.0", // value
1, // instance
true // forceNode - create if missing
);
// Example: do NOT create node if it does not exist
message.setDICOMDoubles(
"0013,000E",
[0.0, 0.0],
1,
false // forceNode - will NOT create tag
);