GithubHelp home page GithubHelp logo

archon88 / brachytime Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 3 MB

Tool to compute the time required to deliver a prescribed dose with an interstitial implant comprising equilateral triangles

License: GNU General Public License v3.0

Python 14.84% Jupyter Notebook 85.16%

brachytime's Introduction

brachytime

A simple Python utility to compute the treatment time (in hours) for an interstitial applicator with wires forming the vertices of equilateral triangles in its midplane, following the Paris system.

A suitable applicator geometry is as shown below, with wire lengths (vertices of the equilateral triangles, denoted by black dots) in millimetres. The basal dose points are denoted by grey dots. OLS quadratic fits were performed to log10(doserate) against log10(distance) to establish a functional relationship between these quantities for wires of length 50 mm, 60 mm, and 70 mm using the data in AKR.pdf; linear interpolation is performed for wires of intermediate length using the interpdose function. It is assumed that these functional relationships hold for isotopes other than Ir-192. The WebPlotDigitizer tool was used to convert the data in AKR.pdf to the quadratics in the calcdoserate function. The change in source activity over the course of treatment is neglected.

usage

The treatment time may be computed using expressions such as

>>> brachytime.calculate_treatment_time(separation=18, upper_lengths=[50, 55, 55], lower_lengths=[70]*4, delivery_akr=0.494, delivery_datetime='2000-11-17T12:00', mid_treatment_datetime='2000-11-22T18:40', halflife=6379000, prescribed_dose=20, printout=True)

where the separation (the side of the triangle) and the lengths of the wires in the upper and lower planes are expressed in millimetres, the source air kerma rate at time of delivery is expressed in micrograys per hour per millimetre metre squared, the souce isotope half-life is expressed in seconds, and the prescribed dose is expressed in grays. The source delivery time and the mid-implant time must be passed as strings formatted according to ISO 8601, i.e. YYYY-MM-DDTHH:MM. Without loss of generality, it is assumed that the lower row of wires has at least as many wires as the upper row, and that the leftmost wire is in the lower row (since this is taken to be the origin of the coordinate system, for convenience). All wire lengths must be in the range 50 mm to 70 mm.

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.