SpmTips - MRC CBU Imaging Wiki
location: SpmTips

Miscellaneous SPM tips and tricks

This is a pot-pourri of tips for using SPM that didn't seem to fit elsewhere. We would be very grateful for any suggestions for inclusion here. Pourri, in French means 'rotten'. Hmm.

Cancelling an SPM process

As every user of SPM knows, SPM has no Cancel button, or Back key, to go back when you've made a mistake. If you get half way through specifying some steps in an SPM series of prompts, and make a mistake, or you want to stop an SPM job running, then you can do one of three things. The first is to click in the SPM matlab window (the text window for matlab, often with a >> prompt), and press control-C, followed by return. You will get an error message, and the current process will stop, returning another >> prompt to the matlab window.

The second is to right-click somewhere innocuous on the window that you are using; you may get a menu that includes crash out - select that.

The third is to close the SPM window containing the current prompt from the GUI (the SPM input window, or the SPM file selection window). This will cancel that series of prompts.

If you get sick of making mistakes, and having to go back to the beginning, then consider SPM batch mode.

SPM speed tips

Run SPM on the machine with the most memory, and the fastest CPU. More memory is usually more important than speed of CPU, within reasonable limits. In the CBU, the SPM starting commands (see the SPM versions page) automatically run matlab and SPM on our linux machines, which each have 2GB of memory and are reasonably fast.

Corrupted mat files

There can be problems with corrupted mat files, in the following situation:

  • You are using windows
  • You have downloaded an archive containing a mat file in tar.gz or tgz format

  • You used winzip to unpack the archive

This appears to be because of a winzip "feature". To get round this, you need to ensure that winzip is not using "TAR file smart CR/LF conversion"; in my version of winzip this is done via Options->Configuration, Miscellaneous tab, and unchecking the relevant checkbox...

Alternatively use an alternative to winzip. Alle Meije Wink recommends zipgenius.

Not able to enter contrasts with SPM and matlab 7

Some users of matlab 7 seems to hit the following problem:

You are unable to define contrasts using the contrast manager. The cursor sits in the middle of the contrast definition box (not at the top LHS). Once you enter you enter your contrast values and hit enter, the manager continues to say contrast name defined, NO CONTRAST DEFINED.

This seems to be some very complicated bug in matlab 7 that prevents the necessary GUI callback being executed in the contrast GUI. I (MatthewBrett) have briefly tried to track it down, but it's a real horror. For now, you can fix this behavior by entering this at the matlab prompt, before you start the SPM contrast manager:

feature('JavaFigures',0)

or starting matlab without the java engine - from the command line:

matlab -nojvm

MatthewBrett

CbuImaging: SpmTips (last edited 2013-03-07 21:22:58 by localhost)