←Select platform

FindModuleByIndex Method

Summary
Returns a DicomModule object that contains information about the module, on Level 0, at the specified index.
Syntax
C#
Objective-C
C++/CLI
Java
public DicomModule FindModuleByIndex( 
   int index 
) 
- (nullable LTDicomModule *)findModuleByIndex:(NSUInteger)index NS_SWIFT_NAME(findModuleByIndex(_:)); 
public DicomModule findModuleByIndex(int index) 
public: 
DicomModule^ FindModuleByIndex(  
   int index 
)  

Parameters

index
The zero-based index of the module, on Level 0 of the Data Set, to get.

Return Value

A DicomModule object that contains information about the module at the specified index on Level 0 of the Data Set, or a null reference (Nothing in VB) if no module at the specified index was found. The DicomModule object returned by this method is not unique. It will be overwritten by subsequent calls to FindModule.

Remarks

The DicomModule object returned by this method is not unique. It will be overwritten by subsequent calls to FindModule.

This method only finds modules at a specific index on Level 0 of the Data Set.

To find information about a module within the Data Set use FindModule.

To find specific elements within the Data Set use the following:

FindFirstElement

FindLastElement

FindPreviousElement

FindNextElement

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