Skip to main content

Modern multichannel radiochromic film dosimetry

Project description

chromadose

Modern multichannel radiochromic film dosimetry in Python.

chromadose implements all major multichannel film dosimetry methods in one library, with built-in uncertainty estimation, gamma analysis, and PDF reporting.

⚠️ Research use only — not a medical device. chromadose is open-source software for academic research and method development in radiochromic film dosimetry. It is not intended for diagnosis, treatment planning, or clinical decision-making, and has not been evaluated by the FDA, MHRA, or any Notified Body under EU MDR. Clinical use is the sole responsibility of a qualified medical physicist operating under their institution's QA programme. See DISCLAIMER.md for the full statement.

Methods

Method Reference Description
Micke Micke, Lewis, Yu (2011) Original multichannel method — Newton refinement
Mayer Mayer et al. (2012) Analytical optimization with disturbance correction
Multigaussian Mendez et al. (2018) MLE on multivariate Gaussian N(mu(D), Sigma(D))
ANN Chang et al. (2025) Neural network with ensemble uncertainty

The Multigaussian implementation is the first open-source version of this method.

Quick Start

import chromadose as cd
from chromadose.core.image import load_tiff
from chromadose.methods import MickeSolver

# Load and calibrate
film = load_tiff("treatment_film.tif")
cal = cd.Calibration.from_arrays(
    doses=[0, 0.5, 1, 2, 4, 7, 9],
    red_pixels=red_means,
    green_pixels=green_means,
    blue_pixels=blue_means,
)

# Convert to dose
solver = MickeSolver()
dose_map = solver.solve(film, cal.result)
print(f"Max dose: {dose_map.dose.max():.2f} Gy")

Gamma Analysis

from chromadose.analysis import gamma_2d

result = gamma_2d(
    reference=tps_dose,
    evaluated=dose_map.dose,
    dose_criteria=3.0,        # 3%
    distance_criteria_mm=3.0, # 3mm
)
print(f"Pass rate: {result.pass_rate * 100:.1f}%")

PDF Reports

from chromadose.io import generate_report

generate_report(
    "qa_report.pdf",
    dose_map,
    gamma_result=result,
    title="IMRT QA Report",
    patient_id="PATIENT001",
)

CLI

chromadose calibrate --films cal*.tif --doses 0 0.5 1 2 4 7 9 -o cal.json
chromadose solve --film treatment.tif --cal cal.json --method micke -o dose.npy
chromadose gamma --measured dose.npy --reference tps.npy --criteria 3/3
chromadose report --measured dose.npy --reference tps.npy -o report.pdf

Installation

pip install chromadose

Optional extras:

pip install chromadose[dicom]    # DICOM RT Dose import
pip install chromadose[ann-gpu]  # PyTorch GPU acceleration for ANN
pip install chromadose[dev]      # Development tools

Features

  • 4 dosimetry methods with a unified API
  • Uncertainty estimation built into every method
  • 2D gamma analysis (Low 1998) with global/local dose criteria
  • Dose profiles — row, column, or arbitrary line extraction
  • Film-to-TPS registration — automatic or manual rigid alignment
  • DICOM RT Dose import with resampling to film grid
  • PDF QA reports — dose maps, gamma, profiles in one document
  • CLI — full pipeline from command line
  • 6-channel Multigaussian — uses pre-irradiation scans for improved accuracy
  • Fully vectorized — no per-pixel Python loops
  • Pure Python — numpy + scipy only (torch optional for GPU)

Performance

Method 550x500 image Notes
Mayer 0.04s Analytical — fastest
Micke 0.14s Newton refinement
Multigaussian 4.7s Dense grid + parabolic interpolation
ANN ~1s Depends on ensemble size

Requirements

  • Python >= 3.11
  • numpy >= 1.24
  • scipy >= 1.10
  • tifffile >= 2023.1
  • matplotlib >= 3.7

References

  1. Micke A, Lewis DF, Yu X. "Multichannel film dosimetry with nonuniformity correction." Med. Phys. 2011;38(5):2523-34.
  2. Mayer RR, et al. "An improved dose response function for multichannel film dosimetry." Med. Phys. 2012;39(12):7596-602.
  3. Mendez I, Polsak A, Hudej R, Casar B. "The Multigaussian method: a new approach to mitigating spatial heterogeneities with multichannel radiochromic film dosimetry." Phys. Med. Biol. 2018;63(17):175013.
  4. Chang L-Y, et al. "GANN: a generalized artificial neural network for multichannel radiochromic film dosimetry." Phys. Med. Biol. 2025.
  5. Low DA, et al. "A technique for the quantitative evaluation of dose distributions." Med. Phys. 1998;25(5):656-61.

License

MIT

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

chromadose-0.9.0.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

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

chromadose-0.9.0-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file chromadose-0.9.0.tar.gz.

File metadata

  • Download URL: chromadose-0.9.0.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chromadose-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0c4d19c8c27b896529f1f6b11115bca9a5e3ddddf0a886a33e02d832d2de799a
MD5 61c322b39530f4fc67fcdf67ab22a802
BLAKE2b-256 3007f6d84ffabd94262054d2186aa397cc451fd762b2e36f6cf54b3a93982254

See more details on using hashes here.

File details

Details for the file chromadose-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: chromadose-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chromadose-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 262ac7bb01aae2f8ac715325412472e04756257fd4ae3e8f6697fbc18cee4bd5
MD5 7f0e08371244b74538f32a42500faec5
BLAKE2b-256 c193b0ca054e180726192f70a4b0fb0a154bfcdc768da15c5afab927b73bb887

See more details on using hashes here.

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