22
SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

Embed Size (px)

Citation preview

Page 1: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

SPM5 is all around!

SPM5 Tutorialsby the Wellcome Department of Imaging Neuroscience

Page 2: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

2

SPM5: What’s New?SPM5: What’s New?

User Interface + Documentation

Data Formats (NIFTI-1)

Spatial Normalisation and Segmentation

fMRI: Bayesian Analysis with Spatial Priors

EEG/MEG: Time-frequency Analysis DCM for ERPs Source Localisation

John

Stefan

Jérémie

Will

Version Control System: Subversion me

Page 3: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

3

SPM5SPM5

SPM5 is: 500 Matlab files 100 000 lines of Matlab code 10 000 lines of C code gallons of beer

SPM5 requirements: Matlab 6.5.1 or 7.0 Provided with compiled MEX-files for Windows,

Linux (32/64-bit), Solaris. NIFTI-1 file format for images

Page 4: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

4

SPM5: When?SPM5: When?8 Feb 2005: Teasing by Will on the SPM list

4 May 2005: Mouth watering by John on the SPM list

9 May 2005: Beta release of SPM5 (this is SPM5b (revision 136))

18 May 2005: First updates published

October 2005: SPM5 Tutorials

November 2005: SPM5 release

Page 5: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

5

SPM devel, SPM5b or SPM5?SPM devel, SPM5b or SPM5?

“SPM devel” per say doesn’t really exist anymore. SPM5b (beta) is on the same line of development

than SPM5 (but not SPM2).

A fully patched SPM5b is indeed SPM5.

tSPM2 SPM5b SPM5

SPM2 line of development

SPM5 line of development

Page 6: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

6

I want SPM5 here and now !I want SPM5 here and now !

How to get the latest version of SPM5?

Old-fashioned ways Download it from the web Get it from the FIL network

The disruptive innovation “Subversion” What is it? TortoiseSVN (Windows only)

SPM Update Toolbox

A few more comments

Revision numbers

Matlab path

Page 7: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

7

Download SPM5 from the webDownload SPM5 from the web

Registration form:http://www.fil.ion.ucl.ac.uk/spm/software/download.html

FTP link where you can download spm5b.tar.gzftp://ftp.fil.ion.ucl.ac.uk/spm/restricted/xxxxxx/

Unpack the tar.gz archive using any data compression software (WinZip, 7-zip, gunzip, …)

(not using “TAR file smart CR/LF conversion” but “Use folder names”)

Download the latest package:

Download the updates:

FTP directory:ftp://ftp.fil.ion.ucl.ac.uk/spm/spm5b_updates/

Unpack Updates_???.tar.gz to overwrite your SPM installation

Updates_README.txt

Updates_???.tar.gz

Check for updates regularly for new features/bugs fixes…

Page 8: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

8

Get SPM5 from the FIL networkGet SPM5 from the FIL network

Copy this folder to overwrite your local copy from time to time…

An updated version is available on the Unix network: /local/spm/spm5b

Don’t use SPM directly over the network!

Page 9: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

9

SubversionSubversionhttp://subversion.tigris.org/

http://svnbook.red-bean.com/

Subversion is the free/open-source version control system used for SPM code.

Manages files and directories over time.

Remember every change even made to files and directories.

Allows to recover older version of the code or examine the history of how your data changed.

Collaborative editing and sharing of data (source code).

Page 10: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

10

SubversionSubversion

Subversion Repository

Subversionlibrary

Internet/Intranet(any TCP/IP Network)

Client interface

SPMUpdate

Command line

TortoiseSVN

Subversionserver

bread.fil.ion.ucl.ac.uk

SPM repository

your SPM working copySPM

SPMSPMSPM

Page 11: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

11

TortoiseSVNTortoiseSVN

http://tortoisesvn.sourceforge.net/

TortoiseSVN is a free open-source client for the Subversion version control system.

Extension for the Windows Explorer.

Icons overlay shows all versioned / modified files.

All Subversion commands available from the explorer context menu.

available via a simple right click.

TortoiseSVN requires the administrative rights on your computer to be installed.

TortoiseSVN is a free open-source client for the Subversion version control system.

Extension for the Windows Explorer.

Icons overlay shows all versioned / modified files.

All Subversion commands available from the explorer context menu.

available via a simple right click.

TortoiseSVN requires the administrative rights on your computer to be installed.

Page 12: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

12

TortoiseSVN: CheckoutTortoiseSVN: Checkout

URL of the repository: svn://bread.fil.ion.ucl.ac.uk/spm/trunk/

Right click in the Windows Explorer

Page 13: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

13

TortoiseSVN: UpdateTortoiseSVN: Update

Case 1: your SPM files needed to be updated.

Case 2: your SPM files are up-to-date.

Page 14: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

14

TortoiseSVN: DiffTortoiseSVN: Diff

If you modify a file:

Page 15: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

15

SPM Update Toolbox (1)SPM Update Toolbox (1)

http://www.fil.ion.ucl.ac.uk/spm/local/update/

An all-in-one Matlab toolbox including standalone Subversion binaries for several platforms: Windows XP Linux (32-bit) Solaris

It does not require the administrative rights on your computer to be installed.

The graphical user interface provides only the Subversion commands you need as a non-developer (update, no commit).

All your operations are logged in a text file so that you can track the exact date of each time you updated your SPM files.

Page 16: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

16

SPM Update Toolbox (2)SPM Update Toolbox (2)

Download the toolbox from: http://www.fil.ion.ucl.ac.uk/spm/local/update/

Unpack the .zip archive using any data compression software

In Matlab, modify the path to include this new directory or move into it.

Type SPM_update at the prompt and return.

Create a new folder for it!

Page 17: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

17

SPM Update Toolbox (3)SPM Update Toolbox (3)

Case 1: Your version is up-to-date.

Page 18: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

18

SPM Update Toolbox (4)SPM Update Toolbox (4)Case 2: Your version is not up-to-date or you modified some files.

Page 19: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

19

Matlab PathMatlab Path

Add Folder (and not with Subfolders)

Remove older SPM versions from the path

Page 20: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

20

SPM Matlab FilesSPM Matlab Filesfunction [C,h,Ph,F] = spm_reml(YY,X,Q,N,OPT)

% ReML estimation of covariance components from y*y'

% FORMAT [C,h,Ph,F] = spm_reml(YY,X,Q,N,[OPT]);

%

% YY - (m x m) sample covariance matrix Y*Y' {Y = (m x n) data matrix}

% X - (m x p) design matrix

% Q - {1 x q} covariance components

% N - number of samples

%

% OPT = 1 : log-normal hyper-parameterisation

%

% C - (m x m) estimated errors = h(1)*Q{1} + h(2)*Q{2} + ...

% h - (q x 1) ReML hyperparameters h

% Ph - (q x q) conditional precision of h [or log(h), if OPT(1)]

%

% F - [-ve] free energy F = log evidence = p(Y|X,Q) = ReML objective

%

% Performs a Fisher-Scoring ascent on F to find ReML variance parameter

% estimates.

%__________________________________________________________________________

% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

% John Ashburner & Karl Friston

% $Id: spm_reml.m 249 2005-10-05 17:58:37Z karl $

function [C,h,Ph,F] = spm_reml(YY,X,Q,N,OPT)

% ReML estimation of covariance components from y*y'

% FORMAT [C,h,Ph,F] = spm_reml(YY,X,Q,N,[OPT]);

%

% YY - (m x m) sample covariance matrix Y*Y' {Y = (m x n) data matrix}

% X - (m x p) design matrix

% Q - {1 x q} covariance components

% N - number of samples

%

% OPT = 1 : log-normal hyper-parameterisation

%

% C - (m x m) estimated errors = h(1)*Q{1} + h(2)*Q{2} + ...

% h - (q x 1) ReML hyperparameters h

% Ph - (q x q) conditional precision of h [or log(h), if OPT(1)]

%

% F - [-ve] free energy F = log evidence = p(Y|X,Q) = ReML objective

%

% Performs a Fisher-Scoring ascent on F to find ReML variance parameter

% estimates.

%__________________________________________________________________________

% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

% John Ashburner & Karl Friston

% $Id: spm_reml.m 249 2005-10-05 17:58:37Z karl $

Syntax DefinitionSyntax Definition

H1 LineH1 Line

HelpHelp

Maintainer(s)Maintainer(s)

SVN PropertiesSVN Properties

>> help spm_reml

>> lookfor reml

Page 21: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

21

SVN Revision NumbersSVN Revision Numbers Each revision number ($Rev$) corresponds to a “snapshot” of the repository:

Rev. 136 SPM5bRev. 252 HEAD (current version)Rev. xxx SPM5

Differences between the several ways to get SPM:

136: SPM5b xxx: SPM5252: HEAD

Download webGet from network

Subversion:TortoiseSVNSPM Update Tbx

Page 22: SPM5 is all around! SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience

22

SPM5 ready to useSPM5 ready to use

SPM5 is available…

SPM5 is stable…

SPM5 is fully functional…