LDicomDS::SetKeepPixelDataIntactFlag

#include "Ltdic.h"

L_VOID LDicomDS::SetKeepPixelDataIntactFlag(bSet)

L_BOOL bSet;

/* flag */

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

Parameter

Description

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 LDicomDS::GetImage or LDicomDS::GetImageList, LEADTOOLS may pre-process the image data in the bitmap handle for optimal display. Call the LDicomDS::GetKeepPixelDataIntactFlag function to determine whether LEADTOOLS will pre-process the image data. By default LEADTOOLS pre-processes the image data.

Calling the LDicomDS::SetKeepPixelDataIntactFlag 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

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::GetKeepPixelDataIntactFlag, LDicomDS::GetImage, LDicomDS::GetImageList, Class Members

Topics:

Working with Data Sets

Example

L_VOID Test()
{
   LDicomDS      *pDS;
   pDICOMELEMENT  pElement;
   BITMAPHANDLE   Bitmap;
   L_BOOL         bKeepPixelDataUnchanged;
   
   pDS = new LDicomDS(NULL);

   pDS->LoadDS("c:\\ltwin13\\images\\image1.dic", 0);

   bKeepPixelDataUnchanged = pDS->GetKeepPixelDataIntactFlag();
   if(bKeepPixelDataUnchanged == FALSE)
   {
      L_INT nRet = AfxMessageBox("Would like to keep pixel data unchanged?\n"
      "If you choose Yes, then the resulting bitmap data will represent\n"
      "exactly what appears inside the DICOM file, but may not display properly.\n"
      "If you choose No, then the resulting bitmap data may not be\n"
      "identical to what appears inside the DICOM file, but will display properly. \n",
      MB_YESNO);
      pDS->SetKeepPixelDataIntactFlag((nRet == IDYES));
   }
   
   pElement = pDS->FindFirstElement(NULL, TAG_PIXEL_DATA, FALSE);
   if (pElement != NULL)
   {
      pDS->GetImage(pElement, &Bitmap, sizeof(BITMAPHANDLE), 0, 0, ORDER_BGR, 0, NULL, NULL);
      L_FreeBitmap(&Bitmap);
   }

   delete pDS;
}