PDA

View Full Version : Creating a GUI for the commands that i enter to terminal



aytacd
September 8th, 2009, 07:06 PM
Hello everyone,

I'm using a program called freesurfer. I enter several functions through the terminal and get the results.
such as when i write "tksurfer SUBJ1 lh inflated" a brain image open on a window and i'm able to select the region that i want to process by mouse.

or i will enter "sliceview-sess -s SUBJ1 -a rtopy -c eccen -map h -slice mos" which some parts could be optional (SUBJ1)

i need a create a gui. I have all the functions and can run these on terminal. Any ideas about how can i convert them to a gui. I don't need a complicated tool only buttons that will call the functions will be enough...

Hope i could explain what i need. Any thoughts?

stevescripts
September 8th, 2009, 07:28 PM
hmm... I *suspected* when I saw "tksurfer", that there might be a tcl/tk
scripting interface to freesurfer. (I have never used this, FWIW).

Have you looked at this link? http://surfer.nmr.mgh.harvard.edu/fswiki/TkSurferGuide/TkSurferScripting/TkSurferIntroToScripting

For help getting started with tcl/tk - look here:

http://wiki.tcl.tk/

While I (and others here) can provide a bit of assistance with getting started with tcl/tk - I do not currently have the time/energy to learn TkSurfer.

Hope this helps a bit.

Steve

issih
September 8th, 2009, 07:34 PM
Well, most programming languages will let you throw together a gui that just calls native code.... but doing so will depend on the language you choose

Java will certainly do it, I'd bet python too (although I never have used it)

As an alternative that may suffice and will take you ten seconds, you could just create launchers on the desktop that call those commands (unless the SUBJ1 is being manipulated in some clever way) and use those directly.

Hope that helps

aytacd
September 9th, 2009, 08:24 AM
Thanks for your advices. What about writing each function in a script, save them seperately and call them from MATLAB?
I don't have much programming experience, and much time so matlab or a tool that i don't need to know Java/C/Phyton etc. will be perfect for me.

MrBoxes
September 10th, 2009, 04:19 AM
I'm extremely interested in any advice on this topic. I've been looking for how to do this for a bit now. I want to make a GUI with buttons that when pressed would execute commands and promp for options maybe. I'm fine with coding and I'd actually prefer tk. Thanks in advanced.

aytacd
September 14th, 2009, 01:22 PM
ok here is what i did:

i have created scripts (.sh) for each command that i have run in terminal. For that i need to add setenv and source codes to each scripts.

Than i call each script from matlab with system('source myscript.sh)
for this i save all commands to work folder of the matlab.
After that i create my gui with matlab.

That is the easiest way for me to create a gui. Thanks for your help.

stevescripts
September 14th, 2009, 05:14 PM
MrBoxes -

How about you start a new thread, with some specific examples of some of the commands you are talking about?

Just for clarification - you said you would actually prefer tk ... so are we talking about tk from tcl, Python, Ruby, or ... ?

Steve
(I am quite busy right now - so be patient concerning replies, please)