Folks:
Basic scripting questions:
1. When you launch FS from command line and provide a -tcl command to invoke a tcl script, how do you supply arguments to that script (or is that even possible)?
FWIW, I tried things along the lines of:
set myvar [lindex $argv 1]
... and this gives an error about "no such variable".
2. Once a script is running, what variables can it look at to find out:
Current subject id Path to current subject Details about currently loaded surfaces: especially right or left
3. What assumptions, if any, can a script rely on as to current directory?
Thanks,
Graham
Hi Graham,
Kevin can answer the ones I can't, but I usually use env variables and the tcl $env(ENV_NAME) to get at them. The following variables are define by tksurfer:
$subject $home $hemi
among a bunch of others.
Bruce
On Fri, 13 Apr 2007, Graham Wideman wrote:
Folks:
Basic scripting questions:
- When you launch FS from command line and provide a -tcl command to invoke
a tcl script, how do you supply arguments to that script (or is that even possible)?
FWIW, I tried things along the lines of:
set myvar [lindex $argv 1]
... and this gives an error about "no such variable".
- Once a script is running, what variables can it look at to find out:
Current subject id Path to current subject Details about currently loaded surfaces: especially right or left
- What assumptions, if any, can a script rely on as to current directory?
Thanks,
Graham
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
- When you launch FS from command line and provide a -tcl command to
invoke a tcl script, how do you supply arguments to that script (or is that even possible)?
There's no way to pass arguments along on the command line, so Bruce's suggestion works best.
- What assumptions, if any, can a script rely on as to current directory?
It will be the same directory from which you started tksurfer. There is a tcl command 'pwd' that will return this. I see most people use an environment variable as the base for paths, unless they want to script to specifically act on something that is in a relative path (like writing a log to the current directory).
freesurfer@nmr.mgh.harvard.edu