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
Intake is a lightweight package for finding, investigating, loading and disseminating data.

Intake: A general interface for loading data Intake is a lightweight set of tools for loading and sharing data in data science projects. Intake helps

Intake 851 Jan 01, 2023
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
BasstatPL is a package for performing different tabulations and calculations for descriptive statistics.

BasstatPL is a package for performing different tabulations and calculations for descriptive statistics. It provides: Frequency table constr

Angel Chavez 1 Oct 31, 2021
Data-sets from the survey and analysis

bachelor-thesis "Umfragewerte.xlsx" contains the orginal survey results. "umfrage_alle.csv" contains the survey results but one participant is cancele

1 Jan 26, 2022
CubingB is a timer/analyzer for speedsolving Rubik's cubes, with smart cube support

CubingB is a timer/analyzer for speedsolving Rubik's cubes (and related puzzles). It focuses on supporting "smart cubes" (i.e. bluetooth cubes) for recording the exact moves of a solve in real time.

Zach Wegner 5 Sep 18, 2022
Statistical Analysis 📈 focused on statistical analysis and exploration used on various data sets for personal and professional projects.

Statistical Analysis 📈 This repository focuses on statistical analysis and the exploration used on various data sets for personal and professional pr

Andy Pham 1 Sep 03, 2022
The official pytorch implementation of ViTAE: Vision Transformer Advanced by Exploring Intrinsic Inductive Bias

ViTAE: Vision Transformer Advanced by Exploring Intrinsic Inductive Bias Introduction | Updates | Usage | Results&Pretrained Models | Statement | Intr

104 Nov 27, 2022
Hatchet is a Python-based library that allows Pandas dataframes to be indexed by structured tree and graph data.

Hatchet Hatchet is a Python-based library that allows Pandas dataframes to be indexed by structured tree and graph data. It is intended for analyzing

Lawrence Livermore National Laboratory 14 Aug 19, 2022
Pipeline to convert a haploid assembly into diploid

HapDup (haplotype duplicator) is a pipeline to convert a haploid long read assembly into a dual diploid assembly. The reconstructed haplotypes

Mikhail Kolmogorov 50 Jan 05, 2023
MapReader: A computer vision pipeline for the semantic exploration of maps at scale

MapReader A computer vision pipeline for the semantic exploration of maps at scale MapReader is an end-to-end computer vision (CV) pipeline designed b

Living with Machines 25 Dec 26, 2022
International Space Station data with Python research 🌎

International Space Station data with Python research 🌎 Plotting ISS trajectory, calculating the velocity over the earth and more. Plotting trajector

Facundo Pedaccio 41 Jun 16, 2022
First and foremost, we want dbt documentation to retain a DRY principle. Every time we repeat ourselves, we waste our time. Second, we want to understand column level lineage and automate impact analysis.

dbt-osmosis First and foremost, we want dbt documentation to retain a DRY principle. Every time we repeat ourselves, we waste our time. Second, we wan

Alexander Butler 150 Jan 06, 2023
small package with utility functions for analyzing (fly) calcium imaging data

fly2p Tools for analyzing two-photon (2p) imaging data collected with Vidrio Scanimage software and micromanger. Loading scanimage data relies on scan

Hannah Haberkern 3 Dec 14, 2022
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

Art Tucker 1 Sep 05, 2021
Mining the Stack Overflow Developer Survey

Mining the Stack Overflow Developer Survey A prototype data mining application to compare the accuracy of decision tree and random forest regression m

1 Nov 16, 2021
This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics!

COSMETICS GENERATOR This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics! Remember to put the l

ᴅᴊʟᴏʀ3xᴢᴏ 11 Dec 13, 2022
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

6 Oct 11, 2022
This is a python script to navigate and extract the FSD50K dataset

FSD50K navigator This is a script I use to navigate the sound dataset from FSK50K.

sweemeng 2 Nov 23, 2021
ForecastGA is a Python tool to forecast Google Analytics data using several popular time series models.

ForecastGA is a tool that combines a couple of popular libraries, Atspy and googleanalytics, with a few enhancements.

JR Oakes 36 Jan 03, 2023
Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

2 Nov 20, 2021