Skip to main content

Modern multichannel radiochromic film dosimetry

Project description

chromadose

PyPI Python CI License: MIT Docs Status

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.1.tar.gz (44.9 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.1-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chromadose-0.9.1.tar.gz
  • Upload date:
  • Size: 44.9 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.1.tar.gz
Algorithm Hash digest
SHA256 a17206ce326598cd64803a74f5e54a12723278f1ce0c66d530a831c772dc3054
MD5 0c165d9ced645bc3f3d8fcd8e0c5d06a
BLAKE2b-256 60f1f8897eae1e0c1f65026cab444eae7d72d5e029e85d34f58e7c32eaa6dc92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chromadose-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 40.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df1c840d7d9a5b394ef942367b5af825b76da0c025b48ec061c691c45e33c68b
MD5 ebbe132321dece551cdc14b31f4ee7a4
BLAKE2b-256 286b4807e4236b14ad5ec358d8c64a63ce229934ee17be11c2d53e95128d5c9a

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