Python library and app to extract images from DCM in private-eye format
Project description
Process DCM
About The Project
Python library and app to extract images from DCM files with metadata in private-eye format
Installation and Usage
pip install process-dcm
Usage: process-dcm [OPTIONS] INPUT_DIR
Process DICOM files in subfolders, extract images and metadata using parallel processing.
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────╮
│ * input_dir TEXT Input directory containing subfolders with DICOM files. [default: None] │
│ [required] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────╮
│ --image_format -f TEXT Image format for extracted images (png, jpg, webp). Defaults │
│ to: png │
│ [default: png] │
│ --output_dir -o TEXT Output directory for extracted images and metadata. Defaults │
│ to: exported_data │
│ [default: exported_data] │
│ --relative -r Save extracted data in folders relative to _input_dir_. │
│ --n_jobs -j INTEGER Number of parallel jobs. Defaults to: 1 [default: 1] │
│ --mapping -m TEXT Path to CSV containing patient_id to study_id mapping. If │
│ not provided and patient_id is not anonymised, a │
│ 'patient_2_study_id.csv' file will be generated │
│ --keep -k TEXT Keep the specified fields (p: patient_key, n: names, d: │
│ date_of_birth, D: year-only DOB, g: gender) │
│ --overwrite -w Overwrite existing images if found. │
│ --verbose -v Verbose output. │
│ --version -V Prints app version │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or │
│ customize the installation. │
│ --help -h Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯
For Developers
To run this project locally, you will need to install the prerequisites and follow the installation section.
Prerequisites
This Project depends on the poetry
.
-
Install poetry, via
homebrew
orpipx
:brew install poetry
or
pipx install poetry
-
Don't forget to use the python environment you set before and, if using
VScode
, apply it there. -
It's optional, but we strongly recommend
commitizen
, which follows Conventional Commits
Installation
-
Clone the repo
git clone https://github.com/pontikos-lab/process-dcm cd process-dcm
Bumping Version
We use commitizen
. The instructions below are only for exceptional cases.
-
Using poetry-bumpversion. Bump the version number by running
poetry version [part] [--dry-run]
where[part]
ismajor
,minor
, orpatch
, depending on which part of the version number you want to bump.Use
--dry-run
option to check it in advance. -
Push the tagged commit created above and the tag itself, i.e.:
ver_tag=$(poetry version | cut -d ' ' -f2) git tag -a v"$ver_tag" -m "Tagged version $ver_tag" git push git push --tags
Project details
Release history Release notifications | RSS feed
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 process_dcm-0.2.0.tar.gz
.
File metadata
- Download URL: process_dcm-0.2.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c79d6ec7182b9d1ad841c36fa7c4bb5f7021d05ac5cdd113877c8683c4532772 |
|
MD5 | 7013a545776ebb5aeaaa7cae88e5c6d4 |
|
BLAKE2b-256 | 4c3cddd1130f5eba6977fb98dbfea2ca635824dcf47ec242608f1aa345364ff3 |
File details
Details for the file process_dcm-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: process_dcm-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48c54e6474f272150f033831b5228f16fd3fde1244f30ccf33d307cf9191cdf |
|
MD5 | 1a6b9a067573132849b0c47180b58fe5 |
|
BLAKE2b-256 | 21eeaf7f29fcd9cda960ba7a6d3e3d83fdd3c2403782519b357a1398e56ef468 |