Skip to content

message.setDICOMUnsignedLongs

Signature: message.setDICOMUnsignedLongs(nodePath, value, instance*, forceNode*)

Returns: void

Set the value as a \\ delimited string of unsigned longs 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

// Example: Set DICOM tag values using unsigned long integers (String or Number[])

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


// Example: value as String (backslash-delimited unsigned longs)
message.setDICOMUnsignedLongs(
   "0013,000C",      // nodePath - DICOM tag
   "1\\0\\255\\1024" // value (String of unsigned longs)
);


// Example: value as Number[] (JS array of numbers)
message.setDICOMUnsignedLongs(
   "0013,000C",      // nodePath
   [1, 0, 255, 1024] // value (Number[])
);


// Example: value with larger unsigned values (within 32-bit unsigned range)
message.setDICOMUnsignedLongs(
   "0013,000C",
   [0, 2147483647, 4294967295] // value (Number[])
);


// Example: specify instance (1-based index)
message.setDICOMUnsignedLongs(
   "0013,000C",  // nodePath
   [5, 4, 3, 2], // value
   1             // instance (first match)
);


// Example: create node if it does not exist (forceNode = true)
message.setDICOMUnsignedLongs(
   "0013,000D",  // nodePath (new tag)
   "10\\20\\30", // value
   1,            // instance
   true          // forceNode - create if missing
);


// Example: do NOT create node if it does not exist
message.setDICOMUnsignedLongs(
   "0013,000E",
   [0, 1],
   1,
   false              // forceNode - will NOT create tag
);