qie.convertDICOMPixelDataToJpeg¶
Signature: qie.convertDICOMPixelDataToJpeg(message)
Returns: byte[] jpegBytes - a byte array containing the rendered JPEG
Converts a DICOM message object to a JPEG byte array.
Note
The DICOM message object must contain Pixel Data (7FE0,0010) and must be formatted in Explicit VR Little Endian ("1.2.840.10008.1.2.1").
Note
See details for message.changeTransferSyntax().
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| DICOM Message | message | the DICOM message object to convert |
Example¶
// Make sure you have the correct libraries to convert various image types
// Parse a DICOM file into a DICOM message
var dicomMessage = qie.parseDICOMFile("/tmp/lady.dcm");
// Convert the DICOM Pixel Data (7FE0,0010) to a JPEG byte array
var jpegBytes = qie.convertDICOMPixelDataToJpeg(dicomMessage); // byte[]
// Write the rendered JPEG to disk
qie.writeFile("/tmp/chestXray.jpg", jpegBytes);