←Select platform

InsertModule Method

Summary
Inserts a new module in the Data Set.
Syntax
C#
Objective-C
C++/CLI
Java
public DicomModule InsertModule( 
   DicomModuleType module, 
   bool optional 
) 
- (nullable LTDicomModule *)insertModule:(LTDicomModuleType)module optional:(BOOL)optional; 
public DicomModule insertModule(DicomModuleType module, boolean optional) 
public: 
DicomModule^ InsertModule(  
   DicomModuleType module, 
   bool optional 
)  

Parameters

module
The module to be inserted.

optional
true to insert all elements of the specified module; false to insert only the mandatory elements of the specified module.

Return Value

The newly inserted module.

Remarks

LEAD controls the placement of the module in the Data Set.

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
public void DicomModuleSample() 
{ 
   //Make sure to initialize the DICOM engine, this needs to be done only once  
   //In the whole application 
   DicomEngine.Startup(); 
   using (DicomDataSet dicomDataset = new DicomDataSet()) 
   { 
      dicomDataset.Initialize(DicomClassType.DXImageStoragePresentation, DicomDataSetInitializeType.ExplicitVRLittleEndian); 
      dicomDataset.DeleteModule(DicomModuleType.Patient); 
      dicomDataset.InsertModule(DicomModuleType.Patient, false); 
      DicomModule module = dicomDataset.FindModule(DicomModuleType.Patient); 
      Debug.Assert(module != null); 
      bool found = false; 
      for (int i = 0; i < dicomDataset.ModuleCount; i++) 
      { 
         module = dicomDataset.FindModuleByIndex(i); 
         if (module.Type == DicomModuleType.Patient) 
         { 
            found = true; 
         } 
      } 
      Debug.Assert(found); 
   } 
   DicomEngine.Shutdown(); 
} 
Requirements

Target Platforms

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

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