<div dir="ltr">Hi,<div><br></div><div>I don't know if this is the issue, but I usually have to escape the parameter list when I use bash $variables. See example below:</div><div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container gmail-js-code-nav-container gmail-js-tagsearch-file" style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-LC34" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">Gate -a <span class="gmail-pl-s" style="box-sizing:border-box"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>'[phantom,<span class="gmail-pl-smi" style="box-sizing:border-box">$phantom</span>] [spotx,<span class="gmail-pl-smi" style="box-sizing:border-box">$x</span>] [spoty,<span class="gmail-pl-smi" style="box-sizing:border-box">$y</span>] [theta,<span class="gmail-pl-smi" style="box-sizing:border-box">$theta</span>] [axisx,<span class="gmail-pl-smi" style="box-sizing:border-box">$axis_x</span>] [axisy,<span class="gmail-pl-smi" style="box-sizing:border-box">$axis_y</span>] [rotation,90]'<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span> Main_phantom.mac</td></tr><tr style="box-sizing:border-box"><td id="gmail-L35" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td></tr></tbody></table><br>Good luck,</div><div><br></div><div>Helge Egil Seime Pettersen, PhD<br>Particle Therapy / Imaging / Proton CT<br>Department of Oncology and Medical Physics<br>Haukeland University Hospital<br>Bergen, Norway<br></div><div><br><br class="gmail-Apple-interchange-newline"></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 17, 2022 at 2:15 PM Schneider Tim <<a href="mailto:Tim.Schneider@curie.fr">Tim.Schneider@curie.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div dir="auto">
<div dir="ltr"></div>
<div dir="ltr">Hi Mark,</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">When I run macros with parameters, I call them like this:</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Gate -a [param,value] mac/macro.mac</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Not sure if your way of doing it is correct as well, but the above always worked for me.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Cheers,</div>
<div dir="ltr">Tim</div>
<div dir="ltr"><br>
<blockquote type="cite">Am 17/03/2022 um 13:11 schrieb BAKER, Mark (THE CLATTERBRIDGE CANCER CENTRE NHS FOUNDATION TRUST) <<a href="mailto:mark.baker23@nhs.net" target="_blank">mark.baker23@nhs.net</a>>:<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">




<div>
<p class="MsoNormal">Hi all<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am trying to run some parameters into my Gate simulation, but it doesn’t seem to be working and Gate sticks at the PreInit stage (although the CPU does ramp up to 100%). I am running multiple instances of Gate (up to 8 simultanouely),
 so it is laborious to go into each of the macs every time I want to change a parameter, so I was hoping this would help. My project is hoping to calculate dose distributions from PET scans using CT scans as the geometry. Previously it was working fine until
 I tried to add the parameters. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The relevant parts of my code are below (there is obviously a lot more so I’ve attached the files also in case anyone wants to look deeper, some bits commented out during the debugging)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In the main1.mac, I have changed the geometry to<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/world/daughters/name patientCT<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/world/daughters/insert ImageNestedParametrisedVolume<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/patientCT/geometry/setImage {CTData}<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The main1.mac calls sourceF18.mac as its source, which contains the link to the PET data. The relevant part is<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/source/addSource patientPET voxel<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/source/patientPET/imageReader/readFile {PETData}<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I also change the number of primaries on the fly, so I set that to the following in main1.mac<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">/gate/application/setTotalNumberOfPrimaries {NoOfPrimaries}</span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ve a got a script to run the multiple instances of Gate, alongside a lot of housework for moving files and merging them etc. I have checked the input to the parameters, and as far as I can tell, they are fine.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I call Gate using the following<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">Gate mac/main1.mac [CTData,$CTDataFile] [NoOfPrimaries,$NumberPrimaries] [PETData,$PTDataFile] &<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal">where the user could select the following information, for example,<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">$CTDataFile is data/dcm/CT/br38f.mha
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">$PTDataFile is data/dcm/PT/brainmaskPET.mha<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">$NumberPrimaries is 1000<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If I go back to my main1.mac etc. and manually change the parameters to the data above and change my run.sh script to
<span style="font-family:"Courier New"">Gate mac/main1.mac &</span>  it works perfectly, so presumably I am doing something wrong with passing the parameters through.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’d appreciate it if anyone had any thoughts on this? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b><span style="color:rgb(0,104,113)">Mark Baker<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">Principal Clinical Scientist (Interim)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">Imaging Physics (Ionising)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">The Clatterbridge Cancer Centre NHS Foundation Trust<u></u><u></u></span></p>
<p class="MsoNormal"><i><span style="color:rgb(0,104,113)">(he, him)<u></u><u></u></span></i></p>
<p class="MsoNormal"><b><span style="color:rgb(0,104,113)"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">CCCW Tel:  0151 556 5030
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">CCCL Tel: 0151 318 8438<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)">Email:
</span><span style="color:rgb(68,114,196)"><a href="mailto:mark.baker23@nhs.net" target="_blank"><span style="color:rgb(68,114,196)">mark.baker23@nhs.net</span></a></span><span style="color:rgb(0,104,113)">
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(68,114,196)"><a href="https://teams.microsoft.com/l/chat/0/0?users=mark.baker23@nhs.net" target="_blank"><span style="color:rgb(68,114,196)">Microsoft Teams (click here)</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><span> <span style="color:rgb(0,104,113)"><u></u><u></u></span></span></p>
<p class="MsoNormal"><i><span style="color:rgb(0,104,113)">Honorary Lecturer, Dept. of Physics<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="color:rgb(0,104,113)">University of Liverpool<u></u><u></u></span></i></p>
<p class="MsoNormal"><span style="color:rgb(0,104,113)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span></span></p>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div dir="ltr">
<div>
<p class="MsoNormal"><span><u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<font face="Courier New" color="Black" size="2"><br>
************************************************************************************** ******************************<br>
<br>
This message may contain confidential information. If you are not the intended recipient please:<br>
i) inform the sender that you have received the message in error before deleting it; and
<br>
ii) do not disclose, copy or distribute information in this e-mail or take any action in relation to its content (to do so is strictly prohibited and may be unlawful).
<br>
Thank you for your co-operation.<br>
<br>
NHSmail is the secure email, collaboration and directory service available for all NHS staff in England. NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and other accredited email services.<br>
<br>
For more information and to find out how you can switch visit <a href="https://support.nhs.net/article-categories/joining-nhsmail/" target="_blank">
Joining NHSmail – NHSmail Support</a><br>
<br>
</font></div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"></div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"></div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"></div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"><span>_______________________________________________</span><br>
<span>Gate-users mailing list</span><br>
<span><a href="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank">Gate-users@lists.opengatecollaboration.org</a></span><br>
<span><a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" target="_blank">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a></span></div>
</blockquote>
</div>

_______________________________________________<br>
Gate-users mailing list<br>
<a href="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank">Gate-users@lists.opengatecollaboration.org</a><br>
<a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" rel="noreferrer" target="_blank">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a></blockquote></div>