Sets the JPEG 2000 compression options.
#include "ltdic.h"
L_UINT16 LDicomDS::SetJ2KOptions(pOptions)
Pointer to a structure that contains the options to use when compressing the image(s) in a Pixel Data element using the JPEG 2000 compression.
Value | Meaning |
---|---|
0 | SUCCESS |
>0 | An error occurred. Refer to Return Codes. |
The nSize member of the FILEJ2KOPTIONS structure must be set before calling this function.
Win32, x64
This example inserts an image in a Data Set Using the JPEG 2000 compression with a 100:1 compression ratio.
L_INT LDicomDS_SetJ2KOptionsExample(LDicomDS *pDS ,pBITMAPHANDLE pBitmap)
{
L_INT nRet;
if(pDS && pBitmap)
{
pDICOMELEMENT pElement;
FILEJ2KOPTIONS J2KOptions;
// Get the current JPEG 2000 compression options.
nRet = pDS->GetJ2KOptions( &J2KOptions,
sizeof(FILEJ2KOPTIONS));
if(nRet != DICOM_SUCCESS)
return nRet;
J2KOptions.uCompressionControl = J2K_COMPRESSION_RATIO;
// set the compression ratio to 100
J2KOptions.fCompressionRatio = 100.0f;
// Update the JPEG 2000 compression options.
nRet = pDS->SetJ2KOptions(&J2KOptions);
if(nRet != DICOM_SUCCESS)
return nRet;
pElement = pDS->FindFirstElement(NULL, TAG_PIXEL_DATA, FALSE);
if (pElement != NULL)
{
nRet = pDS->InsertImage(pElement,
pBitmap,
1,
IMAGE_COMPRESSION_J2K_LOSSY,
IMAGE_PHOTOMETRIC_MONOCHROME2,
0,
25,
0,
NULL,
NULL);
if(nRet != DICOM_SUCCESS)
return nRet;
}
}
return DICOM_SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.