Python script to automate the plotting and analysis of percentage depth dose and dose profile simulations in TOPAS.

Overview

topas-create-graphs

A script to automatically plot the results of a topas simulation

Works for percentage depth dose (pdd) and dose profiles (dp). Depth dose measurements are assumed to
be in the z-direction, dose profiles in the x- or y-directions.

Automatically calculates relevant parameters

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 (Definitionby 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

Includes an optional GUI

The script is intended as a command line tool, where the first argument is the path to the file, and the second is the number of histories. However, the GUI can also be used. It comes with basic file selection and preview of the graph, as well as the option to save the graph.

Assumes a ".csv" input file format from a TOPAS Scorer with the following header format:

# TOPAS Version: {...}
# Parameter File: {...}.txt
# Results for scorer {...}
# Scored in component: {...}
# X in {...} bin of {...} cm
# Y in 1 {...} of {...} cm
# Z in {...} bins of {...} cm
# DoseToMedium ( Gy ) : {Sum/Mean} Standard_Deviation
Voxel Coordinate X, Voxel Coordinate Y, Voxel Coordinate Z, {Sum/Mean} Value, Standard_Deviation Value
.
.
.

Dependencies

Uses the beautiful Azure-ttk dark theme by @rdbende. Requires Python3 and Numpy, Scipy, Matplotlib, Pillow and cv2.

You might also like...
A set of functions and analysis classes for solvation structure analysis

SolvationAnalysis The macroscopic behavior of a liquid is determined by its microscopic structure. For ionic systems, like batteries and many enzymes,

 🧪 Panel-Chemistry - exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.
🧪 Panel-Chemistry - exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.

🧪📈 🐍. The purpose of the panel-chemistry project is to make it really easy for you to do DATA ANALYSIS and build powerful DATA AND VIZ APPLICATIONS within the domain of Chemistry using using Python and HoloViz Panel.

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging

Larch: Data Analysis Tools for X-ray Spectroscopy and More Documentation: http://xraypy.github.io/xraylarch Code: http://github.com/xraypy/xraylarch L

Sensitivity Analysis Library in Python (Numpy). Contains Sobol, Morris, Fractional Factorial and FAST methods.

Sensitivity Analysis Library (SALib) Python implementations of commonly used sensitivity analysis methods. Useful in systems modeling to calculate the

 A data analysis using python and pandas to showcase trends in school performance.
A data analysis using python and pandas to showcase trends in school performance.

A data analysis using python and pandas to showcase trends in school performance. A data analysis to showcase trends in school performance using Panda

A collection of learning outcomes data analysis using Python and SQL, from DQLab.
A collection of learning outcomes data analysis using Python and SQL, from DQLab.

Data Analyst with PYTHON Data Analyst berperan dalam menghasilkan analisa data serta mempresentasikan insight untuk membantu proses pengambilan keputu

BioMASS - A Python Framework for Modeling and Analysis of Signaling Systems
BioMASS - A Python Framework for Modeling and Analysis of Signaling Systems

Mathematical modeling is a powerful method for the analysis of complex biological systems. Although there are many researches devoted on produ

Weather analysis with Python, SQLite, SQLAlchemy, and Flask
Weather analysis with Python, SQLite, SQLAlchemy, and Flask

Surf's Up Weather analysis with Python, SQLite, SQLAlchemy, and Flask Overview The purpose of this analysis was to examine weather trends (precipitati

Stock Analysis dashboard Using Streamlit and Python
Stock Analysis dashboard Using Streamlit and Python

StDashApp Stock Analysis Dashboard Using Streamlit and Python If you found the content useful and want to support my work, you can buy me a coffee! Th

Comments
  • Nice work! plus a few comments

    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
    opened by bwheelz36 6
  • Fix Y-Axis Label

    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"

    opened by jaschst 1
  • Add Gamma Index Calculation

    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)

    enhancement 
    opened by sebasj13 0
Releases(v21.1.2)
  • v21.1.2(Jun 23, 2022)

    What's Changed

    • Bug fix preventing simulations without a standard deviation from loading

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v21.1.1...v21.1.2

    Source code(tar.gz)
    Source code(zip)
  • v21.1.1(Jun 20, 2022)

    What's Changed

    • Saving now includes the parameter table

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v21.1.0...v21.1.1

    Source code(tar.gz)
    Source code(zip)
  • v21.1.0(Jun 20, 2022)

    What's Changed

    • Added option to add a title to the graph
    • Added option to rename the Y-axis
    • Minor bug fixes when importing custom measurements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v21.0.0...v21.1.0

    Source code(tar.gz)
    Source code(zip)
  • v21.0.0(Jun 13, 2022)

    What's Changed

    • Added the option to show the value of the plot on mouse hover under: Menu -> View -> Show value on hover
    • Major overhaul on the menu bar - it should be more responsive and intuitive to use!
    • Fixed a bug which prevented renaming of the X-axis
    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.1.1...v21.0.0

    Source code(tar.gz)
    Source code(zip)
  • v20.1.1(May 31, 2022)

    What's Changed

    • Minor bug fixes in the handling of RadCalc files

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.1.0...v20.1.1

    Source code(tar.gz)
    Source code(zip)
  • v20.1.0(May 12, 2022)

  • v20.0.6(Apr 8, 2022)

    What's Changed

    • Fix case sensitivity in PTW measurement import by @sebasj13 in https://github.com/sebasj13/TopasGraphSim/pull/82

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.0.4...v20.0.5

    Source code(tar.gz)
    Source code(zip)
  • v20.0.4(Mar 26, 2022)

    What's Changed

    • Prompt the select the type of measurment when importing custom formats

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.0.3...v20.0.4

    Source code(tar.gz)
    Source code(zip)
  • v20.0.3(Mar 25, 2022)

    What's Changed

    • Added extra check for the lower dose cutoff in gamma calculations

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.0.2...v20.0.3

    Source code(tar.gz)
    Source code(zip)
  • v20.0.2(Mar 24, 2022)

    What's Changed

    • Open file dialog now defualts to the most recently used directory instead of the install location

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v20.0.1...v20.0.2

    Source code(tar.gz)
    Source code(zip)
  • v20.0.1(Mar 24, 2022)

  • v20.0.0(Mar 16, 2022)

    What's Changed

    • Added gamma index calculation by @sebasj13 in https://github.com/sebasj13/TopasGraphSim/pull/80

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v19.1.1...v20.0.0

    Source code(tar.gz)
    Source code(zip)
  • v19.1.1(Feb 22, 2022)

    What's Changed

    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v19.1.0...v19.1.1

    Source code(tar.gz)
    Source code(zip)
  • v19.1.0(Feb 22, 2022)

    What's Changed

    • Quality of life updates to the zoom window
    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v19.0.3...v19.1.0

    Source code(tar.gz)
    Source code(zip)
  • v19.0.3(Feb 21, 2022)

    What's Changed

    • Big fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v19.0.2...v19.0.3

    Source code(tar.gz)
    Source code(zip)
  • v19.0.2(Feb 21, 2022)

    What's Changed

    • Added plateau normalization option, which averages the 10 central points
    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v19.0.0...v19.0.2

    Source code(tar.gz)
    Source code(zip)
  • v19.0.0(Feb 20, 2022)

    What's Changed

    • Fixed parameter calculation for custom measurement files
    • Added customization of the graph markers https://github.com/sebasj13/TopasGraphSim/pull/76
    • Added a citation https://github.com/sebasj13/TopasGraphSim/pull/78
    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.2.1...v19.0.0

    Source code(tar.gz)
    Source code(zip)
  • v18.2.1(Feb 19, 2022)

    What's Changed

    • Fixed a bug that prevented app startup when a recent file had been moved/deleted

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.2.0...v18.2.1

    Source code(tar.gz)
    Source code(zip)
  • v18.2.0(Feb 17, 2022)

    What's Changed

    • Added recent files functionality and improved the performance of the PTW Importer by @sebasj13 in https://github.com/sebasj13/TopasGraphSim/pull/73

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.1.2...v18.2.0

    Source code(tar.gz)
    Source code(zip)
  • v18.1.2(Feb 17, 2022)

    What's Changed

    • The Application now opens where it was last closed

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.1.1...v18.1.2

    Source code(tar.gz)
    Source code(zip)
  • v18.1.1(Feb 16, 2022)

  • v18.1.0(Feb 16, 2022)

    What's Changed

    • Major Performance improvements and stability updates when resizing the window or scrubbing though the data

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.0.2...v18.1.0

    Source code(tar.gz)
    Source code(zip)
  • v18.0.2(Feb 14, 2022)

    What's Changed

    • Removed half screen height restriction to allow for better tiling in Windows

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v18.0.0...v18.0.2

    Source code(tar.gz)
    Source code(zip)
  • v17.3.1(Feb 12, 2022)

  • v17.3.0(Feb 12, 2022)

    What's Changed

    • Added drag and drop support
    • Improved the y-axis labels

    Know issue:

    • When switching the language, existing graphs aren't placed correctly. A workaround is switching the theme, then switching back.

    Full Changelog: https://github.com/sebasj13/TopasGraphSim/compare/v17.2.9...v17.3.0

    Source code(tar.gz)
    Source code(zip)
  • v17.2.9(Feb 10, 2022)

    What's Changed

    • Overhaul to the placement of elements on screen
    • Bug fixes and performance improvements

    Full Changelog: https://github.com/sebasj13/topasgraphsim/compare/v17.2.8...v17.2.9

    Source code(tar.gz)
    Source code(zip)
  • v17.2.8(Feb 7, 2022)

    What's Changed

    • Important Bug fix - assignment of errorbars to data was flipped and is now fixed

    Full Changelog: https://github.com/sebasj13/topasgraphsim/compare/v17.2.7...v17.2.8

    Source code(tar.gz)
    Source code(zip)
  • v17.2.7(Feb 7, 2022)

  • v17.2.6(Feb 6, 2022)

  • v17.2.5(Feb 6, 2022)

    What's Changed

    • Fixed a bugged color when using dark mode

    Full Changelog: https://github.com/sebasj13/topasgraphsim/compare/v17.2.4...v17.2.5

    Source code(tar.gz)
    Source code(zip)
Owner
Sebastian Schäfer
Master Student of medical physics and Python enthusiast.
Sebastian Schäfer
Extract Thailand COVID-19 Cluster data from daily briefing pdf.

Thailand COVID-19 Cluster Data Extraction About Extract Clusters from Thailand Daily COVID-19 briefing PDF Download latest data Here. Data will be upd

Noppakorn Jiravaranun 5 Sep 27, 2021
Single machine, multiple cards training; mix-precision training; DALI data loader.

Template Script Category Description Category script comparison script train.py, loader.py for single-machine-multiple-cards training train_DP.py, tra

2 Jun 27, 2022
DefAP is a program developed to facilitate the exploration of a material's defect chemistry

DefAP is a program developed to facilitate the exploration of a material's defect chemistry. A large number of features are provided and rapid exploration is supported through the use of autoplotting

6 Oct 25, 2022
Powerful, efficient particle trajectory analysis in scientific Python.

freud Overview The freud Python library provides a simple, flexible, powerful set of tools for analyzing trajectories obtained from molecular dynamics

Glotzer Group 195 Dec 20, 2022
A forecasting system dedicated to smart city data

smart-city-predictions System prognostyczny dedykowany dla danych inteligentnych miast Praca inżynierska realizowana przez Michała Stawikowskiego and

Kevin Lai 1 Nov 08, 2021
BAyesian Model-Building Interface (Bambi) in Python.

Bambi BAyesian Model-Building Interface in Python Overview Bambi is a high-level Bayesian model-building interface written in Python. It's built on to

861 Dec 29, 2022
This is an analysis and prediction project for house prices in King County, USA based on certain features of the house

This is a project for analysis and estimation of House Prices in King County USA The .csv file contains the data of the house and the .ipynb file con

Amit Prakash 1 Jan 21, 2022
Pipeline and Dataset helpers for complex algorithm evaluation.

tpcp - Tiny Pipelines for Complex Problems A generic way to build object-oriented datasets and algorithm pipelines and tools to evaluate them pip inst

Machine Learning and Data Analytics Lab FAU 3 Dec 07, 2022
Working Time Statistics of working hours and working conditions by industry and company

Working Time Statistics of working hours and working conditions by industry and company

Feng Ruohang 88 Nov 04, 2022
Python package for processing UC module spectral data.

UC Module Python Package How To Install clone repo. cd UC-module pip install . How to Use uc.module.UC(measurment=str, dark=str, reference=str, heade

Nicolai Haaber Junge 1 Oct 20, 2021
Demonstrate the breadth and depth of your data science skills by earning all of the Databricks Data Scientist credentials

Data Scientist Learning Plan Demonstrate the breadth and depth of your data science skills by earning all of the Databricks Data Scientist credentials

Trung-Duy Nguyen 27 Nov 01, 2022
The repo for mlbtradetrees.com. Analyze any trade in baseball history!

The repo for mlbtradetrees.com. Analyze any trade in baseball history!

7 Nov 20, 2022
An easy-to-use feature store

A feature store is a data storage system for data science and machine-learning. It can store raw data and also transformed features, which can be fed straight into an ML model or training script.

ByteHub AI 48 Dec 09, 2022
LynxKite: a complete graph data science platform for very large graphs and other datasets.

LynxKite is a complete graph data science platform for very large graphs and other datasets. It seamlessly combines the benefits of a friendly graphical interface and a powerful Python API.

124 Dec 14, 2022
A simplified prototype for an as-built tracking database with API

Asbuilt_Trax A simplified prototype for an as-built tracking database with API The purpose of this project is to: Model a database that tracks constru

Ryan Pemberton 1 Jan 31, 2022
Feature Detection Based Template Matching

Feature Detection Based Template Matching The classification of the photos was made using the OpenCv template Matching method. Installation Use the pa

Muhammet Erem 2 Nov 18, 2021
Kennedy Institute of Rheumatology University of Oxford Project November 2019

TradingBot6M Kennedy Institute of Rheumatology University of Oxford Project November 2019 Run Change api.txt to binance api key: https://www.binance.c

Kannan SAR 2 Nov 16, 2021
Maximum Covariance Analysis in Python

xMCA | Maximum Covariance Analysis in Python The aim of this package is to provide a flexible tool for the climate science community to perform Maximu

Niclas Rieger 39 Jan 03, 2023
Utilize data analytics skills to solve real-world business problems using Humana’s big data

Humana-Mays-2021-HealthCare-Analytics-Case-Competition- The goal of the project is to utilize data analytics skills to solve real-world business probl

Yongxian (Caroline) Lun 1 Dec 27, 2021
PipeChain is a utility library for creating functional pipelines.

PipeChain Motivation PipeChain is a utility library for creating functional pipelines. Let's start with a motivating example. We have a list of Austra

Michael Milton 2 Aug 07, 2022