A tool for anonymizing DICOM files
Use it to anonymize one or more DICOM files belonging to one or any number of patients. Objects will remain grouped in their original patients, studies, and series.
The package is available on pypi and can be installed from the command line by typing
pip install dicognito
Anonymizing from the command line
Once installed, a
dicognito command will be added to your Python scripts directory.
You can run it on entire filesystem trees or a collection of files specified by glob like so:
dicognito . # recurses down the filesystem, anonymizing all found DICOM files dicognito *.dcm # anonymizes all files in the current directory with the dcm extension
Files will be anonymized in place, with significant attributes, such as identifiers, names, and addresses, replaced by random values. Dates and times will be shifted a random amount, but their order will remain consistent within and across the files.
Get more help via
Anonymizing from within Python
To anonymize a bunch of DICOM objects from within a Python program, import the objects using
pydicom and use the
import pydicom import dicognito.anonymizer anonymizer = dicognito.anonymizer.Anonymizer() for original_filename in ("original1.dcm", "original2.dcm"): with pydicom.dcmread(original_filename) as dataset: anonymizer.anonymize(dataset) dataset.save_as("clean-" + original_filename)
Use a single
Anonymizer on datasets that might be part of the same series, or the identifiers will not be
consistent across objects.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size dicognito-0.9.1-py3-none-any.whl (30.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size dicognito-0.9.1.tar.gz (26.3 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for dicognito-0.9.1-py3-none-any.whl