(Python) utility to extract meta data from trees of organized DICOM files.
Project description
Quick Overview
Extract DICOM tags.
Overview
pfdicomtag is a dir-based DICOM file tag extractor. By ‘dir-based’ is understood that input DICOMs exist in a nested directory tree, and results of the tag extraction are written an output tree. This tree mimics the structure of the input data tree.
Dependencies
Make sure that the following dependencies are installed on your host system/python3 virtual env:
pydicom (to read DICOM files)
matplotlib (to save data in various image formats)
pillow (to save data in jpg format)
Installation
The best method of installing this script and all of its dependencies is by fetching it from PyPI
pip3 install pydicomtag
You migh get an error about python3-tk not installed. So you should install that package. For example on Ubuntu:
sudo apt-get update
sudo apt-get install -y python3-tk
Command line arguments
- ::
-I|–inputDir <inputDir> Input DICOM directory to examine. By default, the first file in this directory is examined for its tag information. There is an implicit assumption that each <inputDir> contains a single DICOM series.
-i|–inputFile <inputFile> An optional <inputFile> specified relative to the <inputDir>. If specified, then do not perform a directory walk, but convert only this file.
-e|–extension <DICOMextension> An optional extension to filter the DICOM files of interest from the <inputDir>.
[-O|–outputDir <outputDir>] The directory to contain all output files.
NOTE: If neither -F nor -T are specified, a ‘-r raw’ is assumed.
-F|–tagFile <tagFile> Read the tags, one-per-line in <tagFile>, and print the corresponding tag information in the DICOM <inputFile>.
-T|–tagList <tagList> Read the list of comma-separated tags in <tagList>, and print the corresponding tag information parsed from the DICOM <inputFile>.
-m|–image <[<index>:]imageFile> If specified, also convert the <inputFile> to <imageFile>. If the name is preceded by an index and colon, then convert this indexed file in the particular <inputDir>.
-o|–outputFileStem <outputFileStem> The output file stem to store data. This should not have a file extension, or rather, any “.” in the name are considered part of the stem and are not considered extensions.
[-t|–outputFileType <outputFileType>] A comma specified list of output types. These can be:
o <type> <ext> <desc> o raw -raw.txt the raw internal dcm structure to string o json .json a json representation o html .html an html representation with optional image o dict -dict.txt a python dictionary o col -col.txt a two-column text representation (tab sep) o csv .csv a csv representation
[-p|–printToScreen] If specified, will print tags to screen.
[-x|–man] Show full help.
[-y|–synopsis] Show brief help.
-v|–verbosity <level> Set the app verbosity level.
- -1: No internal output.
0: All internal output.
Examples
Replicate a tree and for each DICOM series dir, create multiple reports, including an html output with an embedded image of the center (middle file) of the series:
pfdicomtag -I /var/www/html/normative \
-m m:out.jpg -e dcm \
-o %PatientAge-%md5PatientID \
-O /var/www/html/tag \
-t raw,json,col,csv,html,dict
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
File details
Details for the file pfdicomtag-1.0.0.tar.gz
.
File metadata
- Download URL: pfdicomtag-1.0.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c267fe215ebad9b5f4c56fa31aa3cc17d81d8748227c3de1e8de70620373d6 |
|
MD5 | 65d001f846d14d890385116c77f365aa |
|
BLAKE2b-256 | 1e7681a543bcd6da11ab992af2af95c1b0f8c8cd3e2315f0d4129ddc699c4860 |