Hi Jared
Few things:
* I think primarily the error is because tcl doesn't have "sleep" command. tcl has an "after" command, however, which takes the arguments in milliseconds. So you'd use "after 5000" to make it wait for 5 seconds.
* Also to force the screen to update immediately, use the "RedrawScreen" command
* consolidating everything, the script that seems to work is after 5000 SetDisplayFlag 16 0 RedrawScreen after 5000 SetDisplayFlag 16 1 RedrawScreen after 5000
I saved this is test.tcl and gave tkmedit <subj_name> brain.mgz -segmentation aseg.mgz -tcl test.tcl
* Also note that you can give "source" command in the tcl command window i.e. if you had loaded tkmedit with just "tkmedit <subj_name> brain.mgz -segmentation aseg.mgz " then in the prompt if you give %source test.tcl
it's equivalent to the -tcl switch.
* Finally, the tkmedit scripting does have a guide/reference http://surfer.nmr.mgh.harvard.edu/fswiki/TkMeditGuide/TkMeditReference/TkMed...
Best Krish
On Sep 19, 2008, at 1:09 PM, Jared Price wrote:
Sure, thanks for the interest. It is my first time trying to automate something so it is an admittedly novice attempt. Tkmedit is invoked with the usual syntax using "tkmedit (Patient id) brainmask.mgz -segmentation aseg.mgz" The script was created in nano and I have attached it. I think the issue is just getting the file to read properly when in the tkmedit environment. Also, it might be helpful to know that the file is located in usr/bin. It might also be helpful to know that we use Mac OS X and we are using X11 as the graphical interface program for tkmedit and Terminal (running a tcsh shell) as our command-line interpreter. Also, I have not added looping to it yet, I want to make sure I can get it to run properly before trying to loop it. Thanks again. Jared
Jared Price Center for Neurological Imaging Brigham and Women's Hospital Harvard Medical School 1249 Boylston Street Boston, MA 02115
617-525-6076 jcp44@bwh.harvard.edu
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance Help Line at 800-856-1983 and properly dispose of this information.
Krish Subramaniam wrote:
Hi Jared
Could you give the script as well as the command you used to invoke tkmedit?
Krish
On Sep 19, 2008, at 8:32 AM, Jared Price wrote:
Hi everyone, I have written a simple script to automate the switching between the grayscale MRI image and the segmentation volume. All it is is a script that types "SetDisplayFlay 16 1" followed by a waiting period and then "SetDisplayFlag 16 0" followed by another waiting period and then loops. However, even though these commands work just fine when entered directly into Terminal, when I try to run the script I get an error saying essentially that the command or script itself can't be found. Of course, this is done while running tkmedit and so the title bar of my terminal reads "terminal - tkmedit.bin". When I type "echo $PATH" I get the respone that the PATH variable does not exist. Does anyone know how to make the command function in tkmedit? Thanks,
Jared Price Center for Neurological Imaging Brigham and Women's Hospital Harvard Medical School 1249 Boylston Street Boston, MA 02115
617-525-6076 jcp44@bwh.harvard.edu
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance Help Line at 800-856-1983 and properly dispose of this information. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
SetDisplayFlag 16 0 sleep 5 SetDisplayFlag 16 1 sleep 5
freesurfer@nmr.mgh.harvard.edu