dicom-info
A command-line tool for displaying DICOM file information.
Description
dicom-info is a simple Python utility that reads and displays information from DICOM (Digital Imaging and Communications in Medicine) files. It provides a straightforward way to inspect DICOM file metadata from the command line, and can also display DICOM images interactively.
Requirements
- Python >= 3.13
- pydicom >= 3.0.1
- matplotlib >= 3.7.0 (for image display)
- numpy >= 1.24.0 (for image display)
Installation
Not required with uvx, use uvx to start using dicom-info straight away:
uvx dicom-info --help
To use uv as a more traditional package manager, i.e. download dicom-info locally before first use:
uv tool install dicom-info
or pip
pip install dicom-info
Usage
The basic syntax is:
dicom-info FILE [FILE ...]
Displaying Metadata
To display DICOM file metadata:
dicom-info path/to/file.dcm
dicom-info file1.dcm file2.dcm file3.dcm
The tool will display information for each DICOM file, including all available metadata and attributes.
Displaying Images
To display DICOM images interactively, use the --display or -d flag:
dicom-info --display path/to/file.dcm
dicom-info -d file1.dcm file2.dcm file3.dcm
Image display features:
- 2D images: Displayed as grayscale plots with a colorbar
- 3D images: Displayed with an interactive slider to navigate through slices
- Multiple files: Each image is shown in its own subplot with the filename as the title
Error Handling
The tool will exit with status code 1 if:
- Files are not found
- Files are not valid DICOM files
- When using
--display, if no files contain pixel data
License
This project is licensed under the GNU GPL version 3 license which can be found here.
Development
Setup
This project uses uv for dependency management. To set up the development environment:
# Clone the repository
git clone https://github.com/sbu-physics-mri/dicom-info.git
cd dicom-info
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the package with dev dependencies
make install
Running Tests and Checks
This project uses a Makefile as the single source of truth for development commands. All commands can be run locally and are also used in CI.
# Run all CI checks (format, lint, type, coverage)
make ci
# Individual commands:
make lint # Run ruff linting
make format # Check code formatting
make type # Run mypy type checking
make test # Run pytest
make coverage # Run tests with coverage report (80% minimum)
# Apply fixes:
make fix # Auto-fix linting issues and apply formatting
CI/CD
The project uses GitHub Actions for continuous integration. On every pull request and push to main, the following checks run in parallel:
- lint: Code quality checks with ruff
- format: Code formatting validation
- type: Type checking with mypy
- test: Test suite with coverage (minimum 80%)
All checks must pass before merging.
Contributing
Contributions welcome! Please open an issue or submit a pull request.
Metadata
Release files for dicom-info 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dicom_info-0.4.0.tar.gz | 25.2 kB | Without provenance | Details for dicom_info-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dicom_info-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for dicom_info-0.4.0-py3-none-any.whl |
Total release size: 46.9 kB
Release files / dicom_info-0.4.0.tar.gz
| Download URL | dicom_info-0.4.0.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a76d88e1d3041b17cc0a8af68a842bfa5d5fea9a27c467ec7f29311cca74759
|
|
BLAKE2b-256 checksum How to use checksums |
74c45c52ce43d5fc8b053dd4cb17c71abfbe48ae215139495bbb4e29a64a068e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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 / dicom_info-0.4.0-py3-none-any.whl
| Download URL | dicom_info-0.4.0-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cfcef7405085a7d853d39a29c92b2778641aa14f1822b21e5984d1894071e27
|
|
BLAKE2b-256 checksum How to use checksums |
7c2e1f1a9ef258ffd1c4c1f69cc5f738d28b298de63b37870fdff48aff57e405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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 dicom-info 0.4.0
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.