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
Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Codes for the collection and predictive processing of bitcoin from the API of coinmarketcap

Teo Calvo 5 Apr 26, 2022
Cold Brew: Distilling Graph Node Representations with Incomplete or Missing Neighborhoods

Cold Brew: Distilling Graph Node Representations with Incomplete or Missing Neighborhoods Introduction Graph Neural Networks (GNNs) have demonstrated

37 Dec 15, 2022
PandaPy has the speed of NumPy and the usability of Pandas 10x to 50x faster (by @firmai)

PandaPy "I came across PandaPy last week and have already used it in my current project. It is a fascinating Python library with a lot of potential to

Derek Snow 527 Jan 02, 2023
Top 50 best selling books on amazon

It's a dashboard that shows the detailed information about each book in the top 50 best selling books on amazon over the last ten years

Nahla Tarek 1 Nov 18, 2021
For making Tagtog annotation into csv dataset

tagtog_relation_extraction for making Tagtog annotation into csv dataset How to Use On Tagtog 1. Go to Project Downloads 2. Download all documents,

hyeong 4 Dec 28, 2021
Wafer Fault Detection - Wafer circleci with python

Wafer Fault Detection Problem Statement: Wafer (In electronics), also called a slice or substrate, is a thin slice of semiconductor, such as a crystal

Avnish Yadav 14 Nov 21, 2022
Template for a Dataflow Flex Template in Python

Dataflow Flex Template in Python This repository contains a template for a Dataflow Flex Template written in Python that can easily be used to build D

STOIX 5 Apr 28, 2022
GWpy is a collaboration-driven Python package providing tools for studying data from ground-based gravitational-wave detectors

GWpy is a collaboration-driven Python package providing tools for studying data from ground-based gravitational-wave detectors. GWpy provides a user-f

GWpy 342 Jan 07, 2023
A Big Data ETL project in PySpark on the historical NYC Taxi Rides data

Processing NYC Taxi Data using PySpark ETL pipeline Description This is an project to extract, transform, and load large amount of data from NYC Taxi

Unnikrishnan 2 Dec 12, 2021
Provide a market analysis (R)

market-study Provide a market analysis (R) - FRENCH Produisez une étude de marché Prérequis Pour effectuer ce projet, vous devrez maîtriser la manipul

1 Feb 13, 2022
MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

SeungHeonDoh 3 Jul 02, 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
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
Spaghetti: an open-source Python library for the analysis of network-based spatial data

pysal/spaghetti SPAtial GrapHs: nETworks, Topology, & Inference Spaghetti is an open-source Python library for the analysis of network-based spatial d

Python Spatial Analysis Library 203 Jan 03, 2023
PyNHD is a part of HyRiver software stack that is designed to aid in watershed analysis through web services.

A part of HyRiver software stack that provides access to NHD+ V2 data through NLDI and WaterData web services

Taher Chegini 23 Dec 14, 2022
Pizza Orders Data Pipeline Usecase Solved by SQL, Sqoop, HDFS, Hive, Airflow.

PizzaOrders_DataPipeline There is a Tony who is owning a New Pizza shop. He knew that pizza alone was not going to help him get seed funding to expand

Melwin Varghese P 4 Jun 05, 2022
PyChemia, Python Framework for Materials Discovery and Design

PyChemia, Python Framework for Materials Discovery and Design PyChemia is an open-source Python Library for materials structural search. The purpose o

Materials Discovery Group 61 Oct 02, 2022
DenseClus is a Python module for clustering mixed type data using UMAP and HDBSCAN

DenseClus is a Python module for clustering mixed type data using UMAP and HDBSCAN. Allowing for both categorical and numerical data, DenseClus makes it possible to incorporate all features in cluste

Amazon Web Services - Labs 53 Dec 08, 2022
follow-analyzer helps GitHub users analyze their following and followers relationship

follow-analyzer follow-analyzer helps GitHub users analyze their following and followers relationship by providing a report in html format which conta

Yin-Chiuan Chen 2 May 02, 2022
Python for Data Analysis, 2nd Edition

Python for Data Analysis, 2nd Edition Materials and IPython notebooks for "Python for Data Analysis" by Wes McKinney, published by O'Reilly Media Buy

Wes McKinney 18.6k Jan 08, 2023