GUI to analyze the results of a Monte-Carlo radiation simulation
Project description
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"
Note: Linux users need to have python3-tk installed. If it isnt installed yet, use:
$ sudo apt-get install python3-tk
Also, you may need python-dev. Install if for your python version using:
$ sudo apt-get install python<your main version>-dev
Since all my testing in done on Windows 11, I cannot guarantee this will work on any other plattform. I'm open to suggestions or PRs making the software work better cross-plattfrom!
Features
- 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 EGS and RadCalc simulation results *
- Import of custom measurements (as numpy .txt files) *
- Import of PTW tbaScan (MEPHYSTO mc2) measurements
- German and english language support
- Dark mode
(*) Not yet implemented
Screenshots
Manual
To begin, either create a new tab (View -> Tabs -> New tab) ot press Ctrl+N. Alternatively, you can directly open a TOPAS .csv file or a .mcc measurement by going to File -> Open ..., or by simply dragging the respective file onto the GUI. Under the Data tab, you can then add more files, and set general visualization settings, such as whether to normalize all graphs, which grid to show, and whether to include a legend.
After opening a file, its relevant parameters are automatically calculated and displayed unter the Parameters tab.
Under the Analysis tab, you can scale the graph, as well as offset it along both axes. If you have more than one graph loaded, you can compare the two using the desired gamma criteria.
Unter the Settings tab, you find a variety of customization options. You can rename plots, change their display color, adjust the drawn line and its thickness. Additionally, you can customize the plot and axes titles, as well as displaying or hiding the individual points and error bars, if applicable.
All settings can be customized in general by going to File -> Default settings.
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file topasgraphsim-23.0.2.tar.gz
.
File metadata
- Download URL: topasgraphsim-23.0.2.tar.gz
- Upload date:
- Size: 86.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96543445fc0737946fe1845753c8c2e8f8797c98ad44fe947d7ceb1827d1cc9b |
|
MD5 | 7410c3db0aa6912dddfd4c7c1626f698 |
|
BLAKE2b-256 | de244721b6b5d757c19360d2d4d4d16053a7c4ff48548561d90b56133de950f4 |
File details
Details for the file topasgraphsim-23.0.2-py3-none-any.whl
.
File metadata
- Download URL: topasgraphsim-23.0.2-py3-none-any.whl
- Upload date:
- Size: 96.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1cd22a46f70f77a30b542c7e1bcc469a6f95efbe6476f8c501cc82c56307e51 |
|
MD5 | 3ac86774206e61e886792deafadab4fe |
|
BLAKE2b-256 | aa026b46e28722d9617868bfbc0eedb9dfca83a770a91fd1a053c8140d7b6241 |