Roy and Niels

Roy and Niels
Showing posts with label stopping power. Show all posts
Showing posts with label stopping power. Show all posts

Thursday, March 6, 2014

A Stopping Power App for Android



We (as in APTG) have just released the dE/dx Android app on Google Play!

Screnshot of the dE/dx app, ver. 1.0 from my LG Nexus 4 phone.

The app is written by student Casper Cristensen in collaboration with the Dept. of Physics and Astronomy and the School of Engineering at Aarhus University. The app is based on the stopping power library libdEdx-1.2.1  which was presented in an earlier blog entry here.

The cool thing about the app is that all tables are stored locally on phone (this is why it needs access to USB memory), so no network access is necessary - useful if you want to look up stopping power while working in a shielded area with no network.

In summary the features are:
  • ICRU 49 and ICRU 73 (revised version) electronic stopping power tables
  • MSTAR tables provided by Helmut Paul
  • BETHE_EXT00, a generic algorithm as used in SHIELD-HIT12A. Applicable for any ion to all 278 ICRU compounds (beware, use with care, can be off at lower energies), .
  • no network access needed after installation
  • calculation of CSDA range of particle in target material
  • inverse CSDA lookups possible (if you need to figure out what specific energy is needed to produce a certain range in a material.

Disclaimer: of course we do not claim correct reproduction of any of the data, use at own responsibility!

Thanks to:

  • Casper Christensen (programming this app)
  • Jesper Rosholm Tørresø (being Casper's supervisor and our contact person to the engineering school)
  • Jakob Toftegaard (writing most of the libdEdx backend and dedx.au.dk webpage)


Enjoy! :-)

Wednesday, November 21, 2012

SHIELD-HIT12A demo version released

Here is a little sneak-preview of the upcoming release of SHIELD-HIT12A.

Pimp my Niva... (artist's impression of SHIELD-HIT12A).

SHIELD-HIT12A is a Monte Carlo particle transport code capable of transporting heavy ions through arbitrary media. The -A fork was made in 2010 from SHIELD-HIT08, and since then we have added plenty of new features, solved many bugs, increased calculation speed and optimized the nuclear models to new data on carbon-12 fragmentation.

A free demo version where the random seed and statistics are fixed to 10.000 particles can be downloaded from the project development page. There are builds for Linux and Windows systems (32- and 64 bit). It is a beta-release, but we would like to bring this demo version to a broader community, and thereby hopefully also fix some more bugs before we release the full version.

The new features in SHIELD-HIT12A are:
  • New simplified material and beam parameter parser in free format and extensible without breaking downward compability.
  • Including 279 ICRU default materials and elements, it has never been so easy to specify a material.
  • New beam model: divergence and focus distance can now be specified (thanks to Uli Weber from Marburg).
  • Arbitrary starting beam directions now possible.
  • New routine for Vavilov straggling, 5-6 times faster than the original one by Rotondi and Montagna which was used in Geant3.21. In total, this alone means a speed improvement of roughly 30-40%.
  • Ripple filter has two modes of operation, Monte Carlo type or Modulus type.
  • Logarithmic energy binning in SPC files for TRiP
  • Full howto for generating DDD files for TRiP
  • Now only three input files are needed to setup a run.
  • Improved documentation.
  • Scoring by zones using detect.dat (complementary to Cartesian mesh and cylindrical scoring)
  • Alanine response model included, so SHIELD-HIT12A can directly calculate the dose equivalent response in alanine.
  • Flat circular and square beams can be defined
  • Neutron data for natural Argon was added (needed for detailed simulations of air)
  • Another ton of bug fixes.
Of course SHIELD-HIT12A includes the features from SHIELD-HIT10A (which was never released):
  • Totally new (parallelizable) scoring system:
    • Arbitrary Mesh and Cylindrical scoring
    • Lots of detectors such as energy, fluence, dose-averaged LET, track-averaged LET, average velocity (beta), dose to medium (where medium can be changed if you want to calculate stopping power ratios) etc....
  • finally SHIELD-HIT10A is parallelizable
  • New random number generator, which gives a massive performance boost
  • New adjusted inelastic cross sections for carbon ions based on recent data
  • Fine tuning of the fermi-breakup parameters
  • SHIELD-HIT10A can be configured without accessing the source code anymore, so no programming knowledge required to use SHIELD-HIT10A.
  • SHIELD-HIT10A is installable
  • Runs on linux again, even when compiling with code optimizations, ok with GNU gfortran, Intel and Portland compilers.
  • Many bug fixes
Enjoy! And please drop me a line when you find bugs in the software and errors in the manual, they are there, but we hid them well. :o)


----

Thursday, June 21, 2012

libdEdx 1.2.0 released - stopping powers for the masses!


Our master's student Jakob Toftegaard has been very busy lately, and we're now ready to release a new version of the open-source stopping power library libdEdx - version 1.2.0.

Changes to the last version 1.0 are
  • first of all: a new, nice and clean API. This breaks compatibility with 1.0, but we will do our best to avoid this happening again in the future. (We now have extensive use of structs, which can be extended with new members.)
  • generic ICRU table included, which combines ICRU49 and the revised ICRU73.
  • all four calculation modes in MSTAR are now supported, the default is that recommended by Helmut Paul.
  • aggregate state can be specified, following ICRU recommendations
  • I-values can be overridden for analytical functions (BETHE_EXT)
  • provides a bunch of new functions
    • calculate CSDA range
    • inverse range lookup - a given range will return required particle energy in CSDA approximation. (Yes, this is the feature you have been waiting for all your life!)
    • inverse dEdx lookup - a given stopping power will yield an energy (either high or low value, depending on what the user requested)
  • version string of libdEdx can be accessed
  • memory leak fixes
  • typo fixes in material lists
  • code should now be thread-safe
And were just getting started!

A real gem is our new web based frontend at http://dedx.au.dk to libdEdx. Here you can lookup stopping power functions using various tables and energies, use it as a supplement to those from NIST. The website includes a nice plotting feature as well, where you can add multiple plots for comparison.

The web frontend is still in beta-testing phase and may reside in this state for a long time. Any feedback is appreciated.

We have a lot of plans regarding how to continue with this. In the next version of libdEdx we plan to include more features such as
  • more Bethe-based stopping power functions such as
  • Bethe-Bloch
  • Bethe-Bloch-Barkas
We also would like to include additional stopping power programs such as ESTAR, ATIMA and SRIM (just the stopping power part, of course), yet the outcome will depend on the willingness of the respective authors to contribute.
  • algorithms for nuclear stopping power
  • … and a surprise which we won’t reveal yet … :-)
Other contributors will be most welcome, the project is available on sourceforge for inspection.

We greatly acknowledge our hero Helmut Paul for contributing to the development with very fruitful discussions and suggestions. We also acknowledge the permission from the ICRU to use their stopping power tables in libdEdx.

Yet, we do not claim that the produced results are correct in any way, so any use of the data are on own risk. Nonetheless, if you DO find discrepancies, errors, misbehaviour of code, we would really appreciate if you tell us.

Enjoy!

Wednesday, January 5, 2011

libdEdx version 1.0 released

Version 1.0 of libdEdx is now available at sourceforge.net

List of features:
  • ICRU 49 date tables for protons and Helium ions (PSTAR, ASTAR)
  • MSTAR for heavy ions
  • ICRU 73 with and without the erratum for water target
  • A Bethe implementation for any ion, including Linhard-Sørensen equation for low energies
  • Support for 278 ICRU target materials, i.e. the complete ESTAR material table, all with default I-values for the Bethe equation
  • I-values can be overridden for elements
  • Automatic application of Bragg's additivity rule, if requested target material does not exist in default table for e.g. MSTAR.
  • Detailed documentation, and multiple example files
  • CMAKE based installer, with uninstall target.
  • getdedx as a frontend command line program for querying the library
  • Two modes of operation: simple for lazy programmers and fast for e.g. MC codes.
  • GPL license (non-GPL versions available upon request)



How to use libdEdx, simplest possible example.

Demonstration of command line program getdedx. 100 MeV protons using PSTAR on water:

Usage: getdedx program_id  Z icru_target_id energy.

bassler@kepler:~$ getdedx 2 1 276 100
100.000000 MeV/u HYDROGEN ions on WATER target using PSTAR
dEdx = 7.286E+00 MeV cm2/g

Carbon ions on alanine target, using ICRU 73:

bassler@kepler: getdedx 5 6 105 400
400.000000 MeV/u CARBON ions on ALANINE target using ICRU73
 Bragg's additivity rule was applied,
 since compound ALANINE is not in ICRU73 data table.
dEdx = 1.068E+02 MeV cm2/g

For reporting bugs and feature request, you can use our trac ticket system or drop us an email.

Monday, November 29, 2010

The Stopping Power of Frozen Water

In my last blog entry I commented on stopping powers of fast ions in medical physics, and announced the libdEdx library. (Stopping powers describe the energy loss of fast charged particles in material, thereby transferring energy to the target matter.) Stopping powers directly relate to the deposited dose, but there are plenty of more subtle effects where they may or may not have a profound influence:
  • Range of ions in matter. Often the mean excitation energy (not to be confused with the ionization potential or w value...) in the Bethe-equation is used as a macroscopic fitting parameter for the range of ions. Effects such as an primary particle dependent I-value are reported, even this is unphysical. Discussion is going on what the I-value for water actually is covering the 75 to 85 eV interval. PSTAR claims 75 eV. More recent studies seem to agree on a value close to 80 eV.
  • Ionization chambers rely on a solid assertion of stopping power ratios, since these detectors measure dose to air. In order to translate this to dose to water, you should know the particle spectrums and the stopping power ratio of water to air (see e.g. IAEA TRS-398 dosimetry protocol, so far one of the best out there, even though it has its flaws...) Or, you can use a parametrization, as Armin tries to show in our recent yet unpublished paper (pre-print).
  • Detector and biology response models such as the Katz or LEM model rely on the stopping power of ions. How large these effects are, is still to be investigated, and is something we want to look at using libdEdx and libamtrack.
There may be many more applications, whereas the first two mentioned here are quite well researched. Frustrating enough, if you have to calculate e.g. the stopping power ratios for a given particle spectrum, you have to rely on the ICRU49 (PSTAR/ASTAR) table and the ICRU73, and they are not calculated consistently. Ok, the errors may be minor for practical dosimetry purposes, but thinking of primary standard laboratories such as PTB in Braunschweig or NPL in London who try to increase the precision at least one order of magnitude, you may get into difficulties.

How can this be, don't we have a large data base on experiments for various ions on various targets? Well, yes, for some ion/target combination, but not for all of them. Peter Sigmund from University of Southern Denmark, (now Professor Emeritus), once showed a very nice matrix of combinations at our 4th Danish Workshop, where all the experimental gaps are.
Even worse is the situation for compounds, here no or very little data are available.

So, we decided to take this up a the 5th Danish Workshop on Particle Therapy, in order to sort out the field, and give the research some direction.
This brings me back to the title of this blog entry: The workshop was scheduled to take place tomorrow (30th November) in Aarhus, but exactly due to the stopping power of frozen water, we had to cancel it. Several key persons were stuck in various airports and could not make it because of snowstorms.

Now... this massive amount of snow in Aarhus at this time of the year is not common, and frankly, I wonder if I am going to make it to work tomorrow. Instead, I would like to invite you - dear reader of this blog - to stop a few minutes with me and silently enjoy the scenery below, accompanied with a piece of J.S. Bach.

Sunday, November 7, 2010

One Stopping Power Library to Rule Them All: libdEdx

Stopping powers describe the energy loss of charged particles traversing matter. In particle therapy, stopping powers are an essential ingredient for calculating the dose distribution of ion beams.

A direct way of calculating the stopping power is using the Bethe equation. However, this equation requires a good knowledge of the ionization potential (in particle therapy jargon: "the I-value") and for compounds this value is pretty ill researched. The I-value can be found experimentally, but there are only few experimental data available for compounds relevant for particle therapy, such as various tissue types and even for water. Our postdoc. Armin Lühr has recently submitted a paper where he takes a closer look on these issues which is available on the archive: http://arxiv.org/abs/1010.5356

Several programs provide stopping powers, either as analytic calculations or inter/extrapolated experimental data. The list below may be incomplete, but these are the codes I have been in touch with so far:
  • ESTAR: for electrons. (Fortran77)
  • PSTAR: for protons. (Fortran77)
  • ASTAR: for alpha particles (Fortran77)
  • MSTAR: for alpha particles and heavier ions up to Z=18. Basically MSTAR is scaling ASTAR data, where the scaling factors are fitted to experimental data. (Fortran77)
  • ATIMA: code developed by GSI. (Java wrapping a Fortran core)
  • TRIM/SRIM: Application which can simulate any ion on any compound.
And various tables provided by the ICRU:
  • ICRU 49: proton data and alphas, equivalent with PSTAR/ASTAR.
  • ICRU 73: ions heavier than helium, old version
  • ICRU 73: new version after errata, quite similar to MSTAR, even if calculated differently.
and in summary they don't agree too well at lower energies (say below 10 MeV/u).

Nonetheless: from an application developer point of view this leaves you in a dilemma of choosing the proper code for your application, and most likely we will see more updates, since the issues are not solved yet with the erratum of the ICRU73.

In addition, from a technical point of view most stopping power codes are not written in convenient ways which allows a clean integration into your application. This is a common thing which happens when physicists develop code: the code will always be optimized to work nicely on the developers computer and fulfill their specific needs. Platform portability, an API, and install scripts following de-facto standards are mostly absent.

This is why we started the development of libdEdx.

libdEdx is meant to be a platform independent stopping power library which contains multiple tables to choose from, and can be extended with additional algorithms/tables. Currently libdEdx includes ESTAR,PSTAR,ASTAR,MSTAR and ICRU73 data as well as an implementation of the Bethe-equation akin to that found in SHIELD-HIT.
The material database is based on the extensive ICRU set found in the ESTAR table, and using Braggs additivity rule libdEdx can extend the MSTAR/ICRU73 data set to cover the ESTAR material list.

libdEdx comes along with an installer based on cmake, and the first official release should be able to run on Windoze just as well as Unix/Posix/Linux compliant platforms.

Surely, Geant4 also offers a range of stopping power tables to choose from, but you do not want to install entire Geant4 just to access the stopping power values.

Our bachelor student Jakob Toftegaard (who very conveniently has a background in physics and computer science) did most of the coding. A very early experimental pre-release is available on sourceforge, but if you want to experiment with it and even contribute you can also grab the most recent version from the SVN repository.

P.S.: Armin and David will present libdEdx on the MC2010 conference in Stockholm on the 9th to the 12th November. Posters can be found here.