Leadtools.Dicom.Common
LEAD Technologies, Inc

DicomEditableObject Class

Example 





Members 
A custom object that represents a DICOM dataset.
Object Model
DicomEditableObject Class
Syntax
Example
Copy CodeCopy Code  
<Test> _
   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
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";
}
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

DicomEditableObject Members
Leadtools.Dicom.Common.Editing Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

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