L_DicomSetKeepPixelDataIntactFlag

Summary

Enables or disables the pre-processing of image data when a function that gets a bitmap from a Pixel Data element is called.

Syntax

#include "Ltdic.h"

L_LTDIC_API L_VOID L_DicomSetKeepPixelDataIntactFlag(hDS, bSet)

Parameters

HDICOMDS hDS

A DICOM handle to the data set.

L_BOOL bSet

Flag the indicates whether to enable or disable the pre-processing of image data when a function that gets a bitmap from a Pixel Data element is called. Possible values are:

Value Meaning
TRUE Do not pre-process the image data.
FALSE Pre-process the image data.

Returns

None.

Comments

When a function that gets a bitmap from a data set is called, such as L_DicomGetImage or L_DicomGetImageList, LEADTOOLS may pre-process the image data in the bitmap handle for optimal display. Call the L_DicomGetKeepPixelDataIntactFlag function to determine whether LEADTOOLS will pre-process the image data. By default LEADTOOLS pre-processes the image data.

Calling the L_DicomSetKeepPixelDataIntactFlag function with bSet set to TRUE stops LEADTOOLS from pre-processing the image data in the bitmap handle. Please note that this may result in unexpected behavior when a LEADTOOLS display or image processing function is called for that bitmap handle.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomSetKeepPixelDataIntactFlagExample(L_VOID) 
{ 
   L_UINT16 nRet; 
   pDICOMELEMENT pElement; 
   HDICOMDS hDS = L_DicomCreateDS(NULL); 
 
   // Load a Data Set 
   nRet = L_DicomLoadDS(hDS, MAKE_IMAGE_PATH(TEXT("Image1.dcm")), 0); 
   if (nRet != DICOM_SUCCESS) 
   { 
      L_DicomFreeDS(hDS); 
      return nRet; 
   } 
 
   if (L_DicomGetKeepPixelDataIntactFlag(hDS) == FALSE) 
   { 
      L_TCHAR* pszMessage; 
      pszMessage = TEXT("Would you like to keep the pixel data unchanged?\nIf you choose Yes, then the resulting bitmap data will represent exactly what appears inside the DICOM file, but may not display properly. If you choose No, then the resulting bitmap data may not be identical to what appears inside the DICOM file, but will display properly.");  
      if (MessageBox(NULL, pszMessage, TEXT("Test"), MB_YESNO) == IDYES) 
         L_DicomSetKeepPixelDataIntactFlag(hDS, TRUE); 
   } 
 
   pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PIXEL_DATA, FALSE); 
   if (pElement) 
   { 
      BITMAPHANDLE Bitmap; 
      nRet = L_DicomGetImage(hDS, pElement, &Bitmap, sizeof(BITMAPHANDLE), 0, 0, 0, NULL, NULL); 
      if (nRet != DICOM_SUCCESS) 
      { 
         L_DicomFreeDS(hDS); 
         return nRet; 
      } 
 
      // ... 
 
      L_FreeBitmap(&Bitmap); 
   } 
 
   L_DicomFreeDS(hDS); 
   return DICOM_SUCCESS; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.