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
Senator Trades Monitor

Senator Trades Monitor This monitor will grab the most recent trades by senators and send them as a webhook to discord. Installation To use the monito

Yousaf Cheema 5 Jun 11, 2022
MoRecon - A tool for reconstructing missing frames in motion capture data.

MoRecon - A tool for reconstructing missing frames in motion capture data.

Yuki Nishidate 38 Dec 03, 2022
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 07, 2023
Synthetic Data Generation for tabular, relational and time series data.

An Open Source Project from the Data to AI Lab, at MIT Website: https://sdv.dev Documentation: https://sdv.dev/SDV User Guides Developer Guides Github

The Synthetic Data Vault Project 1.2k Jan 07, 2023
This tool parses log data and allows to define analysis pipelines for anomaly detection.

logdata-anomaly-miner This tool parses log data and allows to define analysis pipelines for anomaly detection. It was designed to run the analysis wit

AECID 32 Nov 27, 2022
My first Python project is a simple Mad Libs program.

Python CLI Mad Libs Game My first Python project is a simple Mad Libs program. Mad Libs is a phrasal template word game created by Leonard Stern and R

Carson Johnson 1 Dec 10, 2021
Leverage Twitter API v2 to analyze tweet metrics such as impressions and profile clicks over time.

Tweetmetric Tweetmetric allows you to track various metrics on your most recent tweets, such as impressions, retweets and clicks on your profile. The

Mathis HAMMEL 29 Oct 18, 2022
A powerful data analysis package based on mathematical step functions. Strongly aligned with pandas.

The leading use-case for the staircase package is for the creation and analysis of step functions. Pretty exciting huh. But don't hit the close button

48 Dec 21, 2022
A computer algebra system written in pure Python

SymPy See the AUTHORS file for the list of authors. And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's part

SymPy 9.9k Dec 31, 2022
Python script for transferring data between three drives in two separate stages

Waterlock Waterlock is a Python script meant for incrementally transferring data between three folder locations in two separate stages. It performs ha

David Swanlund 13 Nov 10, 2021
yt is an open-source, permissively-licensed Python library for analyzing and visualizing volumetric data.

The yt Project yt is an open-source, permissively-licensed Python library for analyzing and visualizing volumetric data. yt supports structured, varia

The yt project 367 Dec 25, 2022
ETL pipeline on movie data using Python and postgreSQL

Movies-ETL ETL pipeline on movie data using Python and postgreSQL Overview This project consisted on a automated Extraction, Transformation and Load p

Juan Nicolas Serrano 0 Jul 07, 2021
This module is used to create Convolutional AutoEncoders for Variational Data Assimilation

VarDACAE This module is used to create Convolutional AutoEncoders for Variational Data Assimilation. A user can define, create and train an AE for Dat

Julian Mack 23 Dec 16, 2022
A data structure that extends pyspark.sql.DataFrame with metadata information.

MetaFrame A data structure that extends pyspark.sql.DataFrame with metadata info

Invent Analytics 8 Feb 15, 2022
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
Data Analytics on Genomes and Genetics

Data Analytics performed on On genomes and Genetics dataset to predict genetic disorder and disorder subclass. DONE by TEAM SIGMA!

1 Jan 12, 2022
Flexible HDF5 saving/loading and other data science tools from the University of Chicago

deepdish Flexible HDF5 saving/loading and other data science tools from the University of Chicago. This repository also host a Deep Learning blog: htt

UChicago - Department of Computer Science 255 Dec 10, 2022
Validated, scalable, community developed variant calling, RNA-seq and small RNA analysis

Validated, scalable, community developed variant calling, RNA-seq and small RNA analysis. You write a high level configuration file specifying your in

Blue Collar Bioinformatics 917 Jan 03, 2023
Recommendations from Cramer: On the show Mad-Money (CNBC) Jim Cramer picks stocks which he recommends to buy. We will use this data to build a portfolio

Backtesting the "Cramer Effect" & Recommendations from Cramer Recommendations from Cramer: On the show Mad-Money (CNBC) Jim Cramer picks stocks which

Gábor Vecsei 12 Aug 30, 2022
Data collection, enhancement, and metrics calculation.

l3_data_collection Data collection, enhancement, and metrics calculation. Summary Repository containing code for QuantDAO's JDT data collection task.

Ruiwyn 3 Dec 23, 2022