[Gate-users] More than One Alias error and simple arithmetic in GATE

David Sarrut David.Sarrut at creatis.insa-lyon.fr
Fri Dec 9 13:57:54 CET 2016


Hello,

on my side I enclose the variable within ' ' :
Gate mac/main.mac -a '[RADIUS,15.5] [RADIO,Tc99m] [TIME,0.2]'

(maybe it depends on the shell type)

David
PS: very useful the G4 arithmetic, thanks Gergely !


On Thu, Dec 8, 2016 at 1:33 PM, Gergely Patay <gergely.patay at mediso.com>
wrote:

> Hi,
>
> basic arithmetic expressions ("add", "subtract", "multiply", "divide",
> "remainder") are available in Geant macros, under the command directory
> /control . They are easy to use if you get used to the quite assembly-ish
> syntax.
>
> E.g. this is a valid macro excerpt:
>
> /control/alias radius 40.0
> /control/alias crystallength 10.0
> /control/divide temp {crystallength} 2.0
> /control/add effectiveradius {radius} {temp}
> # the {effectiveradius} will now hold the value 45.0
>
> The full documentation is avaliable here:
> http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuid
> es/ForApplicationDeveloper/html/AllResources/Control/UIco
> mmands/_control_.html
>
> best regards,
>
>  Gergely
>
>
>
> On 2016-12-08 11:29, Thomas DESCHLER wrote:
>
>> Hi Lukas,
>>
>> Yes the problem with aliases is a known issue
>> <https://github.com/OpenGATE/Gate/issues/69>.
>>
>> To solve it just declare all aliases without spaces, like this:
>> Gate -a [AliasOne,$varone][AliasTwo,$vartwo] main.mac
>>
>> For your second question, I don't think it is possible to do arithmetic
>> operation in macros, but I could be wrong.
>>
>> Sincerely,
>>
>> Thomas
>>
>> *Thomas DESCHLER*
>> Doctorant en Physique des Rayonnements
>> Institut Pluridisciplinaire Hubert Curien <http://www.iphc.cnrs.fr/>
>> Département Recherches Subatomiques
>> <http://www.iphc.cnrs.fr/spip.php?page=rubrique&id_rubrique=143> -
>> Groupe Ramses
>> <http://www.iphc.cnrs.fr/-Ramses-.html>
>> Bâtiment 35, Bureau 208
>>
>> Thomas.Deschler at iphc.cnrs.fr
>> <https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=Thom
>> as.Deschler at iphc.cnrs.fr>
>> (+33) 03 88 10 63 95 <tel:+33388106395>
>> (+33) 06 20 96 07 49 <tel:+33620960749>
>>
>> 2016-12-08 10:41 GMT+01:00 Lukas Gromann <lukas.gromann at tum.de
>> <mailto:lukas.gromann at tum.de>>:
>>
>>     Hi all,
>>
>>     Im trying to use aliases to batch process more than one simulation,
>> however
>>     only the first alias after the „-a“ gets read… I’m using Version 7.1,
>> is
>>     this a known bug? The wiki says I should be able to read in more than
>> one…
>>
>>     The other question would be to dismiss the second alias and calculate
>> the
>>     desired value directly in the macro. (In my case the position,
>> depending on
>>     a sample size). I can not find any documentation about simple
>> arithmetic
>>     operations in the wiki. Is there a possibility to do something like
>> „value =
>>     a+b" in a gate macro?
>>
>>     Thanks,
>>
>>     Lukas
>>
>>     ----------------------------------------------------
>>     Lukas Gromann
>>
>>     Lehrstuhl für Biomedizinische Physik (E17)
>>     Technische Universität München
>>     Boltzmannstrasse 11
>>     85748 Garching
>>
>>     Lukas.Gromann at TUM.de <mailto:Lukas.Gromann at TUM.de>
>>
>>     Tel.: 089-289/10905
>>     Mobil: 017629718306
>>
>>
>>     _______________________________________________
>>     Gate-users mailing list
>>     Gate-users at lists.opengatecollaboration.org
>>     <mailto:Gate-users at lists.opengatecollaboration.org>
>>     http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>>     <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
>>
>> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>



-- 
David Sarrut, Phd
Directeur de recherche CNRS
CREATIS, UMR CNRS 5220, Inserm U1206
Centre de lutte contre le cancer Léon Bérard
28 rue Laënnec, 69373 Lyon cedex 08
Tel : 04 78 78 51 51 / 06 74 72 05 42
http://www.creatis.insa-lyon.fr/~dsarrut
_________________________________
 "2 + 2 = 5,  for extremely large values of 2"
_________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20161209/64aa4db4/attachment.html>


More information about the Gate-users mailing list