L_DicomSetExtended

Summary

Sets the extended data associated with the specified Presentation Context.

Syntax

#include "ltdic.h"

L_LTDIC_API L_INT L_DicomSetExtended(hPDU, nID, pData, nLength)

Parameters

HDICOMPDU hPDU

A DICOM Associate handle.

L_UCHAR 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.

L_UCHAR *pData

Buffer that contains the data to set.

L_UINT32 nLength

Length of pData.

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>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

Platforms

Win32, x64, Linux.

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; 
} 
Help Version 23.0.2024.7.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.