L_DicomGetDefaultJ2KOptions

#include "ltdic.h"

L_LTDIC_API L_UINT16 L_DicomGetDefaultJ2KOptions(hDS, pOptions, nSize)

Gets the default JPEG 2000 compression options.

Parameters

HDICOMDS hDS

A DICOM handle.

pFILEJ2KOPTIONS  pOptions

Pointer to a structure to be updated with the default JPEG 2000 compression options.

L_INT nSize

Size of the structure pointed to by pOptions.

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>0 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

This example inserts an image in a Data Set Using the JPEG 2000 compression with default compression options

L_INT DicomGetDefaultJ2KOptionsExample(HDICOMDS hDS, pBITMAPHANDLE pBitmap) 
{ 
   L_UINT16 nRet; 
 
   if(hDS && pBitmap) 
   { 
      pDICOMELEMENT pElement; 
      FILEJ2KOPTIONS J2KOptions; 
       
      // Get the default JPEG 2000 compression options.  
      nRet = L_DicomGetDefaultJ2KOptions(hDS, &J2KOptions, sizeof(FILEJ2KOPTIONS)); 
      if (nRet != DICOM_SUCCESS) 
         return nRet; 
 
      // Set the new compression options. 
      nRet = L_DicomSetJ2KOptions(hDS, &J2KOptions); 
      if (nRet != DICOM_SUCCESS) 
         return nRet; 
 
      pElement = L_DicomFindFirstElement( hDS,  
                                          NULL,  
                                          TAG_PIXEL_DATA, 
                                          FALSE); 
      if (pElement != NULL) 
      { 
         nRet = L_DicomInsertImage(hDS,  
                                   pElement,  
                                   pBitmap,  
                                   1,  
                                   IMAGE_COMPRESSION_J2K_LOSSY, 
                                   IMAGE_PHOTOMETRIC_MONOCHROME2, 
                                   0, 
                                   25, 
                                   DICOM_SETIMAGE_AUTO_SET_VOI_LUT, 
                                   NULL, 
                                   NULL); 
         if (nRet != DICOM_SUCCESS) 
            return nRet; 
      } 
   } 
 
   return DICOM_SUCCESS; 
} 

Help Version 20.0.2019.9.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help