Available in LEADTOOLS Medical Imaging toolkits. |
LDicomDS::GetTextObjectInfo
#include "Ltdic.h"
L_UINT16 LDicomDS::GetTextObjectInfo(pGraphicAnnSQItem, uTextObjectIndex, pTextObject, uStructSize)
pDICOMELEMENT pGraphicAnnSQItem; |
/* pointer to a DICOMELEMENT structure */ |
L_UINT uTextObjectIndex; |
/* text annotation object index */ |
pDICOMTEXTOBJECT pTextObject; |
/* pointer to the text annotation object attributes structure to be updated */ |
L_UINT uStructSize; |
/* the size of the DICOMTEXTOBJECT structure */ |
Gets the attributes of a text annotation object.
Parameter |
Description |
pGraphicAnnSQItem |
Pointer to an item element under the "Graphic Annotation Sequence" (0070,0001) in the "Graphic Annotation Module". |
uTextObjectIndex |
The index of the text annotation object whose attributes we want to retrieve. |
pTextObject |
Pointer to a structure which will be filled with the text annotation object attributes. |
uStructSize |
Size of the DICOMTEXTOBJECT structure. Pass sizeof(DICOMTEXTOBJECT). |
Returns
0 |
SUCCESS |
>0 |
An error occurred. Refer to Return Codes. |
Comments
This function will retrieve the attributes of a text object and store their values in the structure pointed to by pTextObject. pTextObject->uStructSize will be set to the value of the parameter uStructSize.
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
Example
L_INT LDicomDS_GetTextObjectInfoExample(LDicomDS& PresStateDS) { L_INT nRet; L_TCHAR szText[256] = TEXT(""); DICOMTEXTOBJECT AnnTextual; L_UINT uObjsCount; pDICOMELEMENT pGraphicAnnSQItem = PresStateDS.FindFirstGraphicAnnSQItem(); memset(&AnnTextual, 0, sizeof(DICOMTEXTOBJECT)); nRet = PresStateDS.GetLayerTextObjectCount(pGraphicAnnSQItem, &uObjsCount); if (nRet != DICOM_SUCCESS) return nRet; if (uObjsCount > 0) { for (L_UINT i = 0 ; i < 10 ; i++) { nRet = PresStateDS.GetTextObjectInfo(pGraphicAnnSQItem, i, &AnnTextual, sizeof(DICOMTEXTOBJECT)); if (nRet == DICOM_SUCCESS) { if (AnnTextual.pszTextValue) { wsprintf(szText, TEXT("Annotation text is: %s "), AnnTextual.pszTextValue); MessageBox( NULL, szText, TEXT("Note"), MB_OK); } return nRet; } } } return DICOM_SUCCESS; }