L_DicomGetInfoImage

Summary

Gets information about the image in the specified element.

Syntax

#include "Ltdic.h"

L_LTDIC_API L_UINT16 L_DicomGetInfoImage(hDS, pElement, pInfo, nIndex)

Parameters

HDICOMDS hDS

A DICOM handle.

pDICOMELEMENT pElement

Pointer to a DICOMELEMENT structure within the Data Set.

pDICOMIMAGE pInfo

Pointer to a DICOMIMAGE structure that contains the information about the specified image.

L_UINT32 nIndex

Index value that indicates the position of the image. This is a zero-based index. For example, if nIndex is 0, information about the first image in the Pixel Data Element will be retrieved.

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>0 An error occurred. Refer to Return Codes.

Comments

Most DICOM files will only have one Data Element of type TAG_PIXEL_DATA. Therefore, in most instances you can set pElement to NULL, since the function will automatically retrieve information about the image at the specified index within the only Pixel Data Element in the file. If pElement is not NULL, it must point to the Pixel Data Element itself.

If the DICOM file is CLASS_BASIC_DIRECTORY, the file may contain more than one Pixel Data Element. In this case you must specify in pElement the Pixel Data Element from which to get the image information.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

This example returns the information about an image

L_INT DicomGetInfoImageExample(L_VOID) 
{ 
   HDICOMDS      hDS; 
   pDICOMELEMENT pElement; 
   DICOMIMAGE    Info; 
   L_UINT16 nRet; 
 
   hDS = L_DicomCreateDS(NULL); 
 
   nRet = L_DicomLoadDS(hDS, MAKE_IMAGE_PATH(TEXT("Image1.dcm")), 0); 
   if (nRet != DICOM_SUCCESS) 
   { 
      L_DicomFreeDS(hDS); 
      return nRet; 
   } 
 
   pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PIXEL_DATA, FALSE); 
   if (pElement != NULL) 
   { 
      nRet = L_DicomGetInfoImage(hDS, pElement, &Info, 0); 
      if (nRet != DICOM_SUCCESS) 
      { 
         L_DicomFreeDS(hDS); 
         return nRet; 
      } 
   } 
 
   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.