<div dir="ltr">thanks Kris, <div><br></div><div>I will change to probably for std::int32_t. But does it require to compile with cxx11 ?</div><div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 9, 2015 at 12:58 PM, Kris Thielemans <span dir="ltr"><<a href="mailto:kris.f.thielemans@gmail.com" target="_blank">kris.f.thielemans@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">A quick comment on the following:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">----------<u></u><u></u></span></p><span class=""><p style="margin-left:36.0pt"><em>things seem to be outdated, for instance in the "GateIAEAConfig.h" the</em><i><br><em>definition 'typedef long IAEA_I32' must be replaced with 'typedef int</em><br><em>IAEA_I32' in order to conform to the current "</em></i>.IAEAphsp" file format.<u></u><u></u></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">-----------<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">This change will be compiler/system/time dependent. I don’t know what the GATE policy is, but in STIR we use boost::int32_t. if you don’t care about older compilers, you should use std::int32_t (from <cstdint>) I guess.<u></u><u></u></span></p><p class="MsoNormal"><a name="14dd7f8791d27cfa__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Kris<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:gate-users-bounces@lists.opengatecollaboration.org" target="_blank">gate-users-bounces@lists.opengatecollaboration.org</a> [mailto:<a href="mailto:gate-users-bounces@lists.opengatecollaboration.org" target="_blank">gate-users-bounces@lists.opengatecollaboration.org</a>] <b>On Behalf Of </b>David Sarrut<br><b>Sent:</b> 09 June 2015 00:57<br><b>To:</b> gate-users; <a href="mailto:germano.russo@i-seecomputing.com" target="_blank">germano.russo@i-seecomputing.com</a><br><b>Subject:</b> Re: [Gate-users] [Gate] Fix the use of IAEA phase space files (#34)<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-left:36.0pt">Hello <span style="font-size:9.5pt">Germano Russo, </span><u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">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.<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">More details : <a href="https://github.com/OpenGATE/Gate/pull/34" target="_blank">https://github.com/OpenGATE/Gate/pull/34</a><u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">Sincerely, <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">David<u></u><u></u></p></div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div></div><div><div><div class="h5"><p class="MsoNormal" style="margin-left:36.0pt">On Mon, Jun 8, 2015 at 10:32 AM, germanorusso <<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>> wrote:<u></u><u></u></p></div></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div class="h5"><p style="margin-left:36.0pt">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.<u></u><u></u></p><p style="margin-left:36.0pt">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.<u></u><u></u></p><p style="margin-left:36.0pt">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.<u></u><u></u></p><p style="margin-left:36.0pt">2) The "GateIAEA<em>" source files appear to be based on an old C++</em><i><br><em>implementation for handling phase spaces distributed by the IAEA. Some</em><br><em>things seem to be outdated, for instance in the "GateIAEAConfig.h" the</em><br><em>definition 'typedef long IAEA_I32' must be replaced with 'typedef int</em><br><em>IAEA_I32' in order to conform to the current "</em></i>.IAEAphsp" file format.<u></u><u></u></p><p style="margin-left:36.0pt">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).<u></u><u></u></p><p style="margin-left:36.0pt">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>").<u></u><u></u></p></div></div><p style="margin-left:36.0pt"><a href="https://cloud.githubusercontent.com/assets/8522577/8030667/fed03d40-0dc8-11e5-8a51-90eae801a36d.png" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="100" height="100" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonpdd"></span></a><u></u><u></u></p><p style="margin-left:36.0pt"><a href="https://cloud.githubusercontent.com/assets/8522577/8030686/28bccb3c-0dc9-11e5-9075-8756f6952043.png" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="100" height="100" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonxprofiles"></span></a><u></u><u></u></p><p style="margin-left:36.0pt"><a href="https://cloud.githubusercontent.com/assets/8522577/8030692/2e0595f6-0dc9-11e5-8da2-ed4992dd8c9b.png" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="100" height="100" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonyprofiles"></span></a><u></u><u></u></p><span class=""><div class="MsoNormal" align="center" style="margin-left:36.0pt;text-align:center"><hr size="3" width="100%" align="center"></div><h4 style="margin-left:36.0pt">You can view, comment on, or merge this pull request online at:<u></u><u></u></h4><p style="margin-left:36.0pt"> <a href="https://github.com/OpenGATE/Gate/pull/34" target="_blank">https://github.com/OpenGATE/Gate/pull/34</a><u></u><u></u></p><h4 style="margin-left:36.0pt">Commit Summary<u></u><u></u></h4><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u>Reversed type of IAEA_I32 to int, according with the current IAEA setting.<u></u><u></u></p><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u>1) In the function 'GateSourcePhaseSpace::OpenIAEAFile()' the call<u></u><u></u></p><h4 style="margin-left:36.0pt">File Changes<u></u><u></u></h4><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><strong>M</strong> <a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-0" target="_blank">source/general/include/GateIAEAConfig.h</a> (5) <u></u><u></u></p><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><strong>M</strong> <a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-1" target="_blank">source/physics/src/GateSourcePhaseSpace.cc</a> (5) <u></u><u></u></p><h4 style="margin-left:36.0pt">Patch Links:<u></u><u></u></h4><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><a href="https://github.com/OpenGATE/Gate/pull/34.patch" target="_blank">https://github.com/OpenGATE/Gate/pull/34.patch</a><u></u><u></u></p><p class="MsoNormal" style="margin-left:72.0pt"><u></u><span style="font-size:10.0pt;font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><a href="https://github.com/OpenGATE/Gate/pull/34.diff" target="_blank">https://github.com/OpenGATE/Gate/pull/34.diff</a><u></u><u></u></p></span><p style="margin-left:36.0pt"><span style="color:#666666">—<br>Reply to this email directly or <a href="https://github.com/OpenGATE/Gate/pull/34" target="_blank">view it on GitHub</a>.<span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="1" height="1" src="cid:image002.jpg@01D0A281.A215E850" alt="Image removed by sender."></span><u></u><u></u></span></p></blockquote></div><span class=""><p class="MsoNormal" style="margin-left:36.0pt"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><p class="MsoNormal" style="margin-left:36.0pt">-- <u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">David Sarrut, Phd<br>Directeur de recherche CNRS<br>CREATIS, UMR CNRS 5220, Inserm U 1044<u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt">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" target="_blank">04 78 78 51 51</a> / <a href="tel:06%2074%2072%2005%2042" 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>_________________________________<u></u><u></u></p></div><p class="MsoNormal" style="margin-left:36.0pt"> "2 + 2 = 5, for extremely large values of 2"<br>_________________________________<u></u><u></u></p></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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 : 04 78 78 51 51 / 06 74 72 05 42<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>