←Select platform

InitializeCommandSet Method

Summary

Creates the Command Set and inserts the elements for the specified command.

Syntax
C#
VB
C++
public void InitializeCommandSet( 
   DicomCommandType commandType, 
   bool request 
) 
Public Sub InitializeCommandSet( _ 
   ByVal commandType As DicomCommandType, _ 
   ByVal request As Boolean _ 
)  
public: 
void InitializeCommandSet(  
   DicomCommandType commandType, 
   bool request 
)  

Parameters

commandType
Type of command to create.

request
true to create the command set as a request; false to create the command set as a response.

Remarks

A Command Set is a special type of Data Set. Therefore, to create a Command Set, create a Data Set by instantiating DicomDataSet, and then initialize it by calling InitializeCommandSet method.

Example

This example will initialize a new DICOM command set and copy it to another command set.

C#
VB
using Leadtools; 
using Leadtools.Dicom; 
 
public void TestCommandSet() 
{ 
   //Make sure to initialize the DICOM engine, this needs to be done only once  
   //In the whole application 
   DicomEngine.Startup(); 
   using (DicomDataSet ds = new DicomDataSet()) 
   { 
      ds.InitializeCommandSet(DicomCommandType.CFind, true); 
      Debug.Assert(ds.InformationCommand == DicomCommandType.CFind); 
      Debug.Assert(ds.IsRequestCommand == true); 
      using (DicomDataSet ds1 = new DicomDataSet()) 
      { 
         ds1.Copy(ds, null, null); 
      } 
   } 
   DicomEngine.Shutdown(); 
} 
Imports Leadtools 
Imports Leadtools.Dicom 
 
Public Sub TestCommandSet() 
   'Make sure to initialize the DICOM engine, this needs to be done only once  
   'In the whole application 
   DicomEngine.Startup() 
 
   Dim ds As DicomDataSet = New DicomDataSet() 
   Using (ds) 
      ds.InitializeCommandSet(DicomCommandType.CFind, True) 
      Debug.Assert(ds.InformationCommand = DicomCommandType.CFind) 
      Debug.Assert(ds.IsRequestCommand = True) 
 
      Dim ds1 As DicomDataSet = New DicomDataSet() 
      Using (ds1) 
         ds1.Copy(ds, Nothing, Nothing) 
      End Using 
 
   End Using 
 
   DicomEngine.Shutdown() 
End Sub 

Requirements

Target Platforms

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

Leadtools.Dicom Assembly