Skip to content

source.getDICOMBytes

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

Signature: source.getDICOMBytes(nodePath, instance*)

Returns: byte[] bytes - the first node that matches the nodePath and instance

Get the DICOM bytes as a byte array 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 raw byte data from a DICOM node.

// Get the byte array for the first matching node (Patient Name: 0010,0010)
var patientNameBytes = source.getDICOMBytes(
    "0010,0010" // DICOM tag
);

// Get the byte array for a specific instance (useful for sequences)
// Image Position (Patient): 0020,0032
var imagePositionBytes = source.getDICOMBytes(
    "0020,0032", // DICOM tag
    2            // instance
);

// Returned values are raw byte[] for the specified DICOM element