# Process DCM
[](https://github.com/pontikos-lab/process-dcm/graphs/commit-activity)
[](https://github.com/pontikos-lab/process-dcm)
[](https://github.com/pontikos-lab/process-dcm)
[](https://github.com/pontikos-lab/process-dcm)
[](https://pypi.org/project/process-dcm/)
[](https://python-poetry.org/)
[](https://github.com/astral-sh/ruff)
[](https://github.com/pre-commit/pre-commit)
## About The Project
Python library and app to extract images from DCM files with metadata in a JSON-based standard format
## Installation and Usage
```bash
pip install process-dcm
```
```bash
Usage: process-dcm [OPTIONS] INPUT_PATH
Process DICOM files in subfolders, extract images and metadata.
Version: 0.9.0
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * input_path PATH Input path to either a DCM file or a folder containing DICOM files. [default: None] [required] │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --image_format -f TEXT Image format for extracted images (png, jpg, webp). [default: png] │
│ --output_dir -o PATH Output directory for extracted images and metadata. [default: exported_data] │
│ --group -g Re-group DICOM files in a given folder by AcquisitionDateTime. │
│ --tol -t FLOAT Tolerance in seconds for grouping DICOM files by AcquisitionDateTime. Only used │
│ when --group is set. │
│ [default: None] │
│ --n_jobs -j INTEGER Number of parallel jobs. [default: 1] │
│ --mapping -m TEXT Path to CSV containing patient_id to study_id mapping. If not provided and │
│ patient_id is anonymised, a 'study_2_patient.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. │
│ --reset -r Reset the output directory if it exists. │
│ --quiet -q Silence verbosity. │
│ --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`](https://python-poetry.org/).
1. Install poetry, via `homebrew` or [`pipx`](https://github.com/pypa/pipx):
```bash
brew install poetry
```
or
```bash
pipx install poetry
```
2. Don't forget to use the python environment you set before and, if using `VScode`, apply it there.
3. It's optional, but we strongly recommend [`commitizen`](https://github.com/commitizen-tools/commitizen), which follows [Conventional Commits](https://www.conventionalcommits.org/)
### Installation
1. Clone the repo
```sh
git clone https://github.com/pontikos-lab/process-dcm
cd process-dcm
```
## Bumping Version
We use [`commitizen`](https://github.com/commitizen-tools/commitizen), which follows [Conventional Commits](https://www.conventionalcommits.org/). The instructions below are only for exceptional cases.
1. Using [poetry-bumpversion](https://github.com/monim67/poetry-bumpversion). Bump the version number by running `poetry version [part] [--dry-run]` where `[part]` is `major`, `minor`, or `patch`, depending on which part of the version number you want to bump.
Use `--dry-run` option to check it in advance.
1. Push the tagged commit created above and the tag itself, i.e.:
```bash
ver_tag=$(poetry version | cut -d ' ' -f2)
git tag -a v"$ver_tag" -m "Tagged version $ver_tag"
git push
git push --tags
```
Raw data
{
"_id": null,
"home_page": "https://github.com/pontikos-lab/process-dcm",
"name": "process-dcm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Alan Silva",
"author_email": "3899850+alanwilter@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/10/84/6635056c030bef62523240f689b5dd40451d44f0c8ad8bc63e6bdae08600/process_dcm-0.10.0.tar.gz",
"platform": null,
"description": "# Process DCM\n\n[](https://github.com/pontikos-lab/process-dcm/graphs/commit-activity)\n[](https://github.com/pontikos-lab/process-dcm)\n[](https://github.com/pontikos-lab/process-dcm)\n[](https://github.com/pontikos-lab/process-dcm)\n[](https://pypi.org/project/process-dcm/)\n[](https://python-poetry.org/)\n[](https://github.com/astral-sh/ruff)\n[](https://github.com/pre-commit/pre-commit)\n\n## About The Project\n\nPython library and app to extract images from DCM files with metadata in a JSON-based standard format\n\n## Installation and Usage\n\n```bash\npip install process-dcm\n```\n\n```bash\n Usage: process-dcm [OPTIONS] INPUT_PATH\n\n Process DICOM files in subfolders, extract images and metadata.\n Version: 0.9.0\n\n\u256d\u2500 Arguments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 * input_path PATH Input path to either a DCM file or a folder containing DICOM files. [default: None] [required] \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --image_format -f TEXT Image format for extracted images (png, jpg, webp). [default: png] \u2502\n\u2502 --output_dir -o PATH Output directory for extracted images and metadata. [default: exported_data] \u2502\n\u2502 --group -g Re-group DICOM files in a given folder by AcquisitionDateTime. \u2502\n\u2502 --tol -t FLOAT Tolerance in seconds for grouping DICOM files by AcquisitionDateTime. Only used \u2502\n\u2502 when --group is set. \u2502\n\u2502 [default: None] \u2502\n\u2502 --n_jobs -j INTEGER Number of parallel jobs. [default: 1] \u2502\n\u2502 --mapping -m TEXT Path to CSV containing patient_id to study_id mapping. If not provided and \u2502\n\u2502 patient_id is anonymised, a 'study_2_patient.csv' file will be generated. \u2502\n\u2502 --keep -k TEXT Keep the specified fields (p: patient_key, n: names, d: date_of_birth, D: \u2502\n\u2502 year-only DOB, g: gender) \u2502\n\u2502 --overwrite -w Overwrite existing images if found. \u2502\n\u2502 --reset -r Reset the output directory if it exists. \u2502\n\u2502 --quiet -q Silence verbosity. \u2502\n\u2502 --version -V Prints app version. \u2502\n\u2502 --install-completion Install completion for the current shell. \u2502\n\u2502 --show-completion Show completion for the current shell, to copy it or customize the installation. \u2502\n\u2502 --help -h Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n```\n\n## For Developers\n\nTo run this project locally, you will need to install the prerequisites and follow the installation section.\n\n### Prerequisites\n\nThis Project depends on the [`poetry`](https://python-poetry.org/).\n\n1. Install poetry, via `homebrew` or [`pipx`](https://github.com/pypa/pipx):\n\n ```bash\n brew install poetry\n ```\n\n or\n\n ```bash\n pipx install poetry\n ```\n\n2. Don't forget to use the python environment you set before and, if using `VScode`, apply it there.\n\n3. It's optional, but we strongly recommend [`commitizen`](https://github.com/commitizen-tools/commitizen), which follows [Conventional Commits](https://www.conventionalcommits.org/)\n\n### Installation\n\n1. Clone the repo\n\n ```sh\n git clone https://github.com/pontikos-lab/process-dcm\n cd process-dcm\n ```\n\n## Bumping Version\n\nWe use [`commitizen`](https://github.com/commitizen-tools/commitizen), which follows [Conventional Commits](https://www.conventionalcommits.org/). The instructions below are only for exceptional cases.\n\n1. Using [poetry-bumpversion](https://github.com/monim67/poetry-bumpversion). Bump the version number by running `poetry version [part] [--dry-run]` where `[part]` is `major`, `minor`, or `patch`, depending on which part of the version number you want to bump.\n\n Use `--dry-run` option to check it in advance.\n\n1. Push the tagged commit created above and the tag itself, i.e.:\n\n ```bash\n ver_tag=$(poetry version | cut -d ' ' -f2)\n git tag -a v\"$ver_tag\" -m \"Tagged version $ver_tag\"\n git push\n git push --tags\n ```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library and app to extract images from DCM in a JSON-based standard format",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://github.com/pontikos-lab/process-dcm",
"Repository": "https://github.com/pontikos-lab/process-dcm"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1a1d482833b9c71bac7c9c7d495b6ad39428e49ca3f3000cb716868f603d741e",
"md5": "3db8e3cae531440825d3e46ad55e946f",
"sha256": "51fec359f4c0d703c92fdc675a2fb7564c4f359162be21f915b43d4e2c80e316"
},
"downloads": -1,
"filename": "process_dcm-0.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3db8e3cae531440825d3e46ad55e946f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 17967,
"upload_time": "2025-07-09T08:24:35",
"upload_time_iso_8601": "2025-07-09T08:24:35.504130Z",
"url": "https://files.pythonhosted.org/packages/1a/1d/482833b9c71bac7c9c7d495b6ad39428e49ca3f3000cb716868f603d741e/process_dcm-0.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "10846635056c030bef62523240f689b5dd40451d44f0c8ad8bc63e6bdae08600",
"md5": "118c91d24c11fdebd2d5f58c00befa0c",
"sha256": "2296a31c5bb33aeee3453380a666e6df63ed247c96e27d7a4ff8f7352179299d"
},
"downloads": -1,
"filename": "process_dcm-0.10.0.tar.gz",
"has_sig": false,
"md5_digest": "118c91d24c11fdebd2d5f58c00befa0c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 17843,
"upload_time": "2025-07-09T08:24:36",
"upload_time_iso_8601": "2025-07-09T08:24:36.485383Z",
"url": "https://files.pythonhosted.org/packages/10/84/6635056c030bef62523240f689b5dd40451d44f0c8ad8bc63e6bdae08600/process_dcm-0.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-09 08:24:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pontikos-lab",
"github_project": "process-dcm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "process-dcm"
}