Thanks Brian,
I think you have pointed me in the right direction.
However, set(F,'Visisble','off') does not seem to work, although after
grep-ing all of SPM's *.m files for "set(F,'Visisble'" I see what you
mean about it being the main interface. Using the command
set(F,Visisble','off') gives me the following error: "??? Undefined
function or variable 'F'."
On 6/26/06, Lenoski, Brian - SJHMC <[log in to unmask]> wrote:
>
> John,
>
> Yes, you can do almost all from csh (I'm not sure about SPM running w/o the
> GUI but there is a command line function in SPM that may run stuff without
> the GUI or alternatively you could edit the SPM code to make the main SPM
> GUI's not visible i.e. set(F,'Visible','Off') where F is the name of the
> GUI in SPM). However, the process would be to use csh to start matlab and
> point it to "my script" which will call the "spm pet" process. You can also
> redirect the output to a text file to check on success status.
>
> The code in csh is something like:
>
> /usr/local/bin/matlab -nojvm -nosplash < /home/batch_spm5.m >
> $IMG_DIR/spm5_batch.txt
>
> where the "<" operator indicates the script matlab will execute and the ">"
> operator indicates the file output will be sent to. Note: the output file
> is created if it does not exist or is overwritten if it does exist. You can
> also pass Matlab variables from csh via the "setenv" command in csh and
> "getenv" command in matlab which can aid for batch scripting. Also, you'll
> have to code your success or not into the matlab script and look-it up in
> the output file.
>
> I'm working a batch script for spm5 currently using a csh jump-start which I
> included as a reference to start from.
>
> Good Luck,
> Brian
>
> -----Original Message-----
> From: SPM (Statistical Parametric Mapping)
> To: [log in to unmask]
> Sent: 6/21/2006 12:59 PM
> Subject: [SPM] Passing parameters from c-shell to SPM
>
> I am writing a c-shell script to process a lot of PET images in multiple
> ways. One of the more time-consuming tasks is normalizing the images to
> the SPM PET template.
>
> I don't want to have to worry about starting matlab either.
>
> I would rather the script:
>
> (1) start matlab,
>
> (2) run "spm pet" w/o GUI,
>
> (3) run my script and
>
> (4) exit back to the shell (and give me a return code so I can determine
> if it was successful or not).
>
> i.e., I would like to be able to do:
>
> set matlabreturncode=`matlab << spm pet << myscript`
> echo "Matlab exited with $?matlabreturncode."
>
> This is all an effort to streamline the process of looking at PET scan
> results and would help refine (speed-up) the process here in the
> laboratory, so that we can do even more with PET.
>
> Is there a way to tell both MATLAB and SPM that I want all this done?
>
>
>
>
>
|