Leadtools.Dicom.Common Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
DicomEditableObject Class
See Also  Members  
Leadtools.Dicom.Common.Editing Namespace : DicomEditableObject Class



A custom object that represents a DICOM dataset.

Object Model

DicomEditableObject Class

Syntax

Visual Basic (Declaration) 
Public Class DicomEditableObject 
   Implements IComponentICustomTypeDescriptorIDisposable 
Visual Basic (Usage)Copy Code
Dim instance As DicomEditableObject
C# 
public class DicomEditableObject : IComponentICustomTypeDescriptorIDisposable  
C++/CLI 
public ref class DicomEditableObject : public IComponentICustomTypeDescriptorIDisposable  

Example

This example assigns a value to the DICOM editable object.

Visual BasicCopy Code
<Test> _
Public Sub TestEditableObject()
   Dim dcmObject As DicomEditableObject = New DicomEditableObject()
   Dim ds As DicomDataSet = Nothing
   Dim dicomFileNameIn As String = LeadtoolsExamples.Common.ImagesPath.Path & "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
C#Copy Code
public void TestEditableObject()
{
    DicomEditableObject dcmObject = new DicomEditableObject();
    DicomDataSet ds = null;
    string dicomFileNameIn = LeadtoolsExamples.Common.ImagesPath.Path + "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());
}

Inheritance Hierarchy

System.Object
   Leadtools.Dicom.Common.Editing.DicomEditableObject

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Dicom.Common requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features