<div dir="ltr">Hello <span style="font-size:12.8000001907349px">Germano Russo, </span><br style="font-size:12.8000001907349px"><div><br></div><div>thank you very much for your pull-request, it has been merged (develop branch). I think a lot of users will be happy to see IAEA phase space now corrected in Gate.</div><div><br></div><div>More details : <a href="https://github.com/OpenGATE/Gate/pull/34">https://github.com/OpenGATE/Gate/pull/34</a></div><div><br></div><div>Sincerely, </div><div>David</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 10:32 AM, germanorusso <span dir="ltr"><<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p>I recently tried to use as source an IAEA phase space, specifically the<br>
one named "VarianClinaciX_6MV_10x10_w1.IAEAphsp" (downloadable<br>
from <a href="https://www-nds.iaea.org/phsp/photon1/" target="_blank">https://www-nds.iaea.org/phsp/photon1/</a>), via the "/gate/source/[Source<br>
name]/addPhaseSpaceFile" macro command.</p>
<p>The simulation (Gate 7.0) run smoothly, however I got meaningless results.<br>
Digging into the related Gate source code, I believe I found 3 bugs<br>
for which I propose a correction in the 'fixIAEAphspSource' branch.</p>
<p>1) In the function 'GateSourcePhaseSpace::OpenIAEAFile()' the call<br>
'pIAEARecordType->initialize()' is placed after<br>
'pIAEAReader->getRecordContents(pIAEARecordType)'. These two lines shall be<br>
swapped, otherwise the record contents information extracted form the IAEA<br>
header and stored in the the object pointed by pIAEARecordType is cleared<br>
by the initialisation operation.</p>
<p>2) The "GateIAEA<em>" source files appear to be based on an old C++<br>
implementation for handling phase spaces distributed by the IAEA. Some<br>
things seem to be outdated, for instance in the "GateIAEAConfig.h" the<br>
definition 'typedef long IAEA_I32' must be replaced with 'typedef int<br>
IAEA_I32' in order to conform to the current "</em>.IAEAphsp" file format.</p>
<p>3) In the function 'GateSourcePhaseSpace::GenerateIAEAVertex()' the<br>
'pIAEARecordType->w' variable seems to be misused in the expression 'dz *=<br>
pIAEARecordType->w'. The 'pIAEARecordType->w' variable contains the Z<br>
direction cosine of the particle, not just its sign. So it should rather be<br>
'dz = pIAEARecordType->w'. Since the 'pIAEARecordType->w' variable is<br>
slightly smaller than 1, this mistake causes small errors in the<br>
normalisation of the momentum (and hence of the kinetic energy).</p>
<p>After having applied these correction, I was able to obtain an output dose distribution for the 10x10 cm field quite close to the experimental data reported in the documentation distributed by IAEA along with the IAEAphsp and IAEAheader files ("<a href="https://www-nds.iaea.org/phsp/photon1/VarianClinaciX_6MV_PHSPdoc_Gothenburg.pdf" target="_blank">https://www-nds.iaea.org/phsp/photon1/VarianClinaciX_6MV_PHSPdoc_Gothenburg.pdf</a>").</p>
<p><a href="https://cloud.githubusercontent.com/assets/8522577/8030667/fed03d40-0dc8-11e5-8a51-90eae801a36d.png" target="_blank"><img src="https://cloud.githubusercontent.com/assets/8522577/8030667/fed03d40-0dc8-11e5-8a51-90eae801a36d.png" alt="comparisonpdd" style="max-width: 100%;"></a></p>
<p><a href="https://cloud.githubusercontent.com/assets/8522577/8030686/28bccb3c-0dc9-11e5-9075-8756f6952043.png" target="_blank"><img src="https://cloud.githubusercontent.com/assets/8522577/8030686/28bccb3c-0dc9-11e5-9075-8756f6952043.png" alt="comparisonxprofiles" style="max-width: 100%;"></a></p>
<p><a href="https://cloud.githubusercontent.com/assets/8522577/8030692/2e0595f6-0dc9-11e5-8da2-ed4992dd8c9b.png" target="_blank"><img src="https://cloud.githubusercontent.com/assets/8522577/8030692/2e0595f6-0dc9-11e5-8da2-ed4992dd8c9b.png" alt="comparisonyprofiles" style="max-width: 100%;"></a></p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href="https://github.com/OpenGATE/Gate/pull/34" target="_blank">https://github.com/OpenGATE/Gate/pull/34</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Reversed type of IAEA_I32 to int, according with the current IAEA setting.</li>
<li>1) In the function 'GateSourcePhaseSpace::OpenIAEAFile()' the call</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-0" target="_blank">source/general/include/GateIAEAConfig.h</a>
(5)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-1" target="_blank">source/physics/src/GateSourcePhaseSpace.cc</a>
(5)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href="https://github.com/OpenGATE/Gate/pull/34.patch" target="_blank">https://github.com/OpenGATE/Gate/pull/34.patch</a></li>
<li><a href="https://github.com/OpenGATE/Gate/pull/34.diff" target="_blank">https://github.com/OpenGATE/Gate/pull/34.diff</a></li>
</ul>
<p style="font-size:small;color:rgb(102,102,102)">—<br>Reply to this email directly or <a href="https://github.com/OpenGATE/Gate/pull/34" target="_blank">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AAcUfDdT50mcjKxOpJ6Zk8eJ0n5Oy89tks5oRUqugaJpZM4E7Ydt.gif" width="1"></p>
<div>
<div>
</div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">David Sarrut, Phd<br>Directeur de recherche CNRS<br>CREATIS, UMR CNRS 5220, Inserm U 1044<div>Centre de lutte contre le cancer Léon Bérard<br>28 rue Laënnec, 69373 Lyon cedex 08<br>Tel : <a href="tel:04%2078%2078%2051%2051" value="+33478785151" target="_blank">04 78 78 51 51</a> / <a href="tel:06%2074%2072%2005%2042" value="+33674720542" target="_blank">06 74 72 05 42</a><br><a href="http://www.creatis.insa-lyon.fr/~dsarrut" target="_blank">http://www.creatis.insa-lyon.fr/~dsarrut</a><br>_________________________________</div><div> "2 + 2 = 5, for extremely large values of 2"<br>_________________________________</div></div></div>
</div></div></div>