[Gate-users] [BULK ?] Using parameters for mac files

Helge Pettersen helge.e.s.pettersen at gmail.com
Thu Mar 17 14:36:43 CET 2022


Hi,

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:
Gate -a "'[phantom,$phantom] [spotx,$x] [spoty,$y] [theta,$theta] [axisx,
$axis_x] [axisy,$axis_y] [rotation,90]'" Main_phantom.mac

Good luck,

Helge Egil Seime Pettersen, PhD
Particle Therapy / Imaging / Proton CT
Department of Oncology and Medical Physics
Haukeland University Hospital
Bergen, Norway



On Thu, Mar 17, 2022 at 2:15 PM Schneider Tim <Tim.Schneider at curie.fr>
wrote:

> Hi Mark,
>
> When I run macros with parameters, I call them like this:
>
> Gate -a [param,value] mac/macro.mac
>
> Not sure if your way of doing it is correct as well, but the above always
> worked for me.
>
> Cheers,
> Tim
>
> Am 17/03/2022 um 13:11 schrieb BAKER, Mark (THE CLATTERBRIDGE CANCER
> CENTRE NHS FOUNDATION TRUST) <mark.baker23 at nhs.net>:
>
> 
>
> Hi all
>
>
>
> 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.
>
>
>
> 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)
>
>
>
> In the main1.mac, I have changed the geometry to
>
> /gate/world/daughters/name patientCT
>
> /gate/world/daughters/insert ImageNestedParametrisedVolume
>
> /gate/patientCT/geometry/setImage {CTData}
>
>
>
> The main1.mac calls sourceF18.mac as its source, which contains the link
> to the PET data. The relevant part is
>
> /gate/source/addSource patientPET voxel
>
> /gate/source/patientPET/imageReader/readFile {PETData}
>
>
>
> I also change the number of primaries on the fly, so I set that to the
> following in main1.mac
>
> /gate/application/setTotalNumberOfPrimaries {NoOfPrimaries}
>
>
>
> 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.
>
>
>
> I call Gate using the following
>
> Gate mac/main1.mac [CTData,$CTDataFile] [NoOfPrimaries,$NumberPrimaries]
> [PETData,$PTDataFile] &
>
>
>
> where the user could select the following information, for example,
>
> $CTDataFile is data/dcm/CT/br38f.mha
>
> $PTDataFile is data/dcm/PT/brainmaskPET.mha
>
> $NumberPrimaries is 1000
>
>
>
> 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 Gate mac/main1.mac &  it
> works perfectly, so presumably I am doing something wrong with passing the
> parameters through.
>
>
>
> I’d appreciate it if anyone had any thoughts on this?
>
>
>
> Thank you
>
>
>
> *Mark Baker*
>
> Principal Clinical Scientist (Interim)
>
> Imaging Physics (Ionising)
>
> The Clatterbridge Cancer Centre NHS Foundation Trust
>
> *(he, him)*
>
>
>
> CCCW Tel:  0151 556 5030
>
> CCCL Tel: 0151 318 8438
>
> Email: mark.baker23 at nhs.net
>
> Microsoft Teams (click here)
> <https://teams.microsoft.com/l/chat/0/0?users=mark.baker23@nhs.net>
>
>
>
> *Honorary Lecturer, Dept. of Physics*
>
> *University of Liverpool*
>
>
>
>
>
>
>
>
> **************************************************************************************
> ******************************
>
> This message may contain confidential information. If you are not the
> intended recipient please:
> i) inform the sender that you have received the message in error before
> deleting it; and
> 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).
> Thank you for your co-operation.
>
> 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.
>
> For more information and to find out how you can switch visit Joining
> NHSmail – NHSmail Support
> <https://support.nhs.net/article-categories/joining-nhsmail/>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20220317/4bdea2f9/attachment.html>


More information about the Gate-users mailing list