Fellow Oak DICOM
Search Results for

    Show / Hide Table of Contents

    Class DicomAnonymizer

    Class for performing anonymization actions on DICOM file or dataset based on selected confidentiality profile.

    Inheritance
    System.Object
    DicomAnonymizer
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: FellowOakDicom
    Assembly: fo-dicom.core.dll
    Syntax
    public class DicomAnonymizer

    Constructors

    DicomAnonymizer(DicomAnonymizer.SecurityProfile)

    Public constructor

    Declaration
    public DicomAnonymizer(DicomAnonymizer.SecurityProfile profile = null)
    Parameters
    Type Name Description
    DicomAnonymizer.SecurityProfile profile

    Optional. The security profile to be used in one or multiple anonymizations. If not specified or null, it will use the default/internal profile

    Fields

    _optionsCount

    Declaration
    protected static readonly int _optionsCount
    Field Value
    Type Description
    System.Int32

    Properties

    Profile

    The security profile for this anonymizer instance

    Declaration
    public virtual DicomAnonymizer.SecurityProfile Profile { get; }
    Property Value
    Type Description
    DicomAnonymizer.SecurityProfile

    ReplacedUIDs

    Context/Output. Contains all the replaced UIDs.

    Declaration
    public virtual Dictionary<string, string> ReplacedUIDs { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>
    Remarks

    Useful for consistency across a file set (multiple calls to anonymization methods)

    Methods

    Anonymize(DicomDataset)

    Clones and anonymizes a dataset

    Declaration
    public virtual DicomDataset Anonymize(DicomDataset dataset)
    Parameters
    Type Name Description
    DicomDataset dataset

    The dataset to be cloned and anonymized

    Returns
    Type Description
    DicomDataset

    Anonymized dataset.

    Anonymize(DicomFile)

    Creates a new Dicom file with an anonymized dataset

    Declaration
    public virtual DicomFile Anonymize(DicomFile file)
    Parameters
    Type Name Description
    DicomFile file

    The file containing the original dataset

    Returns
    Type Description
    DicomFile

    Anonymized dataset.

    AnonymizeInPlace(DicomDataset)

    Anonymizes a dataset witout cloning

    Declaration
    public virtual void AnonymizeInPlace(DicomDataset dataset)
    Parameters
    Type Name Description
    DicomDataset dataset

    The dataset to be altered

    AnonymizeInPlace(DicomFile)

    Anonymizes the dataset of an existing Dicom file

    Declaration
    public virtual void AnonymizeInPlace(DicomFile file)
    Parameters
    Type Name Description
    DicomFile file

    The file containing the dataset to be altered

    BlankItem(DicomDataset, DicomItem, Boolean)

    Blanks an item to value suitable for the concrete item type.

    Declaration
    protected static void BlankItem(DicomDataset dataset, DicomItem item, bool nonZeroLength)
    Parameters
    Type Name Description
    DicomDataset dataset

    Reference to the dataset

    DicomItem item

    DICOM item subject to blanking.

    System.Boolean nonZeroLength

    Require that new value is non-zero length (dummy) value?

    ElementValueType(DicomItem)

    Evaluates whether an element has a generic valueType

    Declaration
    protected static Type ElementValueType(DicomItem item)
    Parameters
    Type Name Description
    DicomItem item
    Returns
    Type Description
    System.Type

    The data type if found, otherwise null

    IsOtherElement(DicomItem)

    Evaluates whether a DICOM item is of type Other*

    Declaration
    protected static bool IsOtherElement(DicomItem item)
    Parameters
    Type Name Description
    DicomItem item
    Returns
    Type Description
    System.Boolean

    A boolean flag indicating whether the item is of the expected type, otherwise false

    ReplaceString(DicomDataset, DicomItem, String)

    Declaration
    protected static void ReplaceString(DicomDataset dataset, DicomItem item, string newString)
    Parameters
    Type Name Description
    DicomDataset dataset

    Reference to the dataset

    DicomItem item

    DICOM item for which the string value should be replaced.

    System.String newString

    The replacement string.

    ReplaceUID(DicomDataset, DicomItem)

    Declaration
    protected virtual void ReplaceUID(DicomDataset dataset, DicomItem item)
    Parameters
    Type Name Description
    DicomDataset dataset

    Reference to the dataset

    DicomItem item

    Extension Methods

    LinqExtensions.IsOneOf<T>(T, T[])
    In This Article
    Back to top Copyright (c) 2012-2025 fo-dicom contributors