Leadtools.Dicom.Common

Progress Event

Show in webframe
Example 





Anonymization progress notification event.
Syntax
public event EventHandler<ProgressEventArgs> Progress
'Declaration
 
Public Event Progress As EventHandler(Of ProgressEventArgs)
'Usage
 
Dim instance As Anonymizer
Dim handler As EventHandler(Of ProgressEventArgs)
 
AddHandler instance.Progress, handler

            

            
public:
event EventHandler<ProgressEventArgs^>^ Progress
Event Data

The event handler receives an argument of type ProgressEventArgs containing data related to this event. The following ProgressEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs)Gets or sets a value indicating whether the event should be canceled.
Progress Gets or sets the current progress.
Example
Copy Code  
Imports Leadtools.Dicom.Common.Anonymization
Imports Leadtools.Dicom

Public Sub AnonymizationSample()
   Dim anonymizer As New Anonymizer()
   Dim dicomFileNameIn As String = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")

   AddHandler anonymizer.Progress, AddressOf anonymizer_Progress
   AddHandler anonymizer.BeforeTagAnonymization, AddressOf anonymizer_BeforeTagAnonymization
   Using source As New DicomDataSet()
      Dim oldPatientId As String = String.Empty

      source.Load(dicomFileNameIn, DicomDataSetLoadFlags.None)
      oldPatientId = source.GetValue(Of String)(DicomTag.PatientID, String.Empty)
      anonymizer.Anonymize(source)

      '
      ' The values should not be equal because the anonymizer has provide another patient ID using the Dicom Anonymization basic profile.
      ' By default the following macro is provided for patient id: ${random_string}
      '
      Debug.Assert(oldPatientId <> source.GetValue(Of String)(DicomTag.PatientID, String.Empty))
   End Using
End Sub

Private Sub anonymizer_BeforeTagAnonymization(ByVal sender As Object, ByVal e As BeforeTagAnonymizationEventArgs)
   Console.WriteLine(String.Format("Tag: {0}, Current Value: {1}, New Value: {0} ", e.Element.Tag, e.CurrentValue, e.NewValue))
End Sub

Private Sub anonymizer_Progress(ByVal sender As Object, ByVal e As ProgressEventArgs)
   Console.WriteLine("Progress: " + e.Progress.ToString())
End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
Requirements

Target Platforms

See Also

Reference

Anonymizer Class
Anonymizer Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 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