Available in LEADTOOLS Medical Imaging toolkits. |
L_DicomSetExtended
#include "ltdic.h"
L_LTDIC_API L_INT L_DicomSetExtended(hPDU, nID, pData, nLength)
HDICOMPDU hPDU; |
/* a DICOM Associate handle */ |
L_UCHAR nID; |
/* presentation ID */ |
L_UCHAR *pData; |
/* extended data */ |
L_UINT32 nLength; |
/* length of the extended data */ |
Sets the extended data associated with the specified Presentation Context.
Parameter |
Description |
hPDU |
A DICOM Associate handle. |
nID |
Presentation ID of the Presentation Context to which to set the extended data. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data. It also identifies a specific Presentation Context within an Associate. |
pData |
Buffer that contains the data to set. |
nLength |
Length of pData. |
Returns
0 |
SUCCESS |
>0 |
An error occurred. Refer to Return Codes. |
Comments
To retrieve the length of the extended data associated with a Presentation Context, call L_DicomGetLengthExtended.
To get extended data associated with a Presentation Context, call L_DicomGetExtended.
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 |
Win32, x64
See Also
Functions: |
|
Topics: |
Example
L_INT DicomSetExtendedExample(HDICOMPDU hPDU, L_UCHAR nID, HWND hWnd) { L_TCHAR szOut[2000]; L_TCHAR szTemp[200]; L_UCHAR Data[]={0,1,1,0,1}; L_UCHAR *pData=NULL; L_UINT32 lBytes, x; L_INT nRet; /* set 5 bytes of extended data for a particular Presentation */ nRet = L_DicomSetExtended(hPDU, nID, (L_UCHAR *)Data, 5); if (nRet != DICOM_SUCCESS) return nRet; /* get the data and display it */ lBytes = L_DicomGetLengthExtended(hPDU, nID); pData = L_DicomGetExtended(hPDU, nID); lstrcpy(szOut, TEXT("Extended Data\n")); for(x=0; x<lBytes; x++) { wsprintf(szTemp, TEXT("Byte #1: %d\n"), pData[x]); lstrcat(szOut, szTemp); } MessageBox(hWnd, szOut, TEXT("Test"), MB_OK); return DICOM_SUCCESS; }