←Select platform

AddUserInformation(byte,IntPtr,int) Method

Summary
Appends a User-defined item to the DICOM Associate.
Syntax
C#
C++/CLI
public void AddUserInformation( 
   byte type, 
   IntPtr data, 
   int dataLength 
) 
public: 
void AddUserInformation(  
   byte type, 
   IntPtr data, 
   int dataLength 
)  

Parameters

type
Type of the User-defined item.

data
Pointer to a buffer that contains the data for the User-defined item.

dataLength
Length of the User-defined item.

Remarks

User-defined items may be included in the DICOM Associate to provide any other data the user finds necessary when establishing a DICOM Associate connection. The basic structure of the User-defined item is

userdata.gif

where the Type, Length and User Data are all determined by the user. The values shown are the lengths, in bytes, of the elements of the User-defined item.

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
void BuildVerifyAssociate() 
{ 
   //Make sure to initialize the DICOM engine, this needs to be done only once  
   //In the whole application 
   DicomEngine.Startup(); 
   using (DicomAssociate associate = new DicomAssociate(true)) 
   { 
      //Role Select 
      associate.AddPresentationContext(1, 0, DicomUidType.VerificationClass); 
      associate.SetRoleSelect(1, true, DicomRoleSupport.Supported, DicomRoleSupport.Unsupported); 
      Debug.Assert(associate.IsRoleSelect(1) == true); 
      Debug.Assert(associate.GetUserRole(1) == DicomRoleSupport.Supported); 
      Debug.Assert(associate.GetProviderRole(1) == DicomRoleSupport.Unsupported); 
 
      //Extended Data 
      associate.SetExtendedData(1, new byte[] { 55 }); 
      Debug.Assert(associate.GetExtendedDataLength(1) == 1); 
      byte[] extendedData = associate.GetExtendedData(1); 
      Debug.Assert(extendedData[0] == 55); 
      // We can also call GetExtendedDataPtr 
 
      //Asynchronous Operations 
      associate.SetAsynchronousOperations(true, 5, 5); 
      Debug.Assert(associate.IsAsynchronousOperations == true); 
      Debug.Assert(associate.InvokedOperationsCount == 5); 
      Debug.Assert(associate.PerformedOperationsCount == 5); 
 
      //User Information 
      associate.AddUserInformation(4, new byte[] { 88 }); 
      Debug.Assert(associate.UserInformationCount == 1); 
      Debug.Assert(associate.GetUserInformationType(0) == 4); 
      Debug.Assert(associate.GetUserInformationDataLength(0) == 1); 
      Debug.Assert(associate.GetUserInformationDataPtr(0) != null); 
      byte[] userInformationData = associate.GetUserInformationData(0); 
      Debug.Assert(userInformationData[0] == 88); 
      associate.SetUserInformation(0, 3, new byte[] { 56 }); 
      userInformationData = associate.GetUserInformationData(0); 
      Debug.Assert(userInformationData[0] == 56); 
      associate.DeleteUserInformation(0); 
   } 
   DicomEngine.Shutdown(); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.8.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.