#include "Ltdic.h"

L_LTDIC_API L_UINT16 EXT_FUNCTION L_DicomGetImageListEx(hDS, pElement, hList, nIndex, nCount, nBitsPerPixel, uFlags, pfnCallback, pUserData)


a DICOM handle


pointer to a DICOMELEMENT structure


handle to the list of images

L_UINT32 nIndex;

index value

L_UINT32 nCount;

number of frames to load

L_INT32 nBitsPerPixel;

resulting image pixel depth

L_UINT uFlags;



callback function

L_VOID *pUserData;

pointer to more parameters for the callback

Loads the image list with frames from a Pixel Data element.

Parameter Description
hDS A DICOM handle.
pElement Pointer to a DICOMELEMENT structure within the Data Set.
hList Handle to the list of images.
nIndex Position of the first frame to get. Use zero-based indexing. For example, if there are 10 images in a list, the index of the last one is 9. To get the last image in the Pixel Data element, use ELEMENT_INDEX_MAX.
nCount Number of frames to load into the image list.
nBitsPerPixel Resulting image pixel depth. Possible values are:
  Value Meaning
  0 Keep the original file's pixel depth (Do not convert).
  1 to 8 The specified bits per pixel in the resulting image
  12 12 bits per pixel in the resulting image.
  16 16 bits per pixel in the resulting image
  24 24 bits per pixel in the resulting image
  32 32 bits per pixel in the resulting image
uFlags Flags which control the behavior of this function. Possible values are:
  Value Meaning
  DICOM_GETIMAGE_AUTO_LOAD_OVERLAYS [0x0001] If set, the function will automatically extract the overlays included in the dataset and add them to the loaded image.
  DICOM_GETIMAGE_AUTO_APPLY_MODALITY_LUT [0x0002] If set, the function will automatically apply the "Modality LUT" when loading the image.
  DICOM_GETIMAGE_AUTO_APPLY_VOI_LUT [0x0004] If set, the function will automatically apply the "VOI LUT" when loading the image.
  DICOM_GETIMAGE_ALLOW_RANGE_EXPANSION [0x0008] (Deprecated, do not use) If set, the function will adjust the high bit and/or low bit (if possible) inside the image handle in order to hold the range of pixel values after applying the modality LUT.
  DICOM_GETIMAGE_AUTO_SCALE_MODALITY_LUT [0x0010] If set, the function will scale the resulting pixel data to fit within the range of 0 to 2^BitsPerPixel-1 (when any of the values exceed that range).
  DICOM_GETIMAGE_AUTO_SCALE_VOI_LUT [0x0020] Only used in conjunction with DICOM_GETIMAGE_AUTO_SCALE_MODALITY_LUT. If set, the function will rescale the VOI LUT to match the rescale that was performed by DICOM_GETIMAGE_AUTO_SCALE_MODALITY_LUT.
DICOM_GETIMAGE_AUTODETECT_INVALID_RLE_COMPRESSION [0x0040] For RLE compressed, automatically detects if the MSB and LSB segments are written in the incorrect order.
DICOM_GETIMAGE_LOADCORRUPTED [0x0100] Allow loading of corrupt JPEG.
DICOM_GETIMAGE_FROM_FLTLOAD [0x8000] Internal Use Only.
pfnCallback Callback Function for additional processing. Use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in the GETIMAGECALLBACK function.

pUserData Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of that variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If additional parameters are not needed, you can pass NULL in this parameter.



The function was successful.


An error occurred. Refer to Return Codes.


The difference between L_DicomGetImageListEx and L_DicomGetImageList is that L_DicomGetImageListEx includes a callback function, whereas L_DicomGetImageList does not.

Required DLLs and Libraries


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


Win32, x64, Linux.

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.