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

Platforms

Win32, x64

See Also

Functions:

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

Topics:

Working with Data Sets

 

Programming with JPEG 2000 Features

 

How to Disable the Automatic Loading of the default DICOM IOD Table

Example

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

L_INT LDicomDS_GetDefaultJ2KOptionsExample(LDicomDS *pDS ,pBITMAPHANDLE pBitmap) 
{ 
   L_INT nRet; 
   if(pDS && pBitmap) 
   { 
      pDICOMELEMENT  pElement; 
      FILEJ2KOPTIONS J2KOptions; 
      // Get the default JPEG 2000 compression options. 
      nRet = pDS->GetDefaultJ2KOptions(&J2KOptions, sizeof(FILEJ2KOPTIONS)); 
      if(nRet != DICOM_SUCCESS) 
         return nRet; 
      // Set the new 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, 
         DICOM_SETIMAGE_AUTO_SET_VOI_LUT, 
         NULL, 
         NULL); 
         if(nRet != DICOM_SUCCESS) 
            return nRet; 
      } 
   } 
   return DICOM_SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS DICOM C++ Class Library Help