LDicomDS::GetDefaultJ2KOptions

#include "ltdic.h"

L_UINT16 LDicomDS::GetDefaultJ2KOptions(pOptions, nSize)

pFILEJ2KOPTIONS pOptions;

/* pointer to a structure */

L_INT nSize;

/* size of the structure */

Gets the default JPEG 2000 compression options.

Parameter

Description

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:

LDicomDS::InsertImage, LDicomDS::InsertImageList, LDicomDS::SetImage, LDicomDS::SetImageList, LDicomDS::SetJ2KOptions, LDicomDS::GetJ2KOptions

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(LDicomDS *pDS ,pBITMAPHANDLE pBitmap)
{            
   if(pDS && pBitmap)
   {
      pDICOMELEMENT  pElement;
      FILEJ2KOPTIONS J2KOptions;

      // Get the default JPEG 2000 compression options. 
      pDS->GetDefaultJ2KOptions(&J2KOptions, sizeof(FILEJ2KOPTIONS));
      // Set the new compression options.
      pDS->SetJ2KOptions(&J2KOptions);

      pElement = pDS->FindFirstElement(NULL, TAG_PIXEL_DATA, FALSE);
      if (pElement != NULL)
      {
         pDS->InsertImage( pElement,
                           pBitmap,
                           1,
                           IMAGE_COMPRESSION_J2K_LOSSY,
                           IMAGE_PHOTOMETRIC_MONOCHROME2,
                           0,
                           25,
                           DICOM_SETIMAGE_AUTO_SET_VOI_LUT,
                           NULL,
                           NULL);
      }
   }
}