LEADTOOLS Medical (Leadtools.Dicom assembly)
LEAD Technologies, Inc

IsRoleSelect Method

Example 







Presentation Context ID of the Presentation Context for which to check Role Selection. 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.
Determines whether Role Selection is enabled for the specified Presentation Context of the DICOM Associate. .NET support WinRT support
Syntax
public bool IsRoleSelect( 
   byte id
)
'Declaration
 
Public Function IsRoleSelect( _
   ByVal id As Byte _
) As Boolean
'Usage
 
Dim instance As DicomAssociate
Dim id As Byte
Dim value As Boolean
 
value = instance.IsRoleSelect(id)
public bool IsRoleSelect( 
   byte id
)
ObjectiveC Syntax
 function Leadtools.Dicom.DicomAssociate.IsRoleSelect( 
   id 
)
public:
bool IsRoleSelect( 
   byte id
) 

Parameters

id
Presentation Context ID of the Presentation Context for which to check Role Selection. 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.

Return Value

true if the Role Selection is enabled for the specified Presentation Context of the DICOM Associate; otherwise, it is false.
Remarks
If Role Selection is enabled, the roles for the Presentation Context can be retrieved using GetUserRole and GetProviderRole. To set the roles for the Presentation Context, use SetRoleSelect.
Example
Copy CodeCopy Code  
Private Sub BuildVerifyAssociate()
   'Make sure to initialize the DICOM engine, this needs to be done only once 
   'In the whole application
   DicomEngine.Startup()

   Using associate As DicomAssociate = 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)
      Dim extendedData As Byte() = 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(Not associate.GetUserInformationDataPtr(0) = Nothing)
      Dim userInformationData As Byte() = 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)
   End Using
   DicomEngine.Shutdown()
End Sub
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();
}
void BuildVerifyAssociate()
 {
     //Make sure to initialize the DICOM engine, this needs to be done only once 
     //In the whole application
     DicomEngine.Startup();
     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);
     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: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DicomAssociate Class
DicomAssociate Members
GetUserRole Method
GetProviderRole Method
SetRoleSelect Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features