dicom_anonymiser anonymises dicom files and folders with user customisable tags.
Project description
DICOM Anonymisation Tool
This tool is designed to either:
- Anonymise a single DICOM file, or
- 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
-
Install python3.8+
-
Create a virtual env where you want to install:
$> python3 -m venv dicom_anon
-
Activate the environment
$> source dicom_anon/bin/activate
-
Install the package with pip
$> pip install dcm_anon
-
Having the environment activated, run from the terminal with the help flag to show the above usage info
$> anonymise --help
-
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/
-
Default location of tags file
dicom_anonymiser/lib/python3.x/site-packages/dcm_anon/tags/
-
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
-
Always activate the environment
$> source dicom_anon/bin/activate
-
Single file
anonymise "/Users/me/dcm/original/a_file.dcm" "/Users/me/Desktop/anonymised/"
-
Folder
anonymise "/Users/me/dcm/original/" "/Users/me/Desktop/anonymised/"
-
Using a custom list of tags
anonymise "/Users/me/dcm/original/" "/Users/me/Desktop/anonymised/" -t "/path/to/user_tags.csv"
-
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c6ecffb22d86b2b979d3626e6a58331605a7f8fc509241639e8f0b3381c8cb |
|
MD5 | e2431a53f22c527ad463beefaf4bb416 |
|
BLAKE2b-256 | e456f94ea112e1ed4864ee995db5fa23ec06c56d922be7355a3b3696482adf00 |
File details
Details for the file dicom_anonymiser-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: dicom_anonymiser-0.2.5-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3930e9bce1255e2076d43c726f79f2896d635b60e920a93d7705945645b14e5 |
|
MD5 | de04f843263433ca70549f692fa228f2 |
|
BLAKE2b-256 | 5db797b0ced20a5b6a0e78507479c62c087e36e07994d21c548995add2bc7718 |