<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
h4
{mso-style-priority:9;
mso-style-link:"Heading 4 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
font-weight:bold;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.Heading4Char
{mso-style-name:"Heading 4 Char";
mso-style-priority:9;
mso-style-link:"Heading 4";
font-family:"Calibri Light",sans-serif;
color:#2E74B5;
mso-fareast-language:EN-GB;
font-style:italic;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1295211281;
mso-list-template-ids:-1321796898;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:1297024371;
mso-list-template-ids:1727951826;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2
{mso-list-id:1667122859;
mso-list-template-ids:-1721499378;}
@list l2:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l2:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l2:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Hi<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>A quick comment on the following:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>----------<o:p></o:p></span></p><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.<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>-----------<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>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.<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></a></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Kris<o:p></o:p></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'> gate-users-bounces@lists.opengatecollaboration.org [mailto:gate-users-bounces@lists.opengatecollaboration.org] <b>On Behalf Of </b>David Sarrut<br><b>Sent:</b> 09 June 2015 00:57<br><b>To:</b> gate-users; germano.russo@i-seecomputing.com<br><b>Subject:</b> Re: [Gate-users] [Gate] Fix the use of IAEA phase space files (#34)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:36.0pt'>Hello <span style='font-size:9.5pt'>Germano Russo, </span><o:p></o:p></p><div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></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.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:36.0pt'>More details : <a href="https://github.com/OpenGATE/Gate/pull/34">https://github.com/OpenGATE/Gate/pull/34</a><o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:36.0pt'>Sincerely, <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:36.0pt'>David<o:p></o:p></p></div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p><div><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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><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.<o:p></o:p></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.<o:p></o:p></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.<o:p></o:p></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.<o:p></o:p></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).<o:p></o:p></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>").<o:p></o:p></p><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 id="_x0000_i1045" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonpdd"></span></a><o:p></o:p></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 id="_x0000_i1046" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonxprofiles"></span></a><o:p></o:p></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 id="_x0000_i1047" src="cid:~WRD000.jpg" alt="Image removed by sender. comparisonyprofiles"></span></a><o:p></o:p></p><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:<o:p></o:p></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><o:p></o:p></p><h4 style='margin-left:36.0pt'>Commit Summary<o:p></o:p></h4><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Reversed type of IAEA_I32 to int, according with the current IAEA setting.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>1) In the function 'GateSourcePhaseSpace::OpenIAEAFile()' the call<o:p></o:p></p><h4 style='margin-left:36.0pt'>File Changes<o:p></o:p></h4><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><strong>M</strong> <a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-0" target="_blank">source/general/include/GateIAEAConfig.h</a> (5) <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><strong>M</strong> <a href="https://github.com/OpenGATE/Gate/pull/34/files#diff-1" target="_blank">source/physics/src/GateSourcePhaseSpace.cc</a> (5) <o:p></o:p></p><h4 style='margin-left:36.0pt'>Patch Links:<o:p></o:p></h4><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo3'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><a href="https://github.com/OpenGATE/Gate/pull/34.patch" target="_blank">https://github.com/OpenGATE/Gate/pull/34.patch</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo3'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><a href="https://github.com/OpenGATE/Gate/pull/34.diff" target="_blank">https://github.com/OpenGATE/Gate/pull/34.diff</a><o:p></o:p></p><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 id="_x0000_i1049" src="cid:image002.jpg@01D0A281.A215E850" alt="Image removed by sender."></span><o:p></o:p></span></p></blockquote></div><p class=MsoNormal style='margin-left:36.0pt'><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p></div><p class=MsoNormal style='margin-left:36.0pt'>-- <o:p></o:p></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<o:p></o:p></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>_________________________________<o:p></o:p></p></div><p class=MsoNormal style='margin-left:36.0pt'> "2 + 2 = 5, for extremely large values of 2"<br>_________________________________<o:p></o:p></p></div></body></html>