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
Hashes for dicom_anonymiser-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64a143306db1001c73775f32cff369668f5aea3bd9adfaa46fc3b229233db745 |
|
MD5 | 0d5eb0cd733be9ec48722136116816f4 |
|
BLAKE2b-256 | fb0a9995fa9307381040dc9ef97afcf4d16bcaf95748eeaac375e7110d3d0fab |