L_DicomConvertLEADAnnObjToDicomAnnObjs

#include "l_bitmap.h"

L_LTDIC_API L_UINT16 L_DicomConvertLEADAnnObjToDicomAnnObjs(hDS, hAnnObject, pGraphicAnnSQItem, pConversionProc, pUserData, uFlags)

Converts a LEAD Annotation object into one or more DICOM annotation objects, and (optionally) adds the new DICOM annotation objects into the dataset.

Parameters

HDICOMDS hDS

A DICOM handle.

HANNOBJECT hAnnObject

Handle to the LEAD annotation object to be converted, cannot be NULL.

pDICOMELEMENT pGraphicAnnSQItem

Pointer to an item element under the "Graphic Annotation Sequence" (0008,1115) in the "Graphic Annotation Module".If this parameter is not NULL then the resulting DICOM annotation objects will be added to the dataset under the item pointed to by this parameter. Pass NULL, if you do not want the resulting objects to be added to the dataset.

pCONVERTLEADANNOBJTODICOMANNPROC pConversionProc

Pointer to the callback function that will be called for each DICOM annotation object generated by this function. The callback function must adhere to the function prototype described in CONVERTLEADANNOBJTODICOMANNPROC.

L_VOID * 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 the 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 the additional parameters are not needed, you can pass NULL in this parameter.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

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

Comments

This function will convert a LEAD Annotation object into one or more DICOM annotation objects (text and graphic). For each resulting DICOM annotation object the callback function pConversionProc will be called.

If the parameter pGraphicAnnSQItem is not NULL, then the function will automatically add the resulting DICOM annotation objects into the dataset. If the resulting DICOM annotation object is a "Text Object" then it will be added under the "Text Object Sequence" under the item pointed to by pGraphicAnnSQItem. If the resulting DICOM annotation object is a "Graphic Object" then it will be added under the "Graphic Object Sequence" under the item pointed to by pGraphicAnnSQItem.

Currently, a subset of the LEADTOOLS annotation objects can be converted (mapped) into DICOM objects, this includes:

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_UINT16 EXT_CALLBACK fnCallback( 
   const pDICOMGRAPHICOBJECT pGraphicObject, 
   const pDICOMTEXTOBJECT pTextObject, 
   L_VOID *pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   if (pGraphicObject) 
   { 
      MessageBox( NULL,  
                  TEXT("A Graphical object has been created."),  
                  TEXT("Note"),  
                  MB_OK);  
   } 
   else if (pTextObject) 
   { 
      MessageBox( NULL,  
                  TEXT("A Textual object has been created."),  
                  TEXT("Note"),  
                  MB_OK);  
   } 
 
   return DICOM_SUCCESS; 
} 
 
 
L_INT DicomConvertLEADAnnObjToDicomAnnObjsExample( 
   HDICOMDS hPresStateDS, 
   HANNOBJECT hAnnObject) 
{ 
   pDICOMELEMENT pGraphicAnnSQItem = L_DicomFindFirstGraphicAnnSQItem(hPresStateDS); 
 
   L_UINT16 nRet = L_DicomConvertLEADAnnObjToDicomAnnObjs(  hPresStateDS, 
                                                            hAnnObject,  
                                                            pGraphicAnnSQItem, 
                                                            fnCallback, 
                                                            NULL , 
                                                            0); 
   if (nRet == DICOM_SUCCESS) 
   { 
      MessageBox( NULL, 
                  TEXT("LEAD annotation object  has been successfully converted."), 
                  TEXT("Note"), 
                  MB_OK); 
   } 
   return nRet; 
} 
Help Version 20.0.2020.6.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help