←Select platform

DicomEditableObject Class

Summary

A custom object that represents a DICOM dataset.

Syntax

C#
VB
C++
public class DicomEditableObject : ICustomTypeDescriptor, IComponent, IDisposable 
Public Class DicomEditableObject  
   Implements System.ComponentModel.IComponent, System.ComponentModel.ICustomTypeDescriptor, System.IDisposable  
public ref class DicomEditableObject : public System.ComponentModel.IComponent, System.ComponentModel.ICustomTypeDescriptor, System.IDisposable   

Example

This example assigns a value to the DICOM editable object.

C#
VB
using Leadtools.Dicom.Common.DataTypes; 
using Leadtools.Dicom.Common.Extensions; 
using Leadtools.Dicom; 
using Leadtools.Dicom.Common.Editing.Converters; 
using Leadtools.Dicom.Common.Editing; 
 
 
public void TestEditableObject() 
{ 
   DicomEditableObject dcmObject = new DicomEditableObject(); 
   DicomDataSet ds = null; 
   string dicomFileNameIn = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm"); 
 
   DicomEngine.Startup(); 
 
   ds = new DicomDataSet(); 
   ds.Load(dicomFileNameIn, DicomDataSetLoadFlags.None); 
   dcmObject.BeforeAddElement += new EventHandler<BeforeAddElementEventArgs>(dcmObject_BeforeAddElement); 
   dcmObject.DataSet = ds; 
   Console.WriteLine("Root Element Count: " + dcmObject.Elements.Count.ToString()); 
 
   // 
   // At this point the object can be assigned to a property grid. 
   // 
 
   DicomEngine.Shutdown(); 
} 
 
void dcmObject_BeforeAddElement(object sender, BeforeAddElementEventArgs e) 
{ 
   Console.WriteLine(e.Element.Name); 
   Console.WriteLine(e.Element.DicomElement.VR.ToString()); 
} 
 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; 
} 
Imports Leadtools.Dicom.Common.DataTypes 
Imports Leadtools.Dicom.Common.Extensions 
Imports Leadtools.Dicom 
Imports Leadtools.Dicom.Common.Editing.Converters 
Imports Leadtools.Dicom.Common.Editing 
 
 
Public Sub TestEditableObject() 
   Dim dcmObject As DicomEditableObject = New DicomEditableObject() 
   Dim ds As DicomDataSet = Nothing 
   Dim dicomFileNameIn As String = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm") 
 
   DicomEngine.Startup() 
 
   ds = New DicomDataSet() 
   ds.Load(dicomFileNameIn, DicomDataSetLoadFlags.None) 
   AddHandler dcmObject.BeforeAddElement, AddressOf dcmObject_BeforeAddElement 
   dcmObject.DataSet = ds 
   Console.WriteLine("Root Element Count: " & dcmObject.Elements.Count.ToString()) 
 
   ' 
   ' At this point the object can be assigned to a property grid. 
   ' 
   DicomEngine.Shutdown() 
End Sub 
 
Private Sub dcmObject_BeforeAddElement(ByVal sender As Object, ByVal e As BeforeAddElementEventArgs) 
   Console.WriteLine(e.Element.Name) 
   Console.WriteLine(e.Element.DicomElement.VR.ToString()) 
End Sub 
 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Common Assembly