Code Monkey home page Code Monkey logo

omg_dosimetry's Introduction

OMG Dosimetry

https://github.com/jfcabana/omg_dosimetry/blob/OMG_master/src/omg_dosimetry/OMG_Logo.png?raw=true

With OMG Dosimetry, you can easily perform film calibration, film-to-dose conversion, and dose analysis.

Demonstration files are provided for each module to get you started quickly. Code is heavily commented so you can follow along and adapt it for your personal usage.

Documentation

To get started, install the package, view the API docs, visit the Full Documentation on Read The Docs.

Gafchromic Calibration Module

The calibration module computes multichannel calibration curves from scanned films.

Scanned films are automatically detected and selected, or ROIs can be drawn manually.

The lateral scanner response effect (inhomogeneous response of the scanner along the detector array) can be accounted for by creating separate calibration curves for each pixel along the array. This requires exposing long film strips and scanning them perpendicular to the scan direction (see demonstration files). To account for non-flat beam profiles, a text file containing the relative beam profile shape along the film strips can be given as input to correct for non-uniform dose on the film. Alternatively, the lateral scanner response correction can be turned off in which a single calibration curve is computed for all pixels. This simpler calibration is adequate if scanning only small films at a reproducible location on the scanner.

Features

  • Automatically loads multiple images in a folder, averages multiple copies of the same image and stacks different scans together.
  • Automatically detects film position and size, and defines ROIs inside these films.
  • Daily output correction
  • Beam profile correction
  • Lateral scanner response correction
  • Save/Load LUT files
  • Publish PDF report

Film-to-Dose Module

The film-to-dose module performs optimized multichannel conversion from scanned gafchromic films to absolute dose. It uses the optimized multichannel method from Mayer et al (https://doi.org/10.1118/1.3694100) and calibration curves obtained with the calibration module.

Features

  • Multiple scans of same film are loaded and averaged automatically
  • Automatic film detection and crop
  • Multichannel optimized conversion to absolute dose (reduced film inhomogeneities/artefacts)
  • Lateral scanner response is accounted for if this feature was turned on during calibration
  • Calibration curve interpolation performed by fitting either a rational function or spline curve
  • Output individual channels dose (R/G/B), as well as optimized dose, mean channel dose and average dose
  • Output metrics for evaluation of dose conversion quality: disturbance map, residual error, consistency map
  • Publish PDF report

Dose Analysis Module

The dose analysis module performs in-depth comparison from film dose to reference dose image from treatment planning system.

Features

  • Perform registration by identifying fiducial markers to set isocenter
  • Interactive display of analysis results (gamma map, relative error, dose profiles)
  • Gamma analysis: display gamma map, pass rate, histogram, pass rate vs dose bar graph, pass rate vs distance to agreement (fixed dose to agreement), pass rate vs dose to agreement (fixed distance to agreement)
  • Publish PDF report

omg_dosimetry's People

Contributors

jfcabana avatar luisolivaresj avatar petruong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

omg_dosimetry's Issues

ReadTheDocs documentation update needed

Hi Jean,

The documentation you wrote in request #12 for each module, is not show in Rad The Docs. That is because Read the Docs uses the docstring from the package stored in PyPi (the latest omg version on PyPi is 1.4.1). You need to update omg_dosimetry on PyPi to see the added new changes.

8-bit precision

Hi Jean,

If it is possible, could you share what is your experience working with 8-bit pixel resolution?
OMG uses Pillow to load tiff files. As can be seen in Pillows documentation, 16-bit multichannel TIFF data is truncated to 8-bit precision (0-256 integer values). Therefore the range of pixel values and the resolution are reduced.

As an example, working with a dose range of 0 - 10 Gy, and 100 useful bins (see the histogram below), the resolution is about 10 Gy / 100 = 0.1 Gy (or 1 %). Additionally, overall dose uncertainty is also affected.

histogram

Do you think that this is a real issue so we need to use other module to load tif files? for example I use tifffile.

Python version <3.11 requirement

Requirements indicates python <3.11, >=3.7. Latest Anaconda distribution base environnement version is 3.11.

I can't recall why the <3.11 requirement was added. Does it still hold?

Error with pymedphys 0.40

I'm trying to install OMG Dosimetry on new computers at work, and I get an error message in the analysis module when trying to compute gamma. The error is with pymedphys trying to find the file EXTRA-DEPENDENCIES,.txt but not finding it.

The error is resolved after I install version 0.39.3.

Installation issue

Describe the bug
ERROR: Cannot install omg-dosimetry==1.4.1 because this package versions have conflicting dependencies.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new conda environment conda create --name omg_d
  2. Install pip conda install pip
  3. Install omg-dosimetry pip install omg-dosimetry
  4. See error

Screenshots
first desktop computer python 3__11_3

Additional information
I am using

  • conda 22.11.0
  • pip 23.1.2
  • python 3.11.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.