Updated Image class available in postdoc_tools repo. Set of tools to work with Gate outputs (MHD image class, RTPlan class, plot functions) and scripts to process and view such data.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ask_yn
auger
dump
geo
glob2
image
mac
plot
rtplan
tableio
tle
.gitignore
LICENSE
README.md
analysis.falloff.py
analysis.fitprocedures.py
analysis.fop.pgsource.py
analysis.fop.spotid.py
analysis.layer.falloff.py
analysis.lyso.falloff.py
analysis.lyso2.falloff.py
analysis.pg.dist.py
analysis.pgevo.spot.py
analysis.pgevo.waterbox.py
analysis.pgevo3.waterbox.py
analysis.poisontest.py
analysis.rootfop.py
analysis.spot.falloff.py
analysis.spot.prims.py
analysis.spot.summing.py
analysis.spotRMSE.py
analysis.spotfinder.py
analysis.tle.headneck.jm.py
analysis.tle.headneck.py
analysis.tle.headneck.voxels.py
analysis.tle.parodi.boxes.py
analysis.tle.parodi.conv.py
analysis.tle.parodi.jm.py
analysis.tle.parodi.jm.steplim.py
analysis.tle.parodi.jm.steplim2.py
analysis.tle.parodi.py
analysis.yielddist.py
analysis2.dose.pg.py
box.plot.py
box.prep.py
count.image.py
count.root.py
epid.image.plot.py
epid.phasespace.electronspect.py
epid.phasespace.photonfluence.py
epid.phasespace.plot.py
epid.phasespace.unc.py
epid.unc.py
gate.field.py
gate.param.py
geo.py
graph.basics.py
graph.debug.py
graph.depthdose.py
graph.ekine.py
graph.fopproc.py
graph.layerresults.py
graph.layprofiles.py
graph.layprofiles.results.py
graph.lossofevents.py
graph.lossofpgs.py
graph.lyso.profiles.py
graph.notetrackindep.py
graph.spotprofiles.py
graph.spotprofiles.results.py
graph.spotresults.py
graph.tracking.physics.py
image.4d.fake2real.py
image.90pc.py
image.applymask.py
image.clip.py
image.crop.py
image.crush.2dfront.py
image.crush.2dside.py
image.crush.2dtop.py
image.crush.2dzekine.py
image.crush.3d.py
image.crush.ekine.py
image.crush.maxindex.py
image.crush.x.py
image.crush.z.py
image.diff.py
image.dump.pixel.py
image.dump.py
image.highpass.py
image.homogeneity.py
image.insertblock.z.py
image.lowpass.py
image.mask_atthreshold.py
image.meaninmask.py
image.normalize.py
image.reldiff.py
image.savewithmask.py
image.scale.py
image.to4d.py
image.togammamask.py
image.towater.py
log.findbrent.py
log.finderr.py
mac.flatten.py
mac2mask.py
mac2vox.py
maskfileto4d.py
pgdb.info.py
pgdb.merge.py
phasespace.dump.coord.py
phasespace.dump.ekine.py
plot.1d.error.py
plot.1d.norm.py
plot.1d.pluserror.py
plot.1d.py
plot.1d.rel.py
plot.1d.relerror.py
relunc.frombatch.py
rootfiles.merge.perrun.py
rootfiles.merge.py
rtplan.geoplot.py
rtplan.plot.py
rtplan.relayer.py
rtplan.relayer2.py
yield.image.py
yield.root.py
yield.txt.py

README.md

Pythonlibs for Particle Therapy Analysis

A collection of libraries useful for analyses in particle therapy research. Generally Matplotlib, Numpy, ROOT, clitktools and rtk are used as a dependency, as most monte carlo simulated particle treatments are produced with Geant4/Gate which output .root files.

File organisation

Files in the root are executable scripts, subdirectories are libraries and could be copied into your own projects or your $PYTHONPATH.

Why is this project not neatly separated and split over multiple task-specific repos? Because I am lazy, that's why. And also because just one rsync command is required to update all my tools on the clusters I use.

Usage

Clone, and put the directory in your path (export <CLONE_DIR>:$PATH). You can get access to the libraries in any script by adding export PYTHONPATH=<CLONE_DIR>:$PYTHONPATH to your bashrc, or by putting this atop your scripts:

import sys
sys.path.append("<CLONE_DIR>")

Now, an incomplete list over the modules with a brief description:

RTPlan Parser

This lean 'n mean library parses radio therapy plan as outputted by CLITK (which in turn accepts any particle therapy plan in the Dicom format). At the moment, this library can be used to inform the user about the number of fields, the energy layers (or steps) per field, the fluence per energy step, and eventually some useful information on the spot level.

Its main use is to gain insight in the energy/fluence/time structure of the rtplan, and make is quickly comparable to the output of a monte carlo or measurements of the same quantities, so that the deviation from the plan may be qualified or quantified.

MHD or ITK Images

Provides a way to operate on images as outputted by Gate (and CLITK tools). Slicing, projections, mathematical operations, stuff like that.

Mac to voxels

Converts simple geometries in macrofiles to voxellized images.

Plot

A set of function that ease life with Matplotlib. The Texify-function make them look good, and the tle.py functions provides many ways to compare data (depends on image). An older and unused and unmaintained rootplot component is kept around for the braindead.

Dump

For the enlightened, dump.py gives some functionality to extract information out of .root-files in the fastest way possible. Depends on PyRoot.

Geometry

Alignment of the beams/fields with detectors, or projecting segmented data under an angle on a common axis.