Diff for "SpmTips" - MRC CBU Imaging Wiki
location: Diff for "SpmTips"
Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2006-07-04 15:00:30
Size: 1919
Editor: Scripting Subsystem
Comment:
Revision 5 as of 2006-08-16 13:19:01
Size: 3274
Editor: RhodriCusack
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[TableOfContents]]
Line 2: Line 4:
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.
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.
Line 4: Line 8:
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 two 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.
Line 6: Line 9:
The second 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. 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.
Line 8: Line 11:
If you get sick of making mistakes, and having to go back to the beginning, then consider [wiki:SpmBatch99 SPM batch mode], or one of our automated covariate / condition entry SPM hacks - see [wiki:SpmHowtos the SPM howtos page] for links. 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 [wiki:SpmBatch SPM batch mode].
Line 11: Line 18:
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 [wiki:SpmVersions SPM versions page] ) automatically run matlab and SPM on our server, which has 2GB of memory and is reasonably fast.Perhaps more importantly, put your image files on the disk that is local to the machine that will run SPM. In the CBU, this will be in our imagers directories. Also, run SPM from a directory on the same disk, so that SPM writes results onto the local disk too. The file reads and writes can slow SPM down dramatically if they have to go via the network.
Line 13: Line 19:
Matthew Brett 9/10/99 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 [wiki:SpmVersions SPM versions page]) automatically run matlab and SPM on our linux machines, which each have 2GB of memory and are reasonably fast.
Line 15: Line 21:
[[Anchor(naughty_winzip)]]
== Corrupted mat files ==
Line 16: Line 24:
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 [http://www.zipgenius.it/eng zipgenius].

[[Anchor(invalid_contrast)]]
== 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

TableOfContents

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 [wiki:SpmBatch 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 [wiki:SpmVersions SPM versions page]) automatically run matlab and SPM on our linux machines, which each have 2GB of memory and are reasonably fast.

Anchor(naughty_winzip)

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 [http://www.zipgenius.it/eng zipgenius].

Anchor(invalid_contrast)

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)