Table of Contents

Class DicomAnonymizer

Namespace
FellowOakDicom
Assembly
fo-dicom.core.dll

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

public class DicomAnonymizer
Inheritance
DicomAnonymizer
Inherited Members
Extension Methods

Constructors

DicomAnonymizer(SecurityProfile)

Public constructor

public DicomAnonymizer(DicomAnonymizer.SecurityProfile profile = null)

Parameters

profile DicomAnonymizer.SecurityProfile

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

protected static readonly int _optionsCount

Field Value

int

Properties

Profile

The security profile for this anonymizer instance

public virtual DicomAnonymizer.SecurityProfile Profile { get; }

Property Value

DicomAnonymizer.SecurityProfile

ReplacedUIDs

Context/Output. Contains all the replaced UIDs.

public virtual Dictionary<string, string> ReplacedUIDs { get; }

Property Value

Dictionary<string, string>

Remarks

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

Methods

Anonymize(DicomDataset)

Clones and anonymizes a dataset

public virtual DicomDataset Anonymize(DicomDataset dataset)

Parameters

dataset DicomDataset

The dataset to be cloned and anonymized

Returns

DicomDataset

Anonymized dataset.

Anonymize(DicomFile)

Creates a new Dicom file with an anonymized dataset

public virtual DicomFile Anonymize(DicomFile file)

Parameters

file DicomFile

The file containing the original dataset

Returns

DicomFile

Anonymized dataset.

AnonymizeInPlace(DicomDataset)

Anonymizes a dataset witout cloning

public virtual void AnonymizeInPlace(DicomDataset dataset)

Parameters

dataset DicomDataset

The dataset to be altered

AnonymizeInPlace(DicomFile)

Anonymizes the dataset of an existing Dicom file

public virtual void AnonymizeInPlace(DicomFile file)

Parameters

file DicomFile

The file containing the dataset to be altered

BlankItem(DicomDataset, DicomItem, bool)

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

protected static void BlankItem(DicomDataset dataset, DicomItem item, bool nonZeroLength)

Parameters

dataset DicomDataset

Reference to the dataset

item DicomItem

DICOM item subject to blanking.

nonZeroLength bool

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

ElementValueType(DicomItem)

Evaluates whether an element has a generic valueType

protected static Type ElementValueType(DicomItem item)

Parameters

item DicomItem

Returns

Type

The data type if found, otherwise null

IsOtherElement(DicomItem)

Evaluates whether a DICOM item is of type Other*

protected static bool IsOtherElement(DicomItem item)

Parameters

item DicomItem

Returns

bool

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

ReplaceString(DicomDataset, DicomItem, string)

protected static void ReplaceString(DicomDataset dataset, DicomItem item, string newString)

Parameters

dataset DicomDataset

Reference to the dataset

item DicomItem

DICOM item for which the string value should be replaced.

newString string

The replacement string.

ReplaceUID(DicomDataset, DicomItem)

protected virtual void ReplaceUID(DicomDataset dataset, DicomItem item)

Parameters

dataset DicomDataset

Reference to the dataset

item DicomItem