L_DicomGetInfoImage

#include "Ltdic.h"

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

HDICOMDS hDS;

/* a DICOM handle */

pDICOMELEMENT pElement;

/* pointer to a DICOMELEMENT structure */

pDICOMIMAGE pInfo;

/* pointer to a DICOMIMAGE structure */

L_UINT32 nIndex;

/* index value */

Gets information about the image in the specified element.

Parameter

Description

hDS

A DICOM handle.

pElement

Pointer to a DICOMELEMENT structure within the Data Set.

pInfo

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

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

0

SUCCESS

>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

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:

L_DicomGetImage, L_DicomGetImageList, L_DicomInsertImageList, L_DicomSetImage, L_DicomSetImageList

Topics:

Working with Data Sets

Example

/* This example returns the information about an image */

L_VOID Test()
{
   HDICOMDS      hDS;
   pDICOMELEMENT pElement;
   DICOMIMAGE    Info;

   hDS = L_DicomCreateDS(NULL);

   L_DicomLoadDS(hDS, "c:\\ltwin14\\images\\image1.dic", 0);

   pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PIXEL_DATA, FALSE);
   if (pElement != NULL)
   {
      L_DicomGetInfoImage(hDS, pElement, &Info, 0);
   }

   L_DicomFreeDS(hDS);
}