←Select platform

SetRoleSelect Method

Summary
Enables or disables Role Selection. It also sets the User Role and Provider Role, if enabled, for the specified Presentation Context of the DICOM Associate.
Syntax
C#
Objective-C
C++/CLI
public void SetRoleSelect( 
   byte id, 
   bool enabled, 
   DicomRoleSupport user, 
   DicomRoleSupport provider 
) 
- (BOOL)setRoleSelectForID:(uint8_t)ID enabled:(BOOL)enabled user:(LTDicomRoleSupport)user provider:(LTDicomRoleSupport)provider error:(NSError **)error; 
public: 
void SetRoleSelect(  
   byte id, 
   bool enabled, 
   DicomRoleSupport user, 
   DicomRoleSupport provider 
)  

Parameters

id
Presentation Context ID of the Presentation Context for which to set the User Role and Provider Role. The 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.

enabled
true to enable Role Selection; otherwise, false.

user
Indicates whether or not to support the User Role for the specified Presentation Context.

provider
Indicates whether or not to support the Provider Role for the specified Presentation Context.

Remarks

If Role Selection is enabled for a specific Presentation Context, that Application Entity can act as an SCU, an SCP or both for that Presentation Context. For example, suppose a DICOM Associate Request has three Presentation Contexts. One Presentation Context is for the transfer of X-RAY data, another Presentation Context is for the transfer of CT data, and the third Presentation Context is for the transfer of Nuclear Medicine data.

To serve only as an SCU for the X-RAY data transfer, the User Role for the first Presentation Context should be DicomRoleSupport.Supported, while the Provider Role should be DicomRoleSupport.Unsupported.

To serve as both an SCU and an SCP for the CT data transfer, the User Role and the Provider Role should both be DicomRoleSupport.Supported for the second Presentation Context.

To serve only as an SCU for the Nuclear Medicine data transfer, the User Role for the third Presentation Context should be DicomRoleSupport.Supported, while the Provider Role should be DicomRoleSupport.Unsupported.

If Role Selection is enabled, the User Role and Provider Role settings can be retrieved using GetUserRole and GetProviderRole.

To determine whether Role Selection is enabled, use IsRoleSelect.

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