Coder Social home page Coder Social logo

sebasj13 / topasgraphsim Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 2.0 1.31 MB

A GUI to simplify and streamline the plotting and analysis of medical physics simulations

Home Page: https://pypi.org/project/topasgraphsim

License: MIT License

Python 100.00%
python monte-carlo-simulation topas topasmc tkinter-gui

topasgraphsim's Introduction

TopasGraphSim

A GUI to simplify and streamline the plotting and analysis of medical physics simulations

This GUI can visualize and analyze percentage depth dose (pdd) and dose profiles (dp) simulations from TOPAS. Depth dose measurements are assumed to be in the z-direction, dose profiles in the x- or y-directions. Data read-in is handled by topas2numpy.

Installation

Install using pip:

$ pip install topasgraphsim     

Then, start the GUI by running:

$ python -m topasgraphsim

Or, if your Python is added to $PATH, simply run:

$ topasgraphsim

Open compatible files from the command line:

$ topasgraphsim "path_to_your_file"

Since all my testing in done on Windows 11, I cannot guarantee ToapsGrapSim will work on any other plattform. I'm open to suggestions or PRs making the software work better cross-plattfrom!

Features

Visit the wiki for detailed information!

Highlights include:

  • Reproducible graphing and analysis of 1D TOPAS simulation for medical physics
  • Simultaneous plotting and parameter calculation for all data sets
  • Calculation of the Gamma Index with adjustable parameters
  • Graph adjustment options
    • Normalization (On/Off)
    • Error bars (On/Off)
    • Graph order and colors
    • Marker size and style
    • Line width
  • Drag and drop of files
  • Center axis deviation correction
  • Import of RadCalc OAR and PDD data, RayStation and Eclipse depth doses and dose profiles, and Slicer line profiles
  • Import of custom measurements (as numpy .txt files)
  • Import of PTW tbaScan (MEPHYSTO mc2) measurements
  • German and english language support
  • Dark mode

Screenshots

main

tab

Parameters

Depending on the imported measurement, the following parameters can be calculated:

Measurement type Parameters
Depth dose Q-Factor zmax
Dose profile FWHM CAXdev FLATKrieger FLATstddev Penumbra (L&R) Integral (L&R)
  • Q-Factor : Radiation Quality Factor

  • zmax : Depth at Maximum

  • FWHM : Full-Width at Half-Maximum

  • CAXdev : Centre Axis Deviation

  • FLATKrieger : Flatness of Dose Plateau (Definition by Krieger)

  • FLATstddev : Flatness of Dose Plateau (Standard Deviation)

  • Penumbra (L&R) : Width of Left and Right Penumbra

  • Integral (L&R) : Integral below Left and Right Penumbra

Dependencies

The UI is based on the customtkinter library.

Requires python3, numpy, scipy, matplotlib, Pillow, python-opencv, pynput, requests, topas2numpy, and python-tkdnd.

Contact me!

Thank you for using TopasGraphSim! Please let me know about any issues you encounter, or suggestions/wishes you might have!

Downloads

topasgraphsim's People

Contributors

sebasj13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

topasgraphsim's Issues

Add Gamma Index Calculation

import pymedphys

gamma = pymedphys.gamma(
(data[0][0],), data[0][1], (data[1][0],), data[1][1], 1, 1
)

valid_gamma = gamma[~np.isnan(gamma)]
pass_ratio = np.sum(valid_gamma <= 1) / len(valid_gamma)
print(pass_ratio)

Line style

Add option to change line style (solid, dashed, dotted, dashdot).

Fix Y-Axis Label

3ddose dataset shows y-axis label "mm" if not normalized. --> "Dose [Gy/history]"
Maybe add optionial or permanent label for relative dose distributions e.g. "Relative Dosis"

Nice work! plus a few comments

Firstly, this is really nice! i have been vaguely contemplating if I should do something like this given the number of how 'how do I plot...' questions on the forums. Nice to see.
The following are some comments/questions/suggestions. Feel free to ignore any that aren't helpful!

comments

  • I would move the install instructions closer to the top of the read me, because whenever I look at software on github the first thing I want to do is make sure I can install it before I start read the detailed instructions.

questions

  • what scoring geometries does this handle? or will it handle anything? e.g. I think depending on the scoring component, the coordinates might be polar or cartesian (right?), will this handle both?
  • Is it possible to run this 'headless' (no GUI?) and if not would it be difficult to add this? In many situations it would be nice to be able to script analysis...also for debugging this would be handy.

install experience

  • In ubuntu, I had to do sudo apt install python3.9-dev before this package would install. It was some issue with a package called evdev
  • In windows worked perfectly.

use experience

  • in linux the default window is very large - I can make it larger, but I can't make it smaller. weird!
  • I tried to load some .bin files from a TsBox scorer; in windows and linux I got the error "AttributeError: 'Simulation' object has no attribute 'direction'"
  • In general it looks like there are a few if, elif statements where it would be a good idea to put a final else: raise NotImplementedError

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.