Occurs before a tag is anonymized.
public event EventHandler<BeforeTagAnonymizationEventArgs> BeforeTagAnonymization Public Event BeforeTagAnonymization As EventHandler(Of BeforeTagAnonymizationEventArgs) public:event EventHandler<BeforeTagAnonymizationEventArgs^>^ BeforeTagAnonymization
The event handler receives an argument of type BeforeTagAnonymizationEventArgs containing data related to this event. The following BeforeTagAnonymizationEventArgs properties provide information specific to this event.
| Property | Description |
|---|---|
| Cancel (Inherited from System.ComponentModel.CancelEventArgs) | Gets or sets a value indicating whether the event should be canceled. |
| CurrentValue | Gets the current value of the DICOM element. |
| Element | Gets the element in the DICOM dataset that is being anonymized. |
| NewValue | Gets or sets the new value of the DICOM element. |
This event will occur after the tag has been processed with the MacroProcessor.
This example anonymizes a dataset using the DICOM Anonymization basic profile.
using Leadtools.Dicom.Common.Anonymization;using Leadtools.Dicom;public void AnonymizationSample(){Anonymizer anonymizer = new Anonymizer();string dicomFileNameIn = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm");anonymizer.Progress += new EventHandler<ProgressEventArgs>(anonymizer_Progress);anonymizer.BeforeTagAnonymization += new EventHandler<BeforeTagAnonymizationEventArgs>(anonymizer_BeforeTagAnonymization);using (DicomDataSet source = new DicomDataSet()){string oldPatientId = string.Empty;source.Load(dicomFileNameIn, DicomDataSetLoadFlags.None);oldPatientId = source.GetValue<string>(DicomTag.PatientID, string.Empty);anonymizer.Anonymize(source);//// The values should not be equal because the anonymizer has provided 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<string>(DicomTag.PatientID, string.Empty));}}void anonymizer_BeforeTagAnonymization(object sender, BeforeTagAnonymizationEventArgs e){Console.WriteLine(string.Format("Tag: {0}, Current Value: {1}, New Value: {0} ", e.Element.Tag, e.CurrentValue, e.NewValue));}void anonymizer_Progress(object sender, ProgressEventArgs e){Console.WriteLine("Progress: " + e.Progress.ToString());}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports Leadtools.Dicom.Common.AnonymizationImports Leadtools.DicomPublic Sub AnonymizationSample()Dim anonymizer As New Anonymizer()Dim dicomFileNameIn As String = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")AddHandler anonymizer.Progress, AddressOf anonymizer_ProgressAddHandler anonymizer.BeforeTagAnonymization, AddressOf anonymizer_BeforeTagAnonymizationUsing source As New DicomDataSet()Dim oldPatientId As String = String.Emptysource.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 provided 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 UsingEnd SubPrivate 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 SubPrivate Sub anonymizer_Progress(ByVal sender As Object, ByVal e As ProgressEventArgs)Console.WriteLine("Progress: " + e.Progress.ToString())End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
|
Products |
Support |
Feedback: BeforeTagAnonymization Event - Leadtools.Dicom.Common |
Introduction |
Help Version 19.0.2017.6.23
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.