L_DicomGetDefaultJ2KOptions

#include "ltdic.h"

L_UINT16 EXT_FUNCTION L_DicomGetDefaultJ2KOptions(hDS, pOptions, nSize)

HDICOMDS hDS;

/* a DICOM handle */

pFILEJ2KOPTIONS pOptions;

/* pointer to a structure */

L_INT nSize;

/* size of the structure */

Gets the default JPEG 2000 compression options.

Parameter

Description

hDS

A DICOM handle.

pOptions

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

nSize

Size of the structure pointed to by pOptions.

Returns

0

SUCCESS

>0

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_DicomInsertImage, L_DicomInsertImageList, L_DicomSetImage, L_DicomSetImageList, L_DicomSetJ2KOptions, L_DicomGetJ2KOptions

Topics:

Working with Data Sets

 

Implementing JPEG 2000 Plug in Features

Example

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

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