Removing Private Attributes


Private Elements (or Tags) are perfectly legal in DICOM, details of the structure of Private DICOM Elements can be found in DICOM Private Elements.

Removing all Private elements from any DICOM instance is quite simple, following sample code shows you how to do it in DicomObjects.

DicomObjects.NET

 DicomDataSet ds = new DicomDataSet();
 ds.RemovePrivateAttributes();

DicomObjects.COM

 Dim At As DicomAttribute
 Dim Index As Integer
    
 For Index = Image.Attributes.Count To 1 Step -1
 Set At = Image.Attributes.ItemByIndex(Index)        
	If At.Group Mod 2 > 0 Then	  
	  Image.Attributes.Remove At.Group, At.Element ' if odd group number, remove it
	End If
 Next


We use cookies to give you the best possible experience on our website. By continuing to use this website, you agree with our use of cookies. for more information please click HERE