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

DeleteModule Method

Example 







The module to be deleted.
Deletes a module from the Data Set. .NET support WinRT support Silverlight support
Syntax
public void DeleteModule( 
   DicomModuleType module
)
'Declaration
 
Public Sub DeleteModule( _
   ByVal module As DicomModuleType _
) 
'Usage
 
Dim instance As DicomDataSet
Dim module As DicomModuleType
 
instance.DeleteModule(module)
public void DeleteModule( 
   DicomModuleType module
)
ObjectiveC Syntax
 function Leadtools.Dicom.DicomDataSet.DeleteModule( 
   module 
)
public:
void DeleteModule( 
   DicomModuleType module
) 

Parameters

module
The module to be deleted.
Remarks
You can remove all items from the Data Set using Reset.
Example
Copy CodeCopy Code  
Public Sub DicomModuleSample()
   'Make sure to initialize the DICOM engine, this needs to be done only once 
   'In the whole application
   DicomEngine.Startup()

   Dim dicomDataset As DicomDataSet = New DicomDataSet()
   Using (dicomDataset)

      dicomDataset.Initialize(DicomClassType.DXImageStoragePresentation, DicomDataSetInitializeType.ExplicitVRLittleEndian)
      dicomDataset.DeleteModule(DicomModuleType.Patient)
      dicomDataset.InsertModule(DicomModuleType.Patient, False)
      Dim [module] As DicomModule = dicomDataset.FindModule(DicomModuleType.Patient)
      Debug.Assert(Not [module] Is Nothing)
      Dim found As Boolean = False
      Dim i As Integer = 0
      Do While i < dicomDataset.ModuleCount
         [module] = dicomDataset.FindModuleByIndex(i)
         If [module].Type = DicomModuleType.Patient Then
            found = True
         End If
         i += 1
      Loop
      Debug.Assert(found)
   End Using

   DicomEngine.Shutdown()
End Sub
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();
}
[TestMethod]
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();
}
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();
}
Public Sub DicomModuleSample()
   'Make sure to initialize the DICOM engine, this needs to be done only once 
   'In the whole application
   DicomEngine.Startup()
   Using dicomDataset As DicomDataSet = New DicomDataSet()
      dicomDataset.Initialize(DicomClassType.DXImageStoragePresentation, DicomDataSetInitializeType.ExplicitVRLittleEndian)
      dicomDataset.DeleteModule(DicomModuleType.Patient)
      dicomDataset.InsertModule(DicomModuleType.Patient, False)
      Dim [module] As DicomModule = dicomDataset.FindModule(DicomModuleType.Patient)
      Debug.Assert(Not [module] Is Nothing)
      Dim found As Boolean = False
      Dim i As Integer = 0
      Do While i < dicomDataset.ModuleCount
         [module] = dicomDataset.FindModuleByIndex(i)
         If [module].Type = DicomModuleType.Patient Then
            found = True
         End If
         i += 1
      Loop
      Debug.Assert(found)
   End Using
   DicomEngine.Shutdown()
End Sub
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

DicomDataSet Class
DicomDataSet Members
DeleteElement Method
Reset 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