source.getSeparatePixelDataLength¶
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.getSeparatePixelDataLength.
Signature: source.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 source message (source)
// Get the size (in bytes) of the pixel data stored in the separate folder
var pixelBytes = source.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
}