message.getSeparatePixelDataLength¶
Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getSeparatePixelDataLength.
Signature: message.getSeparatePixelDataLength()
Returns: Long length - the recorded pixel data size in bytes, or 0 when the pixel data is not stored separately
Get the size (in bytes) of the DICOM Pixel Data that was stored in a separate folder when the message was received.
Note
Only meaningful when the source node option "Enable storing DICOM Pixel Data in a separate folder" is enabled. Returns 0 when the pixel data is not stored separately. A value of 4294967295 means the pixel data is encapsulated (compressed) and the true size is unknown - treat it as large.
Parameters¶
None
Example¶
// Given a DICOM message (message)
// Get the size (in bytes) of the pixel data stored in the separate folder
var pixelBytes = message.getSeparatePixelDataLength();
// pixelBytes is 0 when the pixel data is not stored separately;
// 4294967295 means encapsulated pixel data of unknown size - treat it as large
if (pixelBytes > (900 * 1024 * 1024)) {
// stream the file instead of loading it into memory
}