Skip to main content

dicom_anonymiser anonymises dicom files and folders with user customisable tags.

Project description

DICOM Anonymisation Tool

This tool is designed to either:

  1. Anonymise a single DICOM file, or
  2. Anonymise a directory (recursively) of DICOM files

Anonymised files may be saved to a different directory, and may be renamed with _anon suffix.

The script has a default list of tags to anonymise, but the user may point to a custom list.

usage: main.py [-h] [-t TAGFILE] [-i] source destination

Anonymise DICOM images

positional arguments:
  source                location of dicom file or folder to anonymise
  destination           Destination folder to save anonymised images

optional arguments:
  -h, --help            show this help message and exit
  -t TAGFILE, --tagfile TAGFILE
                        path to custom tags file
  -i, --intact          Leave filenames unchanged

Installation

  1. Install python3.8+

  2. Create a virtual env where you want to install:

    $> python3 -m venv dicom_anon
    
  3. Activate the environment

    $> source dicom_anon/bin/activate
    
  4. Install the package with pip

    $> pip install dcm_anon
    
  5. Having the environment activated, run from the terminal with the help flag to show the above usage info

    $> anonymise --help
    
  6. Each anonymisation run will generate a log file placed in the environment's package directory:

    dicom_anon/lib/python3.x/site-packages/dicom_anonymiser/logs/
    
  7. Default location of tags file

    dicom_anonymiser/lib/python3.x/site-packages/dcm_anon/tags/
    
  8. If you want to use your own tags, you can specify them in

    dicom_anonymiser/lib/python3.x/site-packages/dcm_anon/tags/user_tags.csv
    

Usage

  1. Always activate the environment

    $> source dicom_anon/bin/activate
    
  2. Single file

    anonymise "/Users/me/dcm/original/a_file.dcm" "/Users/me/Desktop/anonymised/"
    
  3. Folder

    anonymise "/Users/me/dcm/original/" "/Users/me/Desktop/anonymised/"
    
  4. Using a custom list of tags

    anonymise "/Users/me/dcm/original/" "/Users/me/Desktop/anonymised/" -t "/path/to/user_tags.csv"
    
  5. Keep same filenames (will overwrite if destination directory is same as source)

    anonymise "/Users/me/dcm/original/" "/Users/me/Desktop/anonymised/" -i
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dicom_anonymiser-0.2.5.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

dicom_anonymiser-0.2.5-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file dicom_anonymiser-0.2.5.tar.gz.

File metadata

  • Download URL: dicom_anonymiser-0.2.5.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.5

File hashes

Hashes for dicom_anonymiser-0.2.5.tar.gz
Algorithm Hash digest
SHA256 e6c6ecffb22d86b2b979d3626e6a58331605a7f8fc509241639e8f0b3381c8cb
MD5 e2431a53f22c527ad463beefaf4bb416
BLAKE2b-256 e456f94ea112e1ed4864ee995db5fa23ec06c56d922be7355a3b3696482adf00

See more details on using hashes here.

File details

Details for the file dicom_anonymiser-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for dicom_anonymiser-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c3930e9bce1255e2076d43c726f79f2896d635b60e920a93d7705945645b14e5
MD5 de04f843263433ca70549f692fa228f2
BLAKE2b-256 5db797b0ced20a5b6a0e78507479c62c087e36e07994d21c548995add2bc7718

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page