Skip to main content

A tool for creating static DICOM web applications

Project description

Static DICOMweb Creator

PyPI version Python Support License: MIT

A Python library and CLI tool for generating static DICOMweb endpoints from DICOM files. Create self-contained, deployable medical imaging web applications without requiring a PACS server or database.

This project was inspired by the RadicalImaging/Static-DICOMWeb (javascript, node.js).

✨ Features

  • 🚀 Zero Server Requirements: Generate static files that can be served from any web server or CDN
  • 🔒 Self-Contained: All DICOM metadata and images converted to web-friendly formats
  • 📊 DICOMweb Compatible: Generates standard DICOMweb API endpoints (WADO-RS)
  • 🌐 OHIF Viewer Ready: Works out-of-the-box with OHIF Viewer for viewing medical images
  • 📦 Easy Deployment: Includes docker templates

📋 Requirements

  • Python 3.9 or higher
  • Frontend viewer: OHIF Viewer (recommended) or any DICOMweb-compatible viewer

🚀 Installation

From PyPI

pip install static-dicomweb-creator

Development Installation

pip install -e ".[dev]"

📖 Usage

Command Line Interface

Basic usage:

static-dicomweb-creator input_dicom_dir base_url output_web_dir

For OHIF viewer:

static-dicomweb-creator --ohif input_dicom_dir base_url output_web_dir

Python API

from static_dicomweb_creator.creator import StaticDICOMWebCreator
from static_dicomweb_creator.utils import list_dicom_files

creator = StaticDICOMWebCreator(
    output_path="/path/to/web",
    root_uri="https://example.com/dicomweb/"
)

for dcm_path in list_dicom_files("/path/to/dicom_files"):
    dcm = pydicom.dcmread(dcm_path)
    creator.add_dcm_instance(dcm)
creator.create_json()

🏗️ Architecture

Input DICOM Files
       ↓
Static DICOMweb Creator
       ↓
Generated Output:
└ studies/
    ├ index.json
    └ {StudyInstanceUID}/
         └ series/
              ├ index.json
              └ {SeriesInstanceUID}/
                   ├ index.json
                   ├ metadata
                   │   └ index.json
                   └ instances/
                        └ {SOPInstanceUID}/
                            ├ metadata
                            │  └ index.json
                            ├ frame
                            │  └ {frame_number}/
                            │       └ index.json
                            └ bulkdata
                                └ {tag}/
                                    └ index.json

🌐 Deployment

With Docker Compose (Recommended)

This repository includes a ready-to-use Docker Compose setup with OHIF Viewer and Nginx:

# use samle_docker/docker-compose.yml placing your generated output in static_dicomweb/
docker-compose up

Access the viewer at http://localhost

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • OHIF Viewer - Open Health Imaging Foundation
  • pydicom - Python library for DICOM files
  • DICOMweb - Web standard for medical imaging

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

static_dicomweb_creator-0.2.10.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

static_dicomweb_creator-0.2.10-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file static_dicomweb_creator-0.2.10.tar.gz.

File metadata

  • Download URL: static_dicomweb_creator-0.2.10.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for static_dicomweb_creator-0.2.10.tar.gz
Algorithm Hash digest
SHA256 e895fa5d09f4a32b4ae9265cc917d0da5aa936a60f652c019863dac3255cff08
MD5 481d00eea2dcd6220bcc90ba7239cf05
BLAKE2b-256 7464ad0b9722498404e9bd0b42e65a93cf43eb4e59ffd34b91582e55d7e51fb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for static_dicomweb_creator-0.2.10.tar.gz:

Publisher: publish_to_pypi.yml on akchan/static_dicomweb_creator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file static_dicomweb_creator-0.2.10-py3-none-any.whl.

File metadata

File hashes

Hashes for static_dicomweb_creator-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 d798f3d1b117773b3dcc28a1006f5fd82049f69df0a5a1b4cbb5cafde8981e35
MD5 e707c34bfe4269e8cbd29c46209c4f0f
BLAKE2b-256 ebdec73de9fa1c05855bf7431d46f829033898ec52f029763d1f019473b98336

See more details on using hashes here.

Provenance

The following attestation bundles were made for static_dicomweb_creator-0.2.10-py3-none-any.whl:

Publisher: publish_to_pypi.yml on akchan/static_dicomweb_creator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page