DICOM Metadata Explorer is a graphical desktop application designed for viewing, managing, and analyzing DICOM files.
- Load, Edit & Save DICOM Files: Easily load, edit one or more DICOM files and save them as needed — via the Open dialog, recent files menu, drag & drop, or command-line arguments (
python src/main.py file.dcm folder/). Unsaved changes are marked in the window title and guarded by confirmation dialogs; files or whole studies can be closed from the thumbnail context menu. - Save All: Save every modified file in one step (
Ctrl+Shift+S) — in place, or as copies into a chosen folder (handy after batch anonymization). - Thumbnail View: The resizable left panel groups files by study, sorted by
StudyInstanceUID(thumbnails within a study by instance number). Thumbnails are decoded in background threads, so loading many files does not freeze the UI. - Metadata Viewer: Viewer & editor for DICOM tags — add tags via the + Add Tag button (
Ctrl+T) with keyword autocompletion, automatic VR lookup, and a VR picker for private tags; edit and delete tags with undo (Ctrl+Z), copy values (Ctrl+C), search across sequences. - Metadata Export: Export all tags of a file to JSON or CSV (
Ctrl+E). - Anonymization: Remove person names, identifying tags, and private tags from the current file or all loaded files at once.
- Compare Files: Side-by-side metadata comparison of two loaded files with differences highlighted.
- Image Viewer: A tools bar with Fit / 1:1 / rotate / flip / invert / reset W/L / copy view / save as PNG (all with keyboard shortcuts), zoom (
+/-/0/1or mouse wheel), pan, multi-frame files with a frame slider, interactive window/level (right mouse drag,Rto reset), pixel value under cursor, and distance measurement (Shift+ left drag,Escto remove). - Structured Reports: SR files (text reports) are rendered as a readable document in the Content tab — nested sections, text, measurements with units, codes, and references.
- Overview & Validation: A readable summary of the file (patient, study, image, equipment, transfer syntax, pixel statistics) plus automatic consistency checks — missing required tags, pixel data length, bit depth consistency, photometric interpretation, window values, and more.
- Clone the repository:
git clone https://github.com/jholaj/DicomMetadataExplorer.git cd DicomMetadataExplorer - Set up a Python virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the project (dependencies are defined in
pyproject.toml):pip install -e . - Run the application:
python src/main.py
Linting and formatting are handled by ruff (configured in pyproject.toml):
pip install ruff
ruff format src
ruff check src --fix- Launch the application.
- Use the Open button on the toolbar (
Ctrl+O) to load one or more DICOM files, or drag & drop files or whole folders into the window (files without the.dcmextension are detected automatically). - View thumbnails in the left panel. Click a thumbnail to display its content and metadata.
- Switch between the Metadata and Content tabs to explore the file. Use
Ctrl+Fto search tags, including values inside sequences. Right-click in the metadata view to add, edit, or delete tags. - In the Content tab, adjust brightness/contrast (window/level) by dragging with the right mouse button; press
Rto reset,+/-to zoom, and0to fit the image to the window. - Save changes using the Save button (
Ctrl+S), or export metadata to JSON/CSV (Ctrl+E).
- The viewer supports grayscale images (CR/DX and similar) as well as color (RGB/YBR) images such as secondary captures; window/level applies to grayscale only.
- The application supports DICOM files with uncompressed pixel data or those compressed using supported formats (e.g., JPEG Lossless). Ensure dependencies like
pylibjpegorgdcmare installed for proper handling of compressed files. - Thumbnail generation may fail for some DICOM files without valid pixel data or unsupported compression.
- This tool is for research and educational purposes; it is not suitable for clinical decision-making.
This project is licensed under the MIT License.


