Skip to main content

dichotomise Version Licence CI DOI

DIChOtoMise checks, sorts, renames, optionally sanitises and archives DICOM exports. It was prompted by problems we found in Siemens XA60+ exports.

Contents

Why dichotomise?

TL;DR: Scanner exports reuse filenames and can contain duplicated or misfiled images. Dichotomise checks DICOM headers and file content to make those problems visible.

XA60+ exports name files 1.dcm, 2.dcm and so on in every series folder. Two unrelated images can therefore have the same filename. Once a file is separated from its folder, the filename does not identify it, even though its header carries a SOP Instance UID.

The export format makes good data-handling practice difficult. Dichotomise addresses each problem as follows:

Export problem What dichotomise does
Repeated filenames hide file identity and can collide when files are moved. Uses the SOP Instance UID from the header in each rectified filename.
A file's series folder can contradict its header. Audits series metadata and sends files that disagree with their folder's majority to review.
A repeated export can add byte-identical files. Detects byte-identical copies within each source folder and sends later copies to review. A copy in another folder is written once, not twice.
Two different files can claim one SOP Instance UID. Sends every file in the group to review as a sop_conflict, never as a duplicate.
Processing can obscure the original export. Archives the untouched source DICOMs and records manifests before processing.

Two examples prompted this work. One Series 22 image was found in a Series 21 folder. In another export, an 81-image DWI series appeared twice as 162 files; each duplicate pair was byte-identical. The files show what happened to the export, but do not establish the underlying cause.

Read the background and incident accounts for the examples, evidence and limitations. The workflow guide explains the checks and how retained and review files are handled.

Installation

TL;DR: Create a Python 3.11+ virtual environment and install from PyPI.

python3.11 -m venv .venv
source .venv/bin/activate
pip install dichotomise
dichotomise --help

For conda, uv, source checkouts and containers, see the installation guide.

Quick start

TL;DR: Give dichotomise a source directory and an output directory. Use --qc to audit the source in place without creating files.

dichotomise --source-dir ./study/sub-001 --out-dir ./dichotomise-runs
dichotomise --qc --source-dir ./study/sub-001

To only sort a folder of DICOMs into <subject>/<series>/ subfolders, use --sort. It works in place when every file sits directly in the source folder (no --out-dir); otherwise give --out-dir to sort a copy. Add --dry-run first to see the plan; in place moves your originals.

dichotomise --sort --dry-run --source-dir ./study/sub-001
dichotomise --sort --source-dir ./study/sub-001

Use --sanitise to apply a policy to processed and review files. Choose the policy carefully: descriptions can contain identifying text, and the untouched source archive retains the original identifiers. See the sanitisation policies before sharing output.

See usage and output for all options, mapping files, archive contents and reports.

Documentation

TL;DR: Start with the guide for the task you need.

Citation and licence

TL;DR: Cite the Zenodo concept DOI; the project uses the MIT licence.

Each release is archived on Zenodo. Citation metadata is in CITATION.cff, which GitHub renders as a "Cite this repository" button, or cite it directly:

Kashyap, S. (2026). dichotomise [Computer software]. https://doi.org/10.5281/zenodo.23166271

The project is licensed under the MIT licence.

Metadata

Release files for dichotomise 2.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dichotomise 2.9.5
File Size Uploaded Provenance Actions
dichotomise-2.9.5.tar.gz 109.3 kB Without provenance Details for dichotomise-2.9.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dichotomise 2.9.5
File Interpreter ABI Platform Actions
dichotomise-2.9.5-py3-none-any.whl Python 3 none any Details for dichotomise-2.9.5-py3-none-any.whl

Total release size: 191.4 kB

Release files / dichotomise-2.9.5.tar.gz

Download URL dichotomise-2.9.5.tar.gz
Size 109.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe536226d9d37451cfa4a8f1b958471a2c6e02928b59b9ad97f2548e40d59cf
BLAKE2b-256 checksum
How to use checksums
d80798fe0988100e339d501d8337299c57ba5f92bb60c898a87a62791ccf95c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dichotomise-2.9.5-py3-none-any.whl

Download URL dichotomise-2.9.5-py3-none-any.whl
Size 82.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87d75594e791a9c7b0b00fc4c9cb92ac54d90ddf6aa878cbdc2ad2befe5fc735
BLAKE2b-256 checksum
How to use checksums
a931982d92c8462b9ebecab08d74c571eeeb466ed41818f81a13ef3b88c4b4e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for dichotomise 2.9.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page