Example scripts for implementing batch mode analysis for a block design with a few events thrown in



ts1 is the name of an experiment in which there were three different task conditions and one rest condition.

The scripts:

For more information on SPM batch mode, see spm_bch.man

Top-level scripts:

Scripts controlling individual components of the batch jobs:

Miscellaneous (non-spm-batch) scripts:

General utility scripts (not specific to this experiment)

Things to watch out for ...

Global variables.  There are a few global variables that are set in various places that are required for the scripts to run properly.  All lower level scripts should execute independently.  In fact, this is a good way of debugging them before submitting them to the batch interface.  However, some of them rely on global variables that have been set in the higher level scripts (usually *_batch.m and get_*_sinfo.m) for them to run properly.  If necessary, you can set a global variable in the command window and then run your lower level script.

Some global variables are currently being used to handle situations for which global variables are not the optimal way to do it.  This is most obvious when using the mutual information global flag.  If the flag is set true, mutual info is used for all coregistration, even though this might not be the desired action.  One way to get around this might be to have coreg structures for mutual info coregistrations defined in separate mfiles.

Debug your lower-level scripts by running them alone, i.e. invoke ts1_realign and make sure it runs cleanly.  Nothing bad will happen if you do this and it will save you time in the long run.  Debugging from within spm batch mode is a pain in the ass.

Naming conventions for paths:  The scripts assume a specific naming of the directory tree.

In order to get the batch mode to work all the way, I had to modify the following scripts from the SPM distribution.  They must appear on the Matlab path ahead of the SPM distribution.

I modified the bf_ev structure used for specifying event basis functions in the model to return desired sets of gamma functions ('gamma_idxs' field).  I had to modify spm_get_bf.m to get this to work.  Since this is a "feature" rather than a "fix" I would rather not "contaminate/compromise" the integrity of SPM99 by including it at this time.  Please refer to spm_bch.man for the official specification of the bf_ev structure.

Disclaimer

These scripts (in particular the model and contrast sections) have been debugged for a specific experiment and serve only as a model for customizing scripts for your experiments.  I make no claims that they will work for you with little or no effort on your part.

Petr Janata <petr@dartmouth.edu>

Last modified: Fri Mar 16 23:29:09 2001