Purpose

This module performs anonymization of DICOM data according to DICOM standard PS 3.15 annex E.

Usage

Select the required de-identifying options on the panel on the module, and connect a DICOM source - either an ML image or a pure DICOM tree - to the module (note: only one input will be de-identified). The de-identifying step will be performed immediately, but depending on the selected options some tags need manual inspection (indicated by the Had Unhandled Tags flag), in which case the Review button needs to be clicked to go through the list of unhandled tags.

Tips

The anonymization will not be performed if the tag PatientIdentityRemoved (0012,0062) is already set in the dataset with a value of “YES”. In this case the DICOM information is passed through unchanged and Was Already Deidentified is set.

Windows

Default Panel

../../../Projects/MLDicomDeidentify/Modules/mhelp/Images/Screenshots/DicomDeidentify._default.png

Review

../../../Projects/MLDicomDeidentify/Modules/mhelp/Images/Screenshots/DicomDeidentify.Review.png

Panel for performing a manual inspection of tags for identifying information. The user can either click on the check-mark for a tag to confirm that the tag does not contain any identifying information, or click on the cross to remove all content from that tag, or long-click on the value to edit the value.

If all values have been marked as reviewed (recognizable by the fact that all question marks have vanished) Had Unhandled Tags is unset and the output of this module is updated with the resulting DICOM information.

There is also a context menu on the list to restore the original value of a tag if it has been changed accidentally.

Input Fields

input0

name: input0, type: Image

An image input for images with DICOM information needing anonymization.

inDicom

name: inDicom, type: DicomTree(MLBase)

A Base input for pure DICOM information needing anonymization.

For accessing this object via scripting see the Scripting Reference: MLABDicomTree.

Output Fields

output0

name: output0, type: Image

This output contains the image with the de-identifying step applied to all DICOM tags of input0. This will be invalid while Had Unhandled Tags is set.

outDicom

name: outDicom, type: DicomTree(MLBase)

This output contains the DICOM tree from inDicom with the de-identifying step applied to all DICOM tags. This will be empty while Had Unhandled Tags is set, or while output0 has a valid image connected (since the anonymization is only performed on one input at a time).

For accessing this object via scripting see the Scripting Reference: MLABDicomTree.

outReviewDicom (hidden)

name: outReviewDicom, type: MutableDicomTree(MLBase)

Hidden output used in the review step. Contains the DICOM tree from output0 or outReviewDicom in modifiable form.

For accessing this object via scripting see the Scripting Reference: MLABMutableDicomTree.

Parameter Fields

Visible Fields

Patient Identity Handling

name: patientIdentityHandling, type: Enum, default: PI_CLEAR

Select how to handle the main patient identity tags PatientsName, PatientsBirthDate, and PatientId.

Values:

Title Name Description
Clear PI_CLEAR Clear these tags.
User Defined PI_USER_DEFINED Set the values given in the fields Patients Name, Patients Birth Date, and Patient Id.
Auto Generate PI_AUTO_GENERATE

Replace patient name with a fantasy name derived from a cryptographic hash value of the original patient name and birth date. Replace birth date with a date in the same decade derived from the same cryptographic hash value. Remove patient id.

Note

The result of this algorithm is very sensitive to even small changes in the patient name or birth date. Even small changes, e.g., in the notation, lead to completely different names.

See retainSexInGeneratedName if you want the first name to match the actual gender of the patient.

Patients Name

name: patientsName, type: String, default: PATIENT

Set patient’s name if Patient Identity Handling is set to user-defined.

Patients Birth Date

name: patientsBirthDate, type: String, default: 19700101

Set patient’s birth date if Patient Identity Handling is set to user-defined.

Patient Id

name: patientId, type: String, default: 000001

Set patient id if Patient Identity Handling is set to user-defined.

Institution Name

name: institutionName, type: String, default: InstitutionName

This tag will be used as a value for the InstitutionName tag if Retain Institution Identity is false.

Retain UIDs

name: retainUIDs, type: Bool, default: FALSE

If this option is set, UIDs that otherwise would be replaced by their hashed counterpart will be kept as-is.

This option directly implements the option from the DICOM standard.

Retain Device Identity

name: retainDeviceIdentity, type: Bool, default: FALSE

If this option is set, the identity of the devices with which the acquisition was performed is retained.

This option directly implements the option from the DICOM standard.

Retain Institution Identity

name: retainInstitutionIdentity, type: Bool, default: FALSE

If this option is set, the identity of the institution where the acquisition was performed is retained.

This option directly implements the option from the DICOM standard.

Retain Patient Characteristics

name: retainPatientCharacteristics, type: Bool, default: FALSE

If this option is set, tags which contain patient characteristics like, e.g., medication or allergies are retained.

If such tags exists, they might need a manual review step to remove identifying information, which is indicated through the Had Unhandled Tags flag.

This option directly implements the option from the DICOM standard.

Retain Longitudinal Temporal Information

name: retainLongitudinalTemporalInformation, type: Enum, default: OFF

Select how to handle certain temporal information in the DICOM dataset.

This option directly implements the option from the DICOM standard.

Values:

Title Name Description
Off OFF Temporal information tags are removed.
Full FULL Temporal information tags are retained.
Modified MODIFIED

Temporal information tags are retained, but offset by a certain number of days (in the range from 1 to 365 days) that is derived from the cryptographic hash of the patient identity.

Note

The selected offset is highly sensitive to how the patient name is written or the exact birth date given.

Clean Descriptors

name: cleanDescriptors, type: Bool, default: FALSE

If this option is set, tags which contain describing information like the StudyDescription are retained.

Since such tags may contain free text they need a manual review step to remove identifying information, which is indicated through the Had Unhandled Tags flag.

This option directly implements the option from the DICOM standard.

Retain Safe Private Tags

name: retainSafePrivateTags, type: Bool, default: FALSE

If this option is set, private tags specified in field:savePrivateTags are specified as to be safe and are retained.

This option directly implements the option from the DICOM standard.

Safe Private Tags

name: safePrivateTags, type: String

List of safe private DICOM tags that should be retained. Each private tag is specified per line by the following format:

GroupID ElementID PrivateCreator\n

GroupID and ElementID are given as hex string. Private Creator is the value of the private creator tag and may contain blanks e.g.:

0009 0010 MeVis eatDicom

Alternatively the creator string may also be specified on a separate line if prefixed with “CREATOR” - this will be applied to any following line until another creator is specified, or until the creator is specified on the same line:

# This is a comment
CREATOR MeVis eatDicom
0009 0010
0009 0011

Comments are started with a “#”.

Allow Private Creator On Wrong Level

name: allowPrivateCreatorOnWrongLevel, type: Bool, default: FALSE

This allows private tag creator elements of private tags in a sequence item to exist on a higher tree level than the private tag itself.

The DICOM standard requires that the creator element must be contained in the same sequence item as the private tag itself, but unfortunately this isn’t always the case in real world. This option allows the de-identify process to fall back to creator elements from container items (or the root tree itself) if not found in the same sequence item. If this options is not set, private tags with an invalid creator will have an empty creator string and be dropped.

Note

Since setting this option in essence means guessing what the creator string is, there is a chance that the wrong tags are retained/left unchanged.

Had Unhandled Tags

name: hadUnhandledTags, type: Bool, persistent: no

This flag is set if during the de-identify step tags are encountered that mandate a manual inspection for patient identifying content. Until this review is performed, the output of the module stays empty.

When the review has been fully preformed this flag is unset.

Unhandled Tags

name: unhandledTags, type: String, persistent: no

Lists the ids of tags that need a manual inspection.

Was Already Deidentified

name: wasAlreadyDeidentified, type: Bool, persistent: no

This flag is set if the incoming dataset was already de-identified (as indicated through the PatientIdentityRemoved tag).

Review

name: performReview, type: Trigger

Click this button to open a panel to perform the inspection of the tags indicated by Unhandled Tags.

Hidden Fields

retainSexInGeneratedName

name: retainSexInGeneratedName, type: Bool, default: FALSE

If this option is set the first name generated with Patient Identity Handling set to auto-generate will match the gender given in PatientsSex.

Note

If this option is set the first name will change if the value in tag PatientsSex changes.

salt

name: salt, type: String, default: MEVIS

A salt is a value that is used in cryptographic hash computation to make it harder to pre-generate tables which could make it easier to get to the previous value.

Changing this to a new value means that the same UIDs and patient identity values will map to a completely different cryptographic hash than before.