Hi John,
For what it's worth, I don't *think* you can do this, though I'm not
completely sure. You can start Matlab without the GUI with something
like "matlab -nodisplay", but you can't run "spm pet" without the GUI
though -- you'd have to call the individual spm_blah functions (e.g.
spm_preproc), and I can't think of a way you could pass variables from
the command line into these Matlab calls.
You may find it easier to instead write the rest of your scripts in
Matlab. This would have the pleasant side-effect of letting you use
GUI things (like spm_select to pick a bunch of filenames) when convenient.
All you really need to know is system('command string') will run a
shell command (bash by default, I believe, rather than csh) from
Matlab. Look at "doc system" for more info. Another alternative is to
use Matlab to create shell scripts that you can run outside of it;
basically keep concatenating strings with newlines to build the script
as a long Matlab string, then write it out using fprintf.
I'm sure you will be able to make progress toward your goal of
streamlining analysis, even if you can't use csh->Matlab->SPM as you'd
like to.
Best of luck,
Ged.
John Zabroski wrote:
> 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?
>
>
|