Advanced Event-related fMRI Example Data Set
	  ============================================

	Repetition priming for famous and nonfamous faces

					Created		R. Henson 8/7/00
							WDCN & ICN, UCL
							r.henson@ucl.ac.uk
								
One subject's data from Henson et al. (in prep) - FOR TEACHING PURPOSES ONLY
(to illustrate facilities of SPM99) - PLEASE DO NOT CITE WITHOUT PERMISSION


Experiment
----------

2x2 factorial event-related fMRI

One session (one subject)

(Famous vs. Nonfamous) x (1st vs 2nd presentation) of faces against
baseline of chequerboard

2 presentations of 26 Famous and 26 Nonfamous Greyscale photographs, 
for 0.5s, randomly intermixed, for fame judgment task (one of two 
right finger key presses).

Parameteric factor "lag" = number of faces intervening between
repetition of a specific face + 1

Minimal SOA=4.5s, with probability 2/3 (ie 1/3 null events)

Continuous EPI (TE=40ms,TR=2s) 24 descending slices (64x64 3x3mm2), 
3mm thick, 1.5mm gap


Following images are in the Data directory...

sM03953_0005_*.{img,hdr} in RawEPI
----------------------------------
351 Analyze format functional images (*img contain data, *hdr is Analyze header)
64x64x24 3mmx3mmx4.5mm voxels

< View images with <DISPLAY> button on main SPM window - Note orbitofrontal 
  and inferior temporal drop-out and ghosting (Effects:brighten if necessary) >


rsM03953_0005_*.{img,hdr,mat} in Realigned_r
--------------------------------------------
Coregister all images to first, and then reslice using sinc 
interpolation (*mat files contain orientation information)

Type:
	Press <REALIGN> in the upper left SPM window
	'Number of subjects' - 1
	'Num Sessions for subject 1' - 1
	Select all sM03953_0005_*.{img} and press 'Done'
	Pull down menu - select 'Coregister and Reslice'
	Pull down menu - select 'Sinc Interpolation'
	Pull down menu - select 'Create All Images + Mean image'
	'Adjust sampling errors' - no

Output: 
	r* 		resliced files
	meanr* 		mean of resliced files (for normalisation)
	realignment_params_sM03953_0005_0006.txt	
			movement parameters (6x351 values)
	spm99.ps (ps file renamed to spm_realign.ps)
			graphical output of translations and rotations

<In spm_realign.ps, note movement and rotation in three directions>


arsM03953_0005_* .{img,hdr,mat} in Interpolated_ar
--------------------------------------------------
351 functional images temporally realigned to middle slice 12 (of 24) 
using sinc interpolation (top slice = 24 = acquired first)

Type:
	Press <SLICE TIMING> in the upper middle SPM window
	Select all rsM03953_0005_*.img and press 'Done'
	Pull down menu - select 'Descending (first slice = top)'
	Prompt - Reference Slice - enter '12' (default)
	Prompt - Interscan interval (TR) - enter '2.0'
	Prompt - Acquisition time (TA) - enter '2.0' (default)


Output: 
	ar* files		interpolated realigned images

< Can use <ImCalc> to create difference image between arsM03953_0005_0200.img
and rsM03953_0005_0200.img to see effect of interpolation about middle slice >


narsM03953_0005_*.{img,hdr,mat} in Normalised_nar
-------------------------------------------------
Normalised interpolated realigned functional images
The normalisation parameters are generated from the mean realigned 
image, normalised to the EPI template using affine and nonlinear warps

Optional: To save filespace, can change default voxel size to 3x3x3,
rather than interpolating to 2x2x2:

	Press <DEFAULTS> in SPM main window
	Pull down menu - 'Spatial Normalization'
	Pull down menu - 'Defaults for - writing normalized'
	Pull down menu: Bounding box - 'Default'
	Pull down menu: Voxel sizes - '3 3 3'

Type:
	Press <NORMALISE> near upper, middle SPM window
	Pull down menu - 'Determine Parameters and Write Normalised'
	Number of subjects - 1
	'Image to determine parameters' - meanrsM03953_0005_0006.img
						 (in Realigned_r dir)
	'Images to write Normalised' - meanrsM03953_0005_0006.img 
						 (in Realigned_r dir)
						 AND
				       all arsM03953_0005_0006.img
						 (in Interpolated_ar dir)
	'Template image' - EPI.img
	Pull down menu - 'Bilinear interpolation'

Output: 
	nar* files	normalised, interpolated, realigned functionals
	nmeanarsM03953_0005_0006.img
			normalised mean realigned functional
	meansM03953_0005_0006_sn3d.mat	
			normalisation parameters 
	spm99.ps (ps file renamed to spm_norm.ps)
			graphical output of normalisation process

< View normalised images with <DISPLAY> button - Note interpolation 
	to new voxel sizes and image dimensions >
< View normalisation transformations in spm_norm.ps >
< Check registration with <CHECK_REG> button - select
  	nmeanarsM03953_0005_0006.img, EPI.img in SPM Templates dir and 
	single_sub_T1.img in SPM Canonical dir >


snarsM03953_0005_*.{img,hdr,mat} in Smoothed_snar
-------------------------------------------------
Smoothed normalised realigned images
Smoothed with an isotropic Gaussian kernel with FWHM = 8mm (for statistical inference using theory of Gaussian fields)

Type:
	Press <SMOOTH> in upper right SPM window
	Prompt - smoothing FWHM - enter '8'
	Select all narsM03953_0005_*.img and press 'Done'

Output: 
snar* 	Smoothed normalised images


OPTIONAL step: normalising structural image
-------------------------------------------
Coregister mean EPI and structural T1 images

Type:
	Press <COREGISTER> in upper right SPM window
	Prompt - No. subjects enter - '1'
	Pull down menu - 'Coregister only'
	Pull down menu: Modality of target image - 'EPI'
	Pull down menu: Modality of object image - 'T1'
	Select target image - 'meanrsM03953_0005_0006.img'
	Select object image - 'sM03953_0007.img'
	Select other images - <select nothing - press done>
	
< Can check coregistration by pressing <CHECK REG> in bottom of SPM
	window and selecting sM*img and meanrs*img - Note warping of
	structural in z-direction near top of brain due to EPI distortion >

Output: (changes *mat orientation file for structural image)

Normalising structural T1 image with deformation parameters from EPIs.
	Press <NORMALIZE> in upper right SPM window
	Pull down menu - 'Write normalised only'
	Select parameters file - 'meanrsM03953_0005_0006_sn3d.mat'
	Select images to write normalized - 'sM03953_0007.img'

Output: nsM03953_0007.img 



Following Stats models are in the Stats directory...

CatStats - Categorical Factorial Analysis
-----------------------------------------

IMPORTANT:
Because interpolated data to middle slice, need to synchronise
the model with the middle slice (rather than the default top slice).

	Press <DEFAULTS> in SPM main window
	Pull down menu - 'Statistics - FMRI'
	Upper tail F prob. threshold - enter default (or enter '0.01')
	Number of Bins/TR - enter 24
	Sampled bin - change default to '12' (corresponds to middle slice)

NB: If change default F-threshold for storing data to 0.01 in 
Defaults menu, more likely to save raw data for some voxels activated 
(but bigger data file produced).

Trials have been conditionalised on whether subject's fame judgment was correct (rare, incorrect judgments modelled separately, but not of interest)

6 trial types:

 	N1 - First presentation of Nonfamous face
	N2 - Second presentation of Nonfamous face
 	F1 - First presentation of Famous face
	F2 - Second presentation of Famous face

	NE - Errors on nonfamous faces
	FE - Errors on famous faces

Change to Stats directory, and type in Matlab5 window:

	'load sots'

	=>	1 Matlab cell array variable 'sots'

	sots - Stimulus Onset Times (in TRs) for each trial type,
	      ordered N1,N2,F1,F2,NE,FE

< Note 6 errors on nonfamous faces and 2 on famous faces >

Type in Matlab5 window:

	'sots{1}'

	Stimulus Onset Times (in TRs) for N1

Type in Matlab5 window:

	'load movepars'

	=>	1 Matlab matrix 'movepars'

contains a 351x6 matrix of 3 translations and 3 rotations which will be included 
in model as confounds (to remove movement artifacts)

Type:
	Press <fMRI Models>
	Pull down menu - 'Specify a model'
	Prompt - Interscan interval (TR) - enter '2'
	Prompt - Scans per session - enter '351'
	Prompt - Number of conditions or trials - enter '6'
	Prompt - Condition or trial name 1 - enter 'N1'
	Prompt - Condition or trial name 2 - enter 'N2'
	Prompt - Condition or trial name 3 - enter 'F1'
	Prompt - Condition or trial name 4 - enter 'F2'
	Prompt - Condition or trial name 5 - enter 'NE' 	
	Prompt - Condition or trial name 6 - enter 'FE'
	Option - Stochastic design - press 'no'
	Option - SOA - press 'Variable'
	Prompt - vector of onsets (scans) for N1 - enter 'sots'
		[will enter onsets for all six trial types]
	Option - parametric modulation - press 'none'
	Option - are these trials - press 'events'
	Pull down menu - Select basis set - 'hrf (with time derivative)'
	Option - interactions among trials (Volterra) - 'no'
	Prompt - user specified regressors - enter '6'
	Prompt - [351] regressor1 - enter 'movepars'
		[will enter values for all 6 dimensions simultaneously]
	Prompt - name of regressor 1 - press 'return' for default (doesn't matter)
		[repeat for next five regressors]

Type:
	Press <fMRI Models>
	Pull down menu - 'Review a model'
	Select 'fMRIDesMtx.mat' and press 'Done'
	Open Graphics window
	Select 'explore fMRI design' in UI Window and select trial-type wish
	to view

Design matrix has 351 rows (scans) and (2x6)+6+1 columns (covariates)
	Columns are organised:
		N1 - canonical HRF (basis function 1)
		N1 - temporal derivative (basis function 2)
		N2 - canonical HRF (basis function 1)	
		...
		movement confound1 (user-specified) regressor
		...
		mean (session) effect

< Note 2nd presentations necessarily later in time on average than 1st >

Type:
	Press <fMRI Models>
	Pull down menu - 'Estimate a specified model'
	Select 'fMRIDesMtx.mat' and press 'Done'
	Select all 351 'snarsM03952_0005_*.img' files and press 'Done'
	Option - remove Global effects - press 'none'
	Option - High-pass filter - press 'Specify'
	Prompt - session cutoff period (secs) - enter '120' (2 mins)
	Option - Low-pass filter - press 'Gaussian'
	Prompt - Gaussian FWHM in seconds - enter '4' (default)
	Option - Model intrinsic correlations - 'none'
	Option - Setup trial-specific F-contrasts - 'yes'
	Option - Estimate - press 'now'
	<pause while parameters estimated>


	Main Effect of Faces minus Baseline (t-contrast on canonical activations)
	-------------------------------------------------------------------------

Type:
	Press <Results>
	Select 'SPM.mat' file
	Press 'Define new contrast'
	Enter - contrast =	'1 0 1 0 1 0 1 0' [remaining 0's autofilled]
		contrast name =	'Canonical HRF: Faces > Baseline'
	        press 'done'
	Select 'Canonical HRF: Faces > Baseline' (default)
	press 'done'
	Option - mask with other contrast(s) - press 'no'
	Prompt - title for contrast - enter default
	Option - corrected height threshold - press 'yes'
	Prompt - threshold {p value} - enter '0.05' (default)
	Prompt - & extent threshold {voxels} - enter '0' (default)
	
< In Graphics window, notice bilateral temporoccipital, left
motor and right frontal activations >

Type:
	press 'volume'
	<describe list of p-values and coordinates>

	left mouse on cursor on coordinates at top of table
	<red cursor on MIP moves to left fusiform region>
	press 'cluster'
	<note coordinates should be -39 -60 -24>

	press overlays - sections
	select in 'nsM03953_0007.img' in Structural directory 
	(or 'nmeanrsM03953_0005_0006.img' in Normalised_nar directory)
	<latter is more valid, since contains same EPI artifacts as data,
	but less easier to visualise anatomically>

	press overlays - render
	select 'render_no_cereb.mat' in Structural directory 
	< a canonical rendered image with cerebellum artificially removed >
	option - style - press 'old'

	press 'plot'
	Pull down menu - 'Event/epoch-related responses'
	Prompt - which trials - enter '1'
	Pull down menu - 'fitted response and adjusted data'

	press 'plot'
	Pull down menu - 'Event/epoch-related responses'
	Prompt - which trials - enter '1'
	Pull down menu - 'fitted response and PSTH'


	All Effects of Interest (reduced model removing all confounds)
	--------------------------------------------------------------

Type:
	Press <Results>
	Select 'SPM.mat' file
	Click on F-contrasts
	Press 'Define new contrast'
	Enter - contrast '9:19' in columns for reduced design
		  [treats columns 9-19 as confounds, leaving 1-8]
		  contrast name = 'Effects of Real Interest'	        
	press 'done'
	Select 'Effects of Real Interest'
	press 'done'
	Option - mask with other contrast(s) - press 'no'
	Prompt - title for contrast - enter default
	Option - corrected height threshold - press 'yes'
	Prompt - threshold {p value} - enter '0.05' (default)

	Click on red MIP cursor and drag near to anterior right fusiform blob
	Right click and select 'goto nearest local maxima'
	(or press 'Cluster' and select 2nd to top value in table)
	<note coordinates should be 45 -48 -27 - right fusiform face area>

	press 'plot'
	Pull down menu - 'Contrast of parameter estimates'
	Prompt - which contrast - enter 'Effects of real interest'
	<columns 1,3,5,7 are canonical HRF for N1,N2,F1,F2 - note
	suppression effect from F1 to F2 greater than from N1 to N2>
	<columns 2,4,6,8 are temporal derivative - note fact that
	derivatives close to zero suggests model timing is okay>

	press 'plot'
	Pull down menu - 'Fitted and adjusted responses'
	Pull down menu - which contrast - 'Effects of Real Interest'
	Pull down menu - plot against - 'Scan or time'
	< model in red and data in blue across whole timeseries >
	< can change attrib:XLim to [0 100] to see more clearly >

	Effects of Fame (F-contrast for two-tailed tests on canonical)
	--------------------------------------------------------------

Type:
	Press <Results>
	Select 'SPM.mat' file
	Click on F-contrasts
	Press 'Define new contrast'
	Enter - contrast  type '-1 0 -1 0 1 0 1'
		  contrast name = 'Canonical HRF: F vs N'
	        press 'done'
	Select 'Canonical HRF: F vs N'
	press 'done'
	Option - mask with other contrast(s) - press 'yes'
	Select - 'Canonical HRF: Faces > Baseline'
	Prompt - uncorrected mask p-value - enter '0.05'
	Option - nature of mask - 'inclusive'
	Prompt - title for contrast - enter default
	Option - corrected height threshold - press 'no'
	Prompt - threshold {p value} - enter '0.001' (default)

	<Note left mid-temporal, temporal pole and inferior frontal regions>

press 'volume'
	left mouse on cursor on coordinates at top of table
	<red cursor on MIP moves to left temporal region -57 -36 12>

press 'plot'
	Pull down menu - 'Contrast of parameter estimates'
	Prompt - which contrast - enter 'Effects of real interest'
	< Note columns 5 and 7 (canonical HRF for F1 and F2) positive (face naming)
	but columns 1 and 3 (canonical HRF for N1 and N2) close to zero >


	Effects of Repetition (F-contrast on canonical and derivative)
	--------------------------------------------------------------

Type:
	Press <Results>
	Select 'SPM.mat' file
	Click on F-contrasts
	Press 'Define new contrast'
	Enter - contrast  type '1 0 -1 0 1 0 -1 0
				0 1 0 -1 0 1 0 -1'
		  contrast name = 'Canonical + Derivative: 1 vs 2'
	        press 'done'
	Select 'Canonical + Derivative: 1 vs 2'
	press 'done'
	Option - mask with other contrast(s) - press 'yes'
	Select - 'Canonical HRF: Faces > Baseline'
	Prompt - uncorrected mask p-value - enter '0.05'
	Option - nature of mask - 'inclusive'
	Prompt - title for contrast - enter default
	Option - corrected height threshold - press 'no'
	Prompt - threshold {p value} - enter '0.001' (default)

	<note combined probability of ~.0005 given orthogonal contrasts>

press 'volume'
	left mouse on cursor on coordinates third from top of table
	<red cursor on MIP moves to right fusiform region 45 -60 -15>

press 'plot'
	Pull down menu - 'Event/epoch-related responses'
	Prompt - which trials - enter '1:4'
	Pull down menu - 'fitted response'
	Select 'Xlim' from pulldown menu 'attrib' on UI window
	Enter 0 10
	<note repetition suppression effect for famous and nonfamous faces
	(for differences with Henson et al 2000, see Henson et al, in prep)>


< Other interesting contrasts:
 	a) F-contrast on movement parameters - big edge effects (but not in fusiform)!
 	b) Trial-specific F-contrasts for N1 and for F1 - note more left
 	temporofrontal for F1
 	c) Derivative only >


ParStats - Parametric Differential Analysis
-------------------------------------------

This is an alternative statistical model to the CatStats one above,
that also caters for effects of repetition lag. Because the models are 
correlated, the main results are similar. (Note that it is not exactly 
the same as the lag analysis in the Henson et al. 2000, for which lag 
effects were modelled for second presentations only).

4 trial types:

 	N     - Presentation of Nonfamous face (N1 and N2 collapsed)
	F     - Presentation of Famous face (F1 and F2 collapsed)
	NE	- Nonfamous errors (as below)
	FE	- Famous errors (as below)

2 parametric modulations
	Nxlag - Parametric modulation of second presentation of Nonfamous face	
	Fxlag - Parametric modulation of second presentation of Famous face

In Stats directory, type in Matlab5 window:

	'load lags' 

	=>	3 Matlab cell array variables: 'lsots' and 'ilags' and 'tlags'

	lsots - Stimulus Onset Times (in TRs) for trial types ordered N,F,NE,FE
	ilags - Number of intervening faces (for N1 and F1, lag = Inf)
	tlags - Time intervening (in units of SOAmin; for N1 and F1, lag = Inf)

	< tlags and ilags highly correlated; ilags used in example below >

	'load movepars'
	< to load movement parameter confounds as before >

Type in Matlab5 window:

	'ilags{1}'

	=> 	Item Lags for Nonfamous Faces

Type:
	Press <fMRI Models>
	Pull down menu - 'Specify a model'
	Prompt - Interscan interval (TR) - enter '2'
	Prompt - Scans per session - enter '351'
	Prompt - Number of conditions or trials - enter '4'
	Prompt - Condition or trial name 1 - enter 'N'
	Prompt - Condition or trial name 2 - enter 'F'
	Prompt - Condition or trial name 3 - enter 'NE'
	Prompt - Condition or trial name 4 - enter 'FE'
	Option - Stochastic design - press 'no'
	Option - SOA - press 'Variable'
	Prompt - vector of onsets (scans) for N1 - enter 'lsots'
		[will enter onsets for all three trial types]
	Option - parametric modulation - press 'other'
	Prompt - name of parameter - 'lag'
	Option - expansion - 'exponential'
	Prompt - decay constant - '50'    [= exp(-lag/50)]
	Prompt - which trials - enter '1 2'
	Option - parameters for N - enter 'ilags{1}'
	Option - parameters for F - enter 'ilags{2}'
	Option - are these trials - press 'events'
	Pull down menu - Select basis set - 'hrf (alone)'
	Option - interactions among trials (Volterra) - 'no'
	Prompt - user specified regressors - enter '0'

Type:
	Press <fMRI Models>
	Pull down menu - 'Review a model'
	Select 'fMRIDesMtx.mat' and press 'Done'
	Open Graphics window
	Select 'explore fMRI design' in UI Window and select trial-type wish
	to view: note trials ordered: N,Nxlag,F,Fxlag,NE,FE

Type:
	Press <fMRI Models>
	Pull down menu - 'Estimate a model'
	Select 'fMRIDesMtx.mat' and press 'Done'
	Select all 351 'snarsM03952_0005_*.img' files and press 'Done'
	Option - remove Global effects - press 'None'
	Option - High-pass filter - press 'Specify'
	Prompt - session cutoff period (secs) - enter '120'
	Option - Low-pass filter - press 'Gaussian'
	Prompt - Gaussian FWHM in seconds - enter '4' (default)
	Option - Model intrinsic correlations - 'none'
	Option - Setup trial-specific F-contrasts - 'yes'
	Option - Estimate - press 'now'
	<view design in Graphics window>
	<pause while parameters estimated>

Type:
	Press <Results>
	Select 'SPM.mat' file
	Click on F-contrasts
	Press 'Define new contrast'
	Select 'F-contrast'
	Enter - contrast      = '0 1 0 1'
		  contrast name = 'Effect of Lag (on canonical N+F)'
	        press 'done'
	Press 'Define new contrast'
	Select 't-contrast'
	Enter - contrast      =	'1 0 1 0'
		  contrast name =	'Canonical: Faces > Baseline'
		press 'done'	
	Select 'Effect of Lag (on canonical N+F)'
	press 'done'
	Option - mask with other contrast(s) - press 'yes'
	Select - 'Canonical: Faces > Baseline'
	Prompt - uncorrected mask p-value - enter '0.05'
	Option - nature of mask - 'inclusive'
	Prompt - title for contrast - enter default
	Option - corrected height threshold - press 'no'
	Prompt - threshold {p value} - enter '0.001' (default)


Type:
	move cursor to largest right fusiform region
	press 'cluster'
	<select 45 -60 -18 - note coordinates close to CatStats repetition effect>
	press 'plot'
	Pull down menu - 'Plots of parametric responses'
	Pull down menu - 'F' (or 'N')
	<to see more clearly, type: figure(1), axis([0 30 0 100 0 1]) in Matlab window>
	<response modulated by lag - ie repetition effects transient - note
	that to show this properly, need to model lag for 2nd presentations only -
	present demonstration is simply to show equivalent model>