DicomPressor

Free, open-source CLI tool for merging, splitting, compressing, anonymizing, and converting DICOM medical imaging files. Cross-platform. No GUI needed.

macOS Windows / PowerShell Linux / WSL
Download Web Tool GitHub

16 Powerful Features

Everything you need to work with DICOM files from the command line — analogous to Sante Dicommander.

-j

Merge to Multi-Frame

Merge hundreds of single-frame DICOM files into one Enhanced CT multi-frame file with correct 3D spatial reconstruction.

-s

Split Multi-Frame

Split a multi-frame DICOM file back into individual single-frame files.

-x / -z

Compress

Compress DICOM files using JPEG Lossless (-x) or JPEG Lossy (-z) transfer syntaxes.

-u

Decompress

Decompress compressed DICOM files back to uncompressed transfer syntax.

-a / -A

Anonymize

Remove or replace patient-identifying information using a parameter file. Supports rectangle masks for burned-in annotations.

-m / -M

Modify Tags

Insert, modify, or remove any DICOM tag using a simple parameter file.

-I / -i

Export to Images

Export DICOM files to JPEG, PNG, BMP, or TIFF images.

-E / -e

Export to Video

Export multi-frame DICOM files to AVI video.

-d / -D

Create DICOMDIR

Generate a DICOMDIR index file for a folder of DICOM files.

-t

Export Headers

Export DICOM headers (metadata) to human-readable text files.

-b / -l

Endian Conversion

Convert between Little Endian and Big Endian transfer syntaxes.

-p / -n

NEMA2 Conversion

Convert between legacy NEMA2 format and modern DICOM 3.0 Part 10.

--info

File Info

Display detailed information about a DICOM file — dimensions, modality, transfer syntax, patient info, and more.

--summary

Folder Summary

Get an overview of all DICOM files in a folder — patient count, series, modalities, and statistics.

--skip-if-done

Skip If Done

Idempotent processing — creates a .dicompressor_done marker after success. Safe to run repeatedly via cron or scheduler.

--watch N

Watch Mode

Continuously monitors a parent folder for new patient subfolders and auto-processes them every N seconds. Standalone watch scripts included.

📦 Installation

DicomPressor requires Python 3.8+ and works on macOS, Windows, and Linux. The wrapper scripts automatically install all dependencies.

macOS / Linux
Windows (PowerShell)
WSL
1

Clone the repository

git clone https://github.com/nsitnov/dicompressor.git cd dicompressor
2

Make the shell wrapper executable

chmod +x dicompressor.sh
3

Run — it auto-installs pydicom, numpy, Pillow on first run

./dicompressor.sh -j -f /path/to/patient_folder

or run directly with Python
pip3 install pydicom numpy Pillow python3 dicompressor.py -j -f /path/to/patient_folder
1

Clone the repository

git clone https://github.com/nsitnov/dicompressor.git cd dicompressor
2

Run the PowerShell wrapper — auto-installs dependencies

.\dicompressor.ps1 -j -f C:\path\to\patient_folder
!

If you get an execution policy error

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

or run directly with Python
pip install pydicom numpy Pillow python dicompressor.py -j -f C:\path\to\patient_folder
1

Open WSL terminal (Ubuntu)

wsl
2

Clone and set up (same as Linux)

git clone https://github.com/nsitnov/dicompressor.git cd dicompressor chmod +x dicompressor.sh
3

Run — access Windows drives via /mnt/c/

./dicompressor.sh -j -f /mnt/c/Users/You/DICOM/patient_folder
!

Install Python if missing

sudo apt update && sudo apt install python3 python3-pip

Requirements

Python 3.8+

Core runtime

pydicom

DICOM file parsing

numpy

Pixel data processing

Pillow

Image export

💻 Usage & Common Commands

DicomPressor uses a simple CLI syntax: dicompressor.py [action] [options] -f/-F <path>

Use -f to scan subfolders recursively, or -F to process a single file or folder only.

MERGE Merge CT slices into one multi-frame DICOM
python3 dicompressor.py -j -f /path/to/patient_folder
SPLIT Split multi-frame back into single frames
python3 dicompressor.py -s -F multiframe.dcm
COMPRESS JPEG Lossless compression
python3 dicompressor.py -x -f /path/to/folder
COMPRESS JPEG Lossy — smaller files, slight quality loss
python3 dicompressor.py -z -f /path/to/folder
DECOMPRESS Decompress back to uncompressed
python3 dicompressor.py -u -f /path/to/folder
ANONYMIZE Anonymize patient data with parameter file
python3 dicompressor.py -a anon_params.txt -f /path/to/folder
MODIFY Modify DICOM tags
python3 dicompressor.py -m modify_params.txt -f /path/to/folder
EXPORT Export DICOM to PNG images
python3 dicompressor.py -I png -f /path/to/folder
EXPORT Export multi-frame DICOM to video
python3 dicompressor.py -E -F multiframe.dcm
DICOMDIR Create DICOMDIR index file
python3 dicompressor.py -d -f /path/to/folder
HEADERS Export DICOM headers to text files
python3 dicompressor.py -t -f /path/to/folder
INFO Get detailed info for a single DICOM file
python3 dicompressor.py --info -F file.dcm
SUMMARY Get folder summary — patients, series, sizes
python3 dicompressor.py --summary -f /path/to/folder
SCHEDULER Merge, but skip if already processed
python3 dicompressor.py -j --skip-if-done -f /path/to/patient
WATCH Auto-process new patient folders every 5 min
python3 dicompressor.py -j --watch 300 -f /path/to/patients/
WATCH+OUTPUT Watch + copy merged files to output dir
python3 dicompressor.py -j --watch 300 --output-dir /data/merged -f /data/patients/
WATCH Standalone watch script (Linux/macOS/WSL)
./dicompressor-watch.sh /path/to/patients 300 /data/merged
WATCH Standalone watch script (Windows PowerShell)
.\dicompressor-watch.ps1 -WatchDir "D:\DICOM\Patients" -OutputDir "D:\Merged"

Parameter File Format

Anonymize and Modify commands accept a simple text file with tag assignments:

ANONYMIZE anon_params.txt
(0010,0010)=ANONYMOUS^PATIENT
(0010,0020)=ANON001
(0010,0030)=19000101
(0010,0040)=O
(0008,0090)=
MODIFY modify_params.txt
(0008,1030)=My Study Description
(0008,103E)=Modified Series

🗃 Vatech Workflow

Use the dedicated Vatech variant when the machine exports a DCM_FILE.CT archive instead of a folder with many small DICOM slices.

Original Workflow

Keep using the default DicomPressor for normal CBCT / CT folders

If the machine already writes hundreds of single-frame .dcm files into one folder, the current generic script stays the right tool.

python3 dicompressor.py -j --skip-if-done -f /path/to/patients
Vatech Variant

Use the dedicated Vatech script for .CT archives

The Vatech variant searches folders for normal slices and Vatech archives in parallel. For every DCM_FILE.CT it extracts to a temp folder, merges the slices, moves the merged output back next to the source data, removes the temp folder, and writes .dicompressor_vatech_done.

python3 dicompressor-vatech.py -j --skip-if-done -f /path/to/patients

Install The Vatech Variant

macOS / Linux

Clone the dedicated Vatech repo or use the ZIP below.

git clone https://github.com/nsitnov/dicompressor-vatech.git cd dicompressor-vatech chmod +x dicompressor-vatech.sh ./dicompressor-vatech.sh -j -F /path/to/patient_folder
Windows

PowerShell wrapper auto-installs the Python dependencies on first run.

git clone https://github.com/nsitnov/dicompressor-vatech.git cd dicompressor-vatech .\dicompressor-vatech.ps1 -j -F C:\path\to\patient_folder
WSL

Run the Linux wrapper inside WSL and point it to the Windows mount.

wsl git clone https://github.com/nsitnov/dicompressor-vatech.git cd dicompressor-vatech ./dicompressor-vatech.sh -j -F /mnt/c/Users/You/DICOM/patient_folder

Common Vatech Commands

Single Folder
python3 dicompressor-vatech.py -j -F /path/to/patient_folder
Skip If Done
python3 dicompressor-vatech.py -j --skip-if-done -f /path/to/patients
Watch Mode
python3 dicompressor-vatech.py -j --watch 300 -f /path/to/patients
Watch + Output
python3 dicompressor-vatech.py -j --watch 300 --output-dir /data/merged -f /data/patients
Behavior

The Vatech script supports normal single-frame DICOM folders and Vatech archives side by side in the same tree. It only writes the marker after the whole folder finishes successfully. If you need to re-run a folder, delete .dicompressor_vatech_done.

⬇️ Download

Download the generic DicomPressor workflow or the dedicated Vatech variant. Both are free and open source.

GitHub Repository

Clone the repo, get updates, contribute, and report issues.

Open on GitHub

Download ZIP

Download the latest version — includes CLI tool, watch scripts, and all dependencies. No Git needed.

Download .zip

Vatech GitHub Repository

Dedicated source repository for the Vatech workflow and future release history.

Open Vatech Repo

Download Vatech ZIP

ZIP package with the dedicated Vatech script, wrapper scripts, watch scripts, and README.

Download Vatech .zip

🧰 Visualize Your DICOM Files

After merging, use the built-in VolView viewer to explore your DICOM data in 3D — right here in the browser. Drag & drop your .dcm file into the viewer below.

VolView — 3D DICOM Viewer Open in new tab ↗

Powered by VolView by Kitware — self-hosted on this server.

📧 Contact & Support

Found a bug? Have a feature request? Need help?

Get In Touch

Report bugs, request features, or ask questions. We'll get back to you as soon as possible.

[email protected]

You can also open an issue on GitHub.