This web-page contains excerpts from the SPM user-group's burster. SPM users around the globe run into the same problems as you do- here are there questions, with answers from the experts! You can search the SPM burster archives (at the official SPM website) for a particular keyword, or peruse this web-page, which has the same items, only organized topically. You will find that this web-page adheres to the Socratic method, but you don't have to do all that walking to and fro. There are several general categories:
Click on an item in the outline below to go to a particular topic, or just dig in and start reading! (Items without hyperlinks in the outline are still pending...) Note that most of the topics (but not the individual discussions) are repeated in the several major categories, so if you want to find out about e.g. Contrasts, you can look in the "Menu Items" for how to enter a contrast, in "Analysis Items" for what contrast may be appropriate to a particular study, and in "Concepts" for a more detailed look at how contrasts work under the hood.
Many of the answers/responses have been edited slightly for brevity's sake. If you feel there was too much editing, you can easily search the archive and obtain the full text, since the responder and date are included after most of the entries.
Return to LfAN SPM resources page.
II. Model Items (Creating a design matrix)
fMRI design with >16 sessions: picking scans
> We are attempting an fmri analysis, using a design matrix with 16
> sessions. When we run the estimation model, instead of asking us which
> scans are required for each individual session, it asks which scans are
> required for all sessions. Choosing all scans at the same time does not
> work. When we use 12 sessions or lower, we are asked which scans are
> required for each session (1 through 12), and the analysis runs
> correctly. Does anyone know why can we do this with 12 sessions and not
> 16?
This is my fault. The idea was that some designs could be viewed as a
series of short sessions (e.g. burst-mode or sparse sampling). In this
context it would be easier to select all sessions at once.
The limit is 16 sessions. To change this, say to 32, change line 236
in spm_fmri_spm_ui.m from
if nsess < 16
to
if nsess < 32
% get filenames
%---------------------------------------------------------------
nsess = length(xX.iB);
nscan = zeros(1,nsess);
for i = 1:nsess
nscan(i) = length(find(xX.X(:,xX.iB(i))));
end
P = [];
****if nsess < 16 ****
for i = 1:nsess
str = sprintf('select scans for session %0.0f',i);
if isempty(BCH)
q = spm_get(Inf,'.img',str);
else
q = sf_bch_get_q(i);
end %-
P = strvcat(P,q);
end
else
[Who/when ???}
Y is the fitted response.
y is the adjusted data (adjusted for confounds and bandpass filtering)
Raw data has to be read from the Y.mad file.
For the plot option "fitted and adjusted responses", Y and y
refer to the whole timeseries.
For the plot option "event- or epoch-related responses", Y and
y refer to peristimulus time (effectively "averaging across
trials").
The PSTH option is just a way of binning the y values into separate
peristimulus timebins, allowing calculation of mean and standard errors
within each timebin. There is no easy way of collapsing y across
trial-types (eg plotting a contrast of event-related data), other than
collapsing across trial-types in the original model (ie having one
column only).
> Ran into a problem when I tried to plot fitted and adjusted responses
> against time a couple times. Despite high significance, SPM99
> indicated that no raw data had been saved at that voxel and gave me the
> option of moving to the closest point which had data; when I chose this
> option, it went to another cluster entirely. In one case, this was for
> the local maximum of the most significant cluster (better than 0.000
> uncorrected for the voxel and for the cluster). The entire area was
> grayed in on the glass brain. The default for the statistics was set
> at 0.001 so it seemed like there should not have been a problem. Am I
> doing something wrong or is this a bug? For which voxels is SPM99
> supposed to be saving raw data for?
This apparent paradox is due to the fact that the p value for a
particular T-contrast may be more significant than the default
F-contrast used to decide whether to save data in Y.mad. All I can
suggest is that you reduce you default threshold further. Note that
you can still plot fitted responses and standard error for every voxel
(but not the actual residuals thenselves unless the data are saved in Y
.mad). To do this simply decline the option to 'jump'.
[Karl Friston 3 Jul 2000]
Plot 'contrast of parameter estimates'
Q. I have some PET data I'm trying to interpret, but I'm not sure about what is plotted in the 'contrast of parameter estimates' when they are plotted for each condition for an effect of interest in SPM99.
A. This bar-plot shows the mean-corrected parameter estimates of all
effects of interest. The red lines are the standard errors of the
parameter estimates.
Q. This plot seems to be representing the 'size' of the effect on interest at a given maxima - my question is how a negative value in this plot should be interpreted. Is it a 'deactivation'?
A. Because of the mean correction, the bar-plot shows the deviations of the parameter of interest estimates from their mean. Therefore a negative value does not necessarily mean that the parameter estimate is negative, it is just lower than the mean of the parameter of interest estimates. Note that the (non mean-corrected) parameter estimates of a given voxel are stored in the workspace variable 'beta', when you plot them. By typing beta in your matlab window, you can display them.
Q. Or, asked another way, what does the 0 effect size mean in these plots?
A. It means that this parameter estimate is equal to the mean of all
parameter of interest estimates. As a special case of only one parameter
of interest, it would mean that this parameter is zero.
I guess that the typical use of this plot is to easily assess the
relative sizes of the parameter estimates for a given voxel. You could
also use this plot to extract the vector of parameter estimates (and
other variables like the standard errors of the parameter estimates, the
fitted and the adjusted data stored in 'SE', 'Y' and 'y') from SPM99.
[Stefan Kiebel, 20 Jun 2000]
Q. Can anyone tell me what exactly is being plotted when I choose "contrast of parameter estimates" for my plot.
A. This plot shows one or more linear combinations of the parameter of interest estimates, where the linear combinations are contrasts. In the case, when you specify 'effects of interest', there is one (mean corrected) contrast for each parameter such that each grey bar shows the relative height of each estimated parameter of interest. In the case that you specify one of your own contrasts, the single bar shows the estimated parameters of interest weighted by the contrast. In both cases, the red line denotes the standard error SE of the weighted parameter estimates. The range of the red line is [-SE SE]. If you like to read some informative matlab code, the possibly most exact description can be found in spm_graph.m, lines 231 - 251.
Q. How does this relate to the fitted response?
A. Let the general linear model used in the analysis be
Y = X * \beta + \epsilon
where Y are the functional observations, X is a design matrix, \beta the parameter vector and \epsilon the error of the model. Let b be the estimated parameters. The design matrix X can be subdivided into
X = [X_1 | X_2], where X_1 denotes the covariates of interest and X_2 the covariates of no interest. Equally, b = [b_1 b_2]. Let c be the contrast(s) you choose for the plot, where c is a matrix with onecontrast per column. Then c' * b is the height of the grey bar(s) plotted. Note that c is zero for all estimated parameters of no interest b_2. The fitted (and corrected for confounds) data is then given by X_1 *b_1.
To make it complete, the adjusted data (and corrected for confounds) is given by
X_1 * b_1 + R, where R are the residuals R = Y - X*b.
In other words, the relationship between the contrast of parameter estimates and the fitted response is given by the parameter estimates. In one case you weight the parameter of interests by a contrast vector and in the other case, you project the estimated parameters (of interest) back into the time domain.
[Stefan Kiebel, 21 Jun 2000]
> I want to plot parametric responses (time x condition effects) using the
> same scaling (e.g. from -1 to 2 with 0.5 steps) on the z-axes for
> different subjects . In the interactive windows "attrib" (plot controls)
> I can change only the x-axes (Xlim, peristimulus time) and the y-axes
> (YLim, time) but not the z-axes (responses at XYZ). Has someone a
> modified matlab script (I think spm_results_ui.m and spm_graph.m) to do
> this ?
One could of course modify spm_results_ui.m, but I think the shortcut
for you is to change the ZLim (or any other property of the plot)
directly from within matlab. To make the figure the current axes, click
on your plot and then type:
set(gca, 'ZLim', [-1 2]);
and
set(gca, 'ZTick', [-1:0.5:2]);
[Stefan Kiebel 17 July 2000]
> Is there a way to use the matlab window to obtain the values used by SPM
> to generate plots (contrast of parameter estimates)? I am interested in
> obtaining the plot values and the standard deviation.
Yes, during each plot in SPM several values are stored in workspace
variables. When you plot the parameter estimates or a contrast of these,
SPM writes the variables beta (vector of parameter estimates) and SE
(standard error) to the workspace.
If you look at spm_graph.m lines 241 - 251, you can e.g. see how SPM99
generates the bar plot based on beta and SE.
[Stefan Kiebel 27 July 2000]
To customize the segmentation:
One of the steps is to explore [spm_sn3d.m] file. And then insert the
following line at the beginning of the main routine (way below where the %'d
lines end, and after the definition of global values, eg, line number 296)
in spm_sn3d.m
sptl_CO=0;
This will direct you, when you're running normalization, to choose all the
options currently available in SPM normalization. Read the descriptions in
the comment lines.
[Jae S. Lee 21 Jun 2000]
> we have constructed a design matrix with 60 sessions. When we explore the
> design we are able to view only 51 sessions.
> Is it possible to check the other 9 sessions? Which is the matlab routine
> where the max number of session are specified?
Actually, it is only partially a SPM issue. Your 60 sessions are still
there, the limitation is due to the inability of matlab5.3.1 to display
menus with more than 51 entries on your screen. To see the other
sessions as well, you could type the following in matlab after starting
spm and cd to your analysis directory:
load SPM_fMRIDesMtx.mat
spm_fMRI_design_show(xX,Sess,60,1)
This would show you trial 1 of session 60. Change the last two arguments
to see the other sessions and trials.
[Stefan Kiebel 05 Jul 2000]
> I also have a programing question. When attempting to plot "contasts of
> parameter estimates" I am not able to view or choose from all contrasts.
> I have a data set with about 50 contrasts and I am only able to choose
> from those that fit on the screen. If I type the contrast number, SPM
> only allows me to enter 1-9. Is there any way to plot the data for
> contrasts that do not fit in the window?
Yes, there is a way around... It involves some typing:
1. Change line 213 in spm_graph.m from
Ic = spm_input('Which contrast?','!+1','m',{xCon.name});
to
Ic = spm_input('Which contrast?','+1','m',{xCon.name});
2. Before plotting type in the matlab window
global CMDLINE
CMDLINE = 1
The first action makes sure that you can get into command line mode and
the second actually activates the command line mode.
[Stefen Kiebel, 14 July 2000]
> Is it possible to instruct spm99 to search all voxels within a given
> mask image rather than all above a fixed or a %mean threshold?
Yes, with SPM99 it's possible to use several masking options.
To recap, there are 3 sorts of masks used in SPM99:
1. an analysis threshold
2. implicit masking
3. explicit masking
1: One can set this threshold for each image to -Inf to switch off this
threshold.
2: If the image allows this, NaN at a voxel position masks this voxel
from the statistics,
otherwise the mask value is zero (and the user can choose, whether
implicit
masking should be used at all).
3: Use mask image file(s), where NaN (when image format allows this) or
a non-positive value
masks a voxel.
On top of this, SPM automatically removes any voxels with constant
values over time.
So what you want is an analysis, where one only applies an explicit
mask.
In SPM99 for PET, you can do this by going for the Full Monty and
choosing -Inf for the implicit mask and no 0-thresholding. Specify one
or more mask images. (You could also define a new model structure,
controlling the way SPM for PET asks questions).
With fMRI data/models, SPM99 is fully capable of doing explicit masking,
but the user interface for fMRI doesn't ask for it. One way to do this
type of masking anyway is to specify your model, choose 'estimate later'
and modify (in matlab) the resulting SPMcfg.mat file. (see spm_spm.m
lines 27 - 39 and 688 - 713). Load the SPMcfg.mat file, set the xM.TH
values all to -Inf, set xM.I to 0 (in case that you have an image format
not allowing NaN). Set xM.VM to a vector of structures, where each
structure element is the output of spm_vol. For instance:
xM.VM = spm_vol('Maskimage');
Finally, save by
save SPMcfg xM -append
> If so,
> does the program define a voxel to be used as one which has nonzero
> value in the named mask image?
Not nonzero, but any positive value and unequal NaN. Note that you can
specify more than one mask image, where the resulting mask is then the
intersection of all mask images.
[Stefan Kiebel 27 Jun 2000]
> Do I have to mask this contrast by another contrast (e.g. main effect)
> and how can I specify the masking contrast?
You do not have to but if you wanted t; use a 2nd-level model with
(Ae-Ce) in one column and (Be-Ce) in another (plus the constant term).
Then mask [1 -1 0] with [1 1 1]. The latter is the main effect of
Factor 1.
[Karl Friston 18 July 2000]
[also see "Model Items: 3-factor design"]
For those of you wanting to specify explicit masking at the SPM (PET/SPECT)
model setup stage, here's a recipe to do it without having to resort to the
"Full Monty" design: Start SPM99 and paste the following into the MatLab
command window:
----------------
%-Choose design class
D = spm_spm_ui(char(spm_input('Select design
class...','+1','m',...% {'Basic stats','Standard PET designs','SPM96 PET
designs'},...% {'DesDefs_Stats','DesDefs_PET','DesDefs_PET96'},2)));
%-Choose design from previously specified class
D = D(spm_input('Select design type...','+1','m',{D.DesName}'))
%-Turn on explicit masking option
D.M_.X = Inf
%-Pass this design definition to SPM (PET/SPECT)
spm_spm_ui('cfg',D)
----------------
[Andrew Holmes 20 July 2000]
> It appears masking is a binary operation-- does this mean the mask
> specified must be in a bitmapped {0,1} format, or just that it is treated
> that way?
The latter. The mask can have any numbers. If the mask image format
(e.g. 'float') supports NaN, NaN is the masking value, otherwise it is
0.
[Stefan Kiebel 21 July 2000]
> With respect to estimating a model. I would like to potentially do an
> apriori mask of my collected brain. I could go in and just change all
> of my img files and mask explicity each one (ie zero out the
> non-interesting portions), however, any hints on where in the
> estimation code I would insert a masking to zero out the portions of
> the brain that I am not interested in estimating. That is, if we could
> we would have acquired a smaller region of volume during the scanning,
> but I can affect this by just masking my data before estimation.
Absolutely, if you want to assess the number of voxels above a given
threshold, you can count these in the t-images. With respect to your
question about the masking to effectively constrain the analysis to a
ROI, you could look at
http://www.mailbase.ac.uk/lists/spm/2000-06/0196.html
http://www.mailbase.ac.uk/lists/spm/2000-07/0205.html
which might provide a solution, how to implement your explicit masking
easily (without changing each image, but just constraining the analysis
to a subset of voxels).
If you do an explicit masking, a script to counting voxels above
threshold in a ROI wouldn't be necessary, because then you could use the
cluster sizes as computed by SPM. You could also try to use a mask-image
to apply the SVC.
Mask part of the brain
> for the analysis of SPECT perfusion data, I would like to "crop" my images
> prior to statistical analysis
> - that is, remove non-brain counts [scalp, sinuses, muscles]
>
> from reading about "Mask object" in spm_sn3d, I gather spm will not do this
> during this step. True?
>
> if not, is there a function available to do so?
Yes, there is a function to do exactly what you want. During the
statistical analysis set-up, you can specify an explicit masking. To get
to this and related masking options, you have to choose Full Monty as
your design option. Then you can specify a mask-image, which could be in
your case e.g. a normalized cropped image, where NaN (or 0) would mean
to exclude this voxel from the analysis. You find a more detailed
documentation about this type of masking in the SPM-help for PET-models.
[Stefan Kiebel 19 Jul 2000]
Conjunctions are specified by holding down the'control' key during
contrast selection.
Get pixel coordinates for all voxels within an activated cluster
One easy way would be to position the cursor on the cluster you're
interested in (after displaying the results using the 'results' button),
and paste the following lines from spm_list.m at the matlab prompt:
[xyzmm,i] = spm_XYZreg('NearestXYZ',...
spm_results_ui('GetCoords'),SPM.XYZmm);
spm_results_ui('SetCoords',SPM.XYZmm(:,i));
A = spm_clusters(SPM.XYZ);
j = find(A == A(i));
XYZ = SPM.XYZ(:,j);
XYZmm = SPM.XYZmm(:,j);
The last two variables - XYZ and XYZmm - would contain the pixel and the
mm coordinates of all voxels in the current cluster. (Check the cursor to
see where it is after pasting the above, it may jump a bit, moving to
nearest suprathreshold voxel.)
[Kalina Christoff 25 Jun 2000]
You could also use spm_regions in 'results' (VOI)
>> help spm_regions
VOI time-series extraction of adjusted data (local eigenimage analysis)
FORMAT [Y xY] = spm_regions(SPM,VOL,xX,xCon,xSDM,hReg);
SPM - structure containing SPM, distribution & filtering detals
VOL - structure containing details of volume analysed
xX - Design Matrix structure
xSDM - structure containing contents of SPM.mat file
xCon - Contrast definitions structure (see spm_FcUtil.m for details)
hReg - Handle of results section XYZ registry (see spm_results_ui.m)
Y - first eigenvariate of VOI
xY - structure with:
xY.name - name of VOI
xY.y - voxel-wise data (filtered and adjusted)
xY.u - first eigenvariate
xY.v - first eigenimage
xY.s - eigenimages
*** xY.XYZmm - Co-ordinates of voxels used within VOI ***
xY.xyz - centre of VOI (mm)
xY.radius - radius of VOI (mm)
xY.dstr - description of filtering & adjustment applied
Y and xY are also saved in VOI_*.mat in the SPM working directory
[Karl Friston 26 Jun 2000]
See mean global estimates for individual raw scans.
>> load SPMcfg.mat
>> plot(xGX.rg)
Change the threshold for global normalization.
If you want to try different thresholds, then you need to modify line 57 of spm_global.c, and then recompile. The modification would involve something like changing from:
s1/=(8.0*m);
to:
s1/=(4.0*m);
| 1) This may be a really idiotic question, but how does one view the
| uncorrected t-statistic images? I'm assuming that viewing the t-statistic
| images for a given contrast using the default values: "corrected height
| threshold = no", "threshold {T or p value} = 0.001", and "extent threshold
| {voxels} = 0" still applies a correction that is based on the the
| smoothness estimates and consequently the number of resels.
This displays the raw uncorrected t statistics that are more significant
than p<0.001. There is no correction for the number of resels when you
dont specify a corrected height threshold.
Another way of displaying the statistic images is to use <Display> or
<Check reg>.
[John Ashburner 21 Jun 2000]
> I'm performing a manual rotation and I don't know how to save the
> rotated image.
Use the display button. Your image will come up in the graphics window.
Use the gray boxes to the left and below the image to alter the
orientation, then, when you are happy with the result, press the
reorient images button in the same window. spmget will launch. Select
the images you want to be rotated (the image you have been working on
+/- any others), and the changes to the orientation will be written out
in a *mat file.
[Alex Leff 19 July 2000]
A right click in the background of an SPM results table brings up a context
menu including options to "Print Text Table" and "Extract Table Data
Structure". The first prints the table as plain text in the Matlab command
window, the second returns the table data structure to the base matlab
workspace (as 'ans'). See the help for spm_list.m for further details (also
available from the table context menu as "help").
| I'd like to create, for each individual subject, a subtraction image that
| reflects %change in normalized rCBF. Thus, instead of t-values, the pixel
| values of this image would be numbers reflecting change above or below
| average whole brain. In my particular case, I have two baselines and two
| activations, so I'd like to create the percent change subtraction image of:
| (i1+i3)/2 - (i2+i4)/2.
|
| Is there a way to easily accomplish this in SPM? As far as I can tell,
| proportional scaling only comes as part of a process that produces a
| statistical parametric map image, and I don't see anything in the image
| calculator that would enable me to perform this step separately (i.e., take
| an image, normalize each pixel by whole brain average, and then do the
| subtractions).
In Matlab, you can obtain the "globals" for each image by:
V = spm_vol(spm_get(4,'*.img'));
gl1 = spm_global(V(1))
gl2 = spm_global(V(2))
gl3 = spm_global(V(3))
gl4 = spm_global(V(4))
Then these can be plugged into the ImCalc expression by:
(i1/gl1+i3/gl3)/2 - (i2/gl2+i4/gl4)/2
I think you actually need to enter the values of the globals rather than
the variable names.
[John Ashburner 11 Aug 2000]
If you have problems with SPM halting, and perhaps with your Matlab
session also quitting, type the following before entering Matlab:
unlimit stacksize
N.B. this only works on a Unix machine.
1 subject compared to controls
| 1. How can SPM best be used to compare a single subject to a group of
| controls in order to establish the pattern of regional abnormalities? I
| have tried using the two sample t-test, two groups, one scan per subject
| model, with success, but was wondering if anyone had ideas about other
| approaches using the software.
This is probably the best approach, but it may be worth also modelling
confounding effects such as age or possibly nonlinear age effects
(by also including age^2 and age^3).
Depending how many controls you have, you may also wish to try a
non-parametric analysis using SNPM.
[John Ashburner 13 July 2000]
> number of conditions or trials : 1
> (is this correct? Should I enter "2"?)
Yes. With one condition alternating with rest it is appropriate to model the
rest implicitly by specifying just the active condition onsets. To use 2
conditions would not be wrong, but is redundant.
> Results button
> -> I set default value for mask, threshold and so on.
> I set t-contrast "1 -1" or "-1 1", is it correct?
> I want to z-score, which is (mean(rest)-mean(activation))/SE,
> but the different options give different z-scores.
This is what you are doing wrong I think. You specified one condition so
have two columns in the resulting design matrix. One represents the boxcar
(activation vs rest), the other is a constant term modeling the mean
activity over all conditions. Your t-contrasts are comparing these two
regressors, which will give weird results.
What you should do is use contrasts [1] or [-1] to see areas where
activation>rest, or rest>activation respectively. If you had used two
regressors to model activation and rest separately then the corresponding
contrasts would be [1 -1] and [-1 1].
[Geraint Rees 25 July 2000]
1 group, 2 conditions, 1 covariate
PET/SPECT models: Multi-subject, conditions and covariates
| I'm trying to do simple correlations with SPM99..will someone please
| help me, this should be very simple.
|
| I have 2 PET scans per subject, one at baseline and one on drug. I
| have 2 clinical rating scores, one at baseline and one after drug.
| I want to look at increases in GMR after drug correlated with
| increases in the clinical rating. I also want to look at negative
| correlations. What model should I use and how do I define the
| contrasts??
PET/SPECT models: Multi-subject, conditions and covariates. For each
subject, enter the two scans as baseline and then drug. One covariate,
values are the clinical rating scores in the order you selected the scans,
i.e. baseline score for subject 1, drug score for subject 1, baseline score
for subject 2, drug score for subject 2, &c. No interactions for the
covariate. No covariate centering. No nuisance variables. I'd use
proportional scaling global normalisation, if any. (You could use
"straight" Ancova (with grand mean scaling by subject), but SPM99 as only
offers you AnCova by subject, which here would leave you with more
parameters than images, and a completely unestimable model).
Your model (at the voxel level) is:
[1] Y_iq = A_q + C * s_iq + B_i + error
...where:
Y_iq is the baseline (q=1) / drug (q=2) scan on subject i (i=1,...,n)
A_q is the baseline / drug effect
s_iq is the clinical rating score
C is the slope parameter for the clinical rating score
B_i is the subject effect
...so the design matrix has:
2 columns indicating baseline / drug
1 column of the covariate
n columns indicating the subject
You will have n-1 degrees of freedom.
Taking model [1] and subtracting for q=2 from q=1, you get the equivalent model:
[2] (Y_i2 - Y_i1) = D + C(s_i2-s_i1) + error
...where D = (A_2 - A_1), the difference in the baseline & drug main
effects. (Note that this only works when there are only two conditions and one scan per condition per subject!) I.e. a simple regression of the difference in voxel value baseline to drug on the difference in clinical scores, exactly what you want.
----------------
Entering [0 0 1] (or [0 0 -1] as an F-contrast will test the null
hypothesis that there is no covariate effect (after accounting for common
effects across subjects), against the alternative that there is an effect
(either positive *or* negative. I.e., the SPM{F} will pick out areas where
the difference baseline to drug is correlated with the difference in
clinical scores.
[0 0 +1] and [0 0 -1] as t-contrasts will test against one sided
alternatives, being a positive & negative correlation (respectively) of
baseline to drug scan differences with difference in clinical scores. Since
you're interested in both, you should interpret each at a halved
significance level (double the p-values). This will give you the same
inference as the SPM{F} (which is the square of the SPM{t}'s), but with the
advantage of separating +ve & -ve correlations in the glass brain for you.
----------------
Incidentally, the variance term here incorporates both within and between
subject variability, and inference extends to the (hypothetical) population
from which you (randomly!) sampled your subjects from.
[Andrew Holmes, when ???]
> Given 2 conditions, 1 scan/condition, 1 covariate obtained at each scan,
> mean-centered covariate with proportional global scaling. A condition &
> covariate design with a contrast 0 0 1 is equivalent to correlation
> between the change in covariate and the change in the scans.
Indeed or more precisely the partial correlation between the covariate
and scan-by-scan changes having accounted for the condition-specific
activations.
[Karl Friston 28 Jun 2000]
> I have a SPECT study with 34 patients and 2 conditions per patients and 1
> covariate.
> I want to find the regions where there is positive corelation between the
> rise in blood flow from the first scan to the second scan with the
> covariate.
> I centered the covariate around 0 and used a new covariate of +a/2,-a/2 as
> a new covariiate as recommended by Andrew Holmes.
>
> Could anyone please explain to me what would the difference be in this
> case, if I use the "Multi subject covariate only" design or a
> "Multi subject condition and covariate design" and use a [0 0 1] contrast.
If you use 'Multi subject condition and covariate design', the model
expresses your assumption that each series of observations in a voxel
(over subjects) can be explained by subject effects, condition effects
(which are the same for all subjects) and by your covariate.
If you choose 'Multi subject covariate only', you express your belief
that there is no need to model a condition effect, but that your
covariate alone times the estimated slope is a good explanation for your
observations.
So the difference between the two models is that in the first you model
some additive condition effect commonly observed over all subjects.
[Stefan Kiebel 25 July 2000]
1 group, 2 conditions, 1 covariate, 2 nuisances
> I will first start with what we have: Within an fmri study,
> One group
> Five subjects
> Two conditions
> Auditory Monitoring versus its own baseline
> Working Memory versus its own baseline
> Two nuisance variables
> anxiety score (one score per subject)
> Depressive mood score (one score per subject)
>
> One covariate of interest
> error score on the working memory task
> This is what we did
> Design Description
> Desgin: Full Monty
> Global calculation: mean voxel value (within per image fullmean/8 mask)
> Grand Mean scalingL (implicit in PropSca global normalization)
> Global normailzation: proportional scaling to 50
> Parameters: 2 condition, +1 covariate, +5 block, +2 nuisance
> 10 total, having 7 degrees of freedom
> leaving 3 degrees of freedom from 10 images
>
> Is this a valid way of looking at this? We are concerned with the
> large degrees of freedom that we are using up. Also how would we
> accurately interpret such a model? Does the statistical map only
> represent activations that are associated with the covariate of
> interest after controlling for anxiety and depression scores?
Firstly I assume this is a second level analysis where you have taken
'monitoring' and 'memory' contrasts from the first level. If this is
the case you should analyse each contrast separately. Secondly do not
model the subject effect: At the seond level this is a subject by
contrast interaction and is the error variance used for inference.
Thirdly a significant effect due to any of the covariates represents a
condition x covariate interaction (i.e. how that covariate affects the
activation).
I would use a covariates only single subject design in PET models (for
each of the two contrasts from the first level). A second-level
contrast testing for the effect of the constant term will tell you
about average activation effects. The remaining covariate-specific
contrasts will indicate whether or not there is an interaction.
[Karl Friston 17 July 2000]
1 group, 2 conditions, 3 levels/condition
> we're attempting to conduct a parametric analysis.
> We have two condition A(experimental condition) B(control condition); in the
> experimental condition the parameter assumes 3 different values.
> 1) Which is the difference between choosing a polynomial or a linear
> relationship in the model?
A linear model is simply a polynomial model with 0th and 1st order
terms. Any curvilinear relationship between evoked responses and
the parameter of interest would require 2nd or higher order terms
to be modeled.
> 2) In the results session how can we specify the contrast for the AB
> difference? and for the parameter effect on the experimental condition?
Simply test for the [polynomial] coefficients one by one. The 0th
order term (e.g. [1 0 0]) models the mean difference between A and B
averaged over the three levels. The 1st order coefficient (e.g. [0 1
0]) reflects the linear dependency on the parameter and the 2nd (e.g.
[0 0 1]) or higher reflect the nonlinear components. The 0th order
term is the conventional box-car or condotion-specific effect modeled
in simple, non-paramteric analyses. Note that because you only have 3
levels in condition A a 2nd order model is the highest you would
consider (- a parabola can join three points together).
[Karl Friston 29 Jun 2000]
> I chose the multi-subject: conditions and covariates design, for
> PET scan. The four scans/conditions (A,B,C,D) were entered in
> time-order. I want to compare only two conditions (e.g. B and C) in
> the analysis. Do I have to put the other conditions on 0 while
> defining contrasts (i.e. 0,-1,1,0), or do I have to make another
> spm.mat file in which only the two conditions I want to compare are
> taken and define contrasts as 1,-1? Is there a difference between the
> two ways?
The first solution is the more appropriate one. One should generally try
to specify one design matrix modelling all observations and then use the
one estimated parameter set to compute all the contrasts.
The difference between the two solutions is that in the first case you
make the assumption that it is valid to use all scans for estimating the
variance under the null hypothesis, even if a contrast vector element is
zero for the associated basis function/condition. This is a valid
assumption for a fixed effects PET analysis. As a result, you have more
degrees of freedom in your statistical test at each voxel such that the
analysis is more sensitive to the underlying signal.
[Stefan Kiebal, when ???]
> Further to my question to you earlier this week which was:
> Q. My paradigm is a block design with 4 different active blocks each
> followed by it's respective null block, i.e I have 4 different null
> blocks. How do I go about specifying the design matrix for a second
> level analysis taking these different null blocks into account?
> e.g.
> if my 4 active blocks are: A1 A2 A3 A4
> and my 4 null blocks are: N1 N2 N3 N4
>
> If I specify trials 1-8 in the following order:
>A1 N1 A2 N2 A3 N3 A4 N4
>
> how do I contrast [A1-N1] - [A2-N2]? or vice versa?
>
> Your answer was:
> A.You would simply specify 8 conditions (A1 - N4) and use the appropriate
> contrasts.
> Unfortunately, 'use the appropriate contrasts' is the bit we don't know how
> to do now that we have so many different nulls.
>
> I have specified the conditions 1-8:A1 N1 A2 N2 A3 N3 A4 N4
> for simple contrast A1-N1 I've used:1 -1 0 0 0 0 0 0
> & for contrast A2-N2 I've used: 0 0 1 -1 0 0 0 0
> How do I specify a 2nd level contrast looking at the activity in A1 minus
> it's null N1 versus the activity in A2 minus it's null N2,
> i.e. [A1-N1] - [A2-N2]?
>
> If I use:A1 N1 A2 N2 A3 N3 A4 N4
> 1 -1 1 -1 0 0 0 0
> then surely this is just adding the activity in A1 and A2 and taking
> away the activity in N1 and N2 which is not what we want to do.
In fact this is [A1-N1] - [A2-N2] and is exactly what you want. I
think the confusion may be about the role of the 2nd-level analysis.
To perform a second level analysis simply take the above contrast [1
-1 1 -1 0 0 0 0] and create a con???.img for each subject. You
then enter these images into a one sample T test under 'Basic Designs'
to get the second-level SPM. To do this you have to model all your
sujects at the first level and specify your contrasts so that the
effect is tested in a subject-specific fashion:
i.e. subject 1 [1 -1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 ...
subject 2 [0 0 0 0 0 0 0 0 1 -1 1 -1 0 0 0 0 ...
...
[Karl Friston 19 July 2000]
>how do I contrast [A1-N1]-[A2-N2]? or vice versa? i.e perform a 2nd order
>contrast.
The first issue is exactly what question you are asking. [A1-N1] vs
[A2-N2] looks like an interaction, and I think that this is what you
are after. You can think of it as comparing the 'simple main effect'
Ax-Nx in two contexts, x=1 and x=2. Put another way, the
interaction is the 'A-specific activity' in context 1 compared with
the 'A-specific activity' in context 2, each being compared with its
own baseline. Let me know if this is not what you need.
>Would the appropriate contrast be A1-N1-A2+A1?
No, it would be A1-N1-A2+N2 (I suspect that this is what you meant
and that the A1 on the end is just a typo). Thus with your
covariates ordered as specified above, your contrast will be 1 -1 -1
1 0 0 0 0). As Karl pointed out (but for a different contrast), you
now need to perform this contrast on each of your subjects, within
the 'fixed effects' design matrix:
Subject 1: 1 -1 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 ...
Subject 2: 0 0 0 0 0 0 0 0 1 -1 -1 1 0 0 0 0 ...
etc.
Each contrast image generated (i.e. one for each subject) gets
entered into a one-sample t test in the 'second level' analysis. The
question which you now ask of every voxel is whether its value
departs significantly from zero (which is its expected value under
the null hypothesis).
Incidentally it may be worth just mentioning an alternative (less
good) approach, which I suspect that you might have been considering.
(You can ignore this bit if you like.) You could specify the simple
main effect contrasts A1-N1 and A2-N2, and test for the difference
between them. Thus your contrasts would be
Subject 1 (A1-N1): 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
Subject 1 (A2-N2): 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 ...
Subject 2 (A1-N1): 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 ...
Subject 2 (A2-N2): 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 ...
In this case, the second level analysis would test whether the A1-N1
contrasts, as a population, are significantly greater than the A2-N2
contrasts. The reason why this is less good than the first approach
outlined above is that it is equivalent to an unpaired t test (in
which you just compare an 'A1-N1' population with an 'A2-N2'
population) whereas your data are obviously paired (i.e. each A1-N1
estimate goes with the A2-N2 estimate for the same subject).
However, if you can do a paired t test, then as I understand it the
result should be exactly the same as the first analysis - I've never
tried this so I don't know if it is possible within SPM99.
[Richard Perry 20 July 2000]
> We have conducted a Working Memory study in H2O-PET with the following
> design:
>
> 8 subject
> 4 Conditions:
> A: WM 1 (high load)
> B: WM 1 (low load)
> C: WM 2 (high load)
> D: WM 2 (low load)
> 3 Scans/per condition/subject
>
> Thus we have a total of 96 scans. To look for the main effect of
> Working memory and for the domain specific effect we have chosen the
> Multi-subject: cond x Subj interaction & covariates design. We find
> nice WM main effects and also interesting domain specific effects.
>
> Experimental question: We are interested if there is a correlation
> between performance (as measured by RT) and WM-specific activation.
>
> What kind of design do we have to choose? As we work mainly with
> fMRI-studies we first thought of a second level analysis. That is:
> Formulate subjects specific contrast, e.g. WM 1 high load minus WM 1
> low load on the first level, then feed the eight resulting con-images
> into basic models (simple regression) and chosse the median of the RT
> for the three WM 1 high load scans as covariates into this modell. Then
> our analysis should yield regions in which there is a correlation of
> one WM domain with performance.
>
> Question 1: Is this analysis correct?
Yes it is but it may not be the most sensitive analysis because you are
proceeding to a second-level analysis whereas you have scan-specific
performance measures.
> Question 2: There are several options at the first level in which it is
> possible to specify scan specific covariates. Is it intelligible to
> choose one of these models and feed in scan specific RT in order to
> answer our experimental question? If so, what is the appropriate model?
> We have tried several but if we enter scans and covariates we use up all
> our degrees of freedom, e.g. if we use Mulit-subj: covariates only. So
> something must be wrong.
I would simplify your model and omit subject x condition interactions.
You could then enter the condition x performance interaction as a
covariate of interest. This is simply the mean corrected performance
data multiplied by 1 for high load and -1 for low load. You could do
this in a condition-specific fashion for WM 1 and WM 2 using two
covariates but ensure the behavioural data are centered within
condition before constructing the interaction (here use 0 for the
'other' condition).
[Karl Friston, 20 Jun 2000]
> I ran SPM99b. We have tested 11 normal young subjects with H2 O15 PET
> study in five different conditions 1 at rest and 4 with auditory stimulation.
> The first design matrix to check the differences between stimulation-no
> stimulation we used is:
> multisubject conditions & covariates
> conditions 0 -1 -2 1 2 (rest, cond 1, cond 2 cond 3 and cond 4)
> Ancova by subject
> scale subjects grand means to 50
> analysis threshold 0.8
> mean voxel value (within per image fullmean/8 mask)
> Is the right approach?
> Should be -4 1 1 1 1 ?
Yes, the design matrix specification part sounds fine. You should take
the contrast [-4 1 1 1] to compare the mean effect of all stimulation
conditions vs. rest.
> The design matrix we used to look for different activity in one of the four
> conditions was.:
> multisubject conditions & covariates
> conditions 0 1 1 1 -3 (rest, cond 1, cond 2 cond 3 and cond 4 wich is the relevant)
> Ancova by subject
> scale subjects grand means to 50
> analysis threshold 0.8
> mean voxel value (within per image fullmean/8 mask)
> what is the difference using 0 -1 -1 -1 3, assuming we
> espected to find greater
> activity at condition 4?
The difference between [0 1 1 1 -3] and [0 -1 -1 -1 3] is that the first
tests at each voxel, whether the mean effect of conditions 1 to 3 is
larger than the effect of condition 4 and the second tests, whether the
effect of condition 4 is larger than the mean effect of condition 1 to
3.
> I was also interested in measuring rCBF in auditory cortex at the different
> stimulation conditions. Unfortunately the differences between conditions are so
> subtle that using a T test there is no significance with the actual number
> of subjects (11).
If you want to see the effect of each condition vs. rest, then you could
try the contrasts
[-1 1 0 0 0]
[-1 0 1 0 0]
[-1 0 0 1 0]
[-1 0 0 0 1]
If you have a specific hypothesis that e.g. condition 4 should activate
more than condition 1, you could try [0 -1 0 0 1].
[Stefan Kiebel 11 July 2000]
> I have a few questions concerning a multi-subjects fMRI experiment.
> For each subject we acquired 4 separate scan-sessions according to the
> following experimental design:
> session 1,2: Ce Cr Ce Cr Ce Cr Ce Cr Ae Ar Ae Ar Ae Ar Ae Ar
> session 3,4: Ce Cr Ce Cr Ce Cr Ce Cr Be Br Be Br Be Br Be Br
> where:
> e = encoding
> r = retrieval
> C = baseline
> A = condition1
> B = condition2
>
> Up to now, I have been able to analyze contrasts between conditions
> belonging to sessions of the same type (e.g. Ae-Ce; Ar-Cr for sessions 1
> and 2) both using a fixed-effect and a 2nd-level random effect model.
>
> In addition, however, I would like to compare conditions belonging to
> sessions of a different type - though I know it would have been much
> better to include all conditions in one session. E.g. compare Ae-Be. I
> have tried to do this on a random-effect basis, by computing the simple
> main effects for each subject (Ae-Ce and Be-Ce) and the entering the
> corresponding con*.images into a paired t-test (Ae-Ce vs Be-Ce). My
> questions here are: what am I actually looking by this approach? At
> interaction effects [of the type (Ae-Ce) - (Be-Ce)]?
Yes indeed. You could construe your design as a 3 factor design:
Factor 1: C vs. Active (A or B) (2 levels)
Factor 2: e vs. r (2 levels)
Factor 3: Condition 1 vs. Condition 2 (2 levels)
Your effect is a 2 way interaction Factor 1 x Factor 3, under e.
> Do I have to mask this contrast by another contrast (e.g. main effect)
> and how can I specify the masking contrast?
You do not have to but if you wanted t; use a 2nd-level model with
(Ae-Ce) in one column and (Be-Ce) in another (plus the constant term).
Then mask [1 -1 0] with [1 1 1]. The latter is the main effect of
Factor 1.
> Is there any way to look at direct comparisons (Ae-Be)?
Yes; just do a two sample t test on contrasts testing for Ae and Be
separately. These will be the same as the beta???.img.
[Karl Friston 18 July 2000]
> We are analyzing PET data of subjects from 2 groups who underwent the
> same stimulation. Group1 contains 7 subjects, Group2 contains 12
> subjects. We can do a single subject analysis and a RFX group
> evaluation of group 2. For the group evaluation of group 1 the number of
> 7 subjects might be not enough. (?) We want to do a comparison of the 2
> groups. Which model do we have to use for the first and second level
> analysis?
For the 1st-level analysis use a 'multi-group conditions and covariates'
for the 2nd-level analysis compare the two sets of subject-specific
contrasts with a two sample t test under 'basic models'. The latter will
have reasonable power because you are using all 19 subjects.
[Karl Friston 10 Jul 2000]
> Now have properly normalized 2 groups with 5 datasets each. Paradigm:
> RARARAR (A: Activation, R: Rest). Group I: controls, group II
> patients. Now I want to subtract the group I from group II to see,
> wether there is any difference between the two groups concerning
> condition A. How shall I proceed?
If you want to assess the differences in activations this constitutes
an inference about the group x condition interaction. Having modeled
your two conditions in a multi-group PET design you will have four
columns (A - group I, B - group I, A - group II and B - group II). The
contrast you require is [1 -1 -1 1] for bigger activations in the
controls and [-1 1 1 -1] for the converse.
[Karl Friston 19 July 2000]
2 groups, 2 conditions, 1 covariate
> Given 2 conditions, 1 scan/condition, 1 covariate obtained at each scan,
> mean-centered covariate with proportional global scaling. A condition &
> covariate design with a contrast 0 0 1 is equivalent to correlation
> between the change in covariate and the change in the scans.
> Can this approach be generalized to a multi-group design ? If there are 2
> groups and 2 conditions, with 1 scan for each subject under each
> condition, and a single covariate collected during each scan, then would
> one specify 1 or 2 covariates.
I would specify two, each with a group-centered covariate. This would
allow you to look for differences in the partial correlation with the
contrast [0 0 0 0 1 -1]. i.e. models group x covariate interactions.
> If only one covariate is specified, would one test for a covariate effect
> in group 1 alone with the contrast 1 0 0 0 1 (Group 1, Group 2, Condition
> 1, Condition 2, Covariate), and the group x covariate interaction with the
> contrast 1 -1 0 0 1 ?
No. The interaction is not modeled with only one covariate. This contrast
is simply the main effect of group plus the main effect of contrast.
> Alternatively would one use 2 covariates ? Each covariate consisting of
> the mean centered values for a single group with 0 padding for the
> subjects in the other group, essentially what you get when you specify a
> group x covariate interation The effect of the covariate for group 1
> alone would be tested with the contrast 0 0 0 0 1 0 ( (Group 1, Group 2,
> Condition 1, Condition 2, Covariate1, Covariate 2) and the interaction
> across groups tested with the contrast 0 0 0 0 1 -1 ?
Exactly.
[Karl Friston 28 Jun 2000]
> I have two groups of subjects who, on prescreening, exhibited
> differential mood responses (one group positive scores, the other
> negative) to a drug. So with 2 groups (positive and negative
> responders), 2 conditions (drug and placebo), 1 scan/subject under each
> condition, and 1 covariate (mood score) collected/scan, how would I go
> about determing whether rCMglu is affected by:
>
> 1) prescreening mood scores both within and across groups
These are the simple and main effects of mood (or group) and would be
best addressed with a second-level analysis using the subject-effect
parameter estimate images (i.e. averaging over condotions for each
subject).
> 2) post drug scan mood scores both within and across groups
> and also whether:
This is a main effect of 'post scan mood score' within the post drug
level of the condition effect. This is best analysed using a
condition-centered covariate ('post scan mood score') and testing for a
significant regression with 'drug'.
> 3) mean centering of the covariate is useful/necessary in these cases
Yes. For (1) there is not covariate required.
> 4) mean should be computed within group or across all subjects
For (2) within condition. There are other centering you could use to
look at different interactions. e.g. group-centered would allow you to
see if there was any interaction between prescreening and post scan
mood.
[Karl Friston 28 Jun 2000]
3 groups (2 patient, 1 control), 2 conditions (ABABAB)
| I have a data set involving 3 groups of subjects (2 different
| patient groups and 1 control group) doing a simple ABABAB style
| paradigm. I have made a con* image representing the difference
| between A and B for each subject. I can do a within group analysis
| by feeding the con images for one group into a 1-sample t-test and I
| can compare 2 groups using a 2 sample t-test. What I would like to
| do is compare all 3 groups. 3 pairwise comparisons would seem to be
| the best I can do in "basic fMRI models". I assume it is more
| elegant to mdel all 3 groups in a single analysis. But PET multi-
| group models seem to need one image PER CONDITION rather than one
| image per subject representing the difference between conditions. Is
| there a way round this without generating spm98 style "adjmean"
| images for each condition?
Try the "One-way Anova" option in the "Basic models". The default
F-contrast produced is the usual analysis of variance F-statistic for any
difference (in response, since you're looking at contrast images) between
the three groups.
You can conduct follow-up comparisons (comparing pairs of groups), using
simple contrasts (like [+1 -1 0] for example). However, you should adjust
the significance level at which you examine these follow-up comparisons to
take into account the number of comparisons: The simplest method is the
Bonferroni method, in which you multiply your p-values by the number of
planned follow-up comparisons. Note that although there are three ways to
compare pairs of three groups, this corresponds to six contrasts for
SPM{t}'s in SPM, since SPM's t-contrasts only effect one-sided tests.
Note that Anova assumes that the intra and inter-subject variability
expressed in your contrast images is constant across the three groups. If
this assumption is met, you'll get slightly more powerful paired
comparisons from the Anova model than from simple pairwise comparisons
because of the increased degrees of freedom available for variance
estimation. In essence, you're comparing two groups with a variance
estimator pooled across all three, even the one your contrast appears not
to be looking at.
Comparison of the Anova follow-up paired comparisons with the "2 sample
t-test" results will give some indication of whether the homoscedasticity
assumption is met.
| NB: the number of subjects is not the same in each group if this is
| relevant.
That's OK, but note that for the two level contrast image approach to
random effects analyses to be valid, the experimental design for each
subject (regardless of group) should be such that the design matrix is the
same.
[Who / when ???]
Variable epoch lengths
> I am having a few problems setting up a model for a study with variable
> epoch lengths.
>
> I have a resting breathing condition (12 x 30 second periods) and a
> voluntary hyperventilation condition (12 x 30 second periods)
>
> In the first analysis I set up a model in which I specified two
> conditions (rest and voluntary), however I have since realised that I
> maybe should have treated the study as having only one condition - vol,
> and treated the resting periods as baseline.
It should not make any difference with box-car regressors and one basis
fuction per condition.
> In the second model I have specified 1 condition (treating the rest as
> baseline), epoch - fixed response box car, convolved with hrf and
> temporal derivative.
> The problem arises when I specify the epoch lengths (some are 5 scans
> in length instead of 6 because of variability in breathing). After I
> enter vector of onsets, SPM asks 'variable duration'. At this point I
> enter yes, then I am prompted by SPM to enter 'duration (scans)'. If I
> enter the variable epoch lengths at this point, I am also asked at a
> later point in the model set-up to enter 'Epoch length (scans) for
> trials'. However, SPM will only accept scalars and not a string of
> vectors (which specify the variable epoch lengths). I don't understand
> why it asks me twice to enter epoch length and will only accept scalars
> on the second prompt (when I set up the first analysis it accepted a
> string of vectors) Also, should I be specifying each condition in the
> design matrix or only the vol condition?
Variable length epochs are dealt with using the event-related options.
Select event-related, not epoch-related when chosing your basis set.
The simpler alternative would be to have two 'vol' conditions (one of 5
scans and one of 6 scans) and simply take to average using contrasts
later on.
[Karl Friston 17 July 2000]
HRF width
> I'm trying to model event-related activity that is due to two stimuli
> presented sequentially with an SOA of 1.5 seconds. In looking at the
> raw data, the hemodynamic response to such an event often has a wider
> peak than does the typical HRF for a single event. I'm wondering
> whether modelling the data using a dispersion derivative (i.e., hrf +
> time + dispersion derivatives) will enable SPM to fit a canonical hrf
> to the data that has the appropriate width. In other words, does the
> dispersion derivative allow the width of the of the canonical HRF to be
> adjusted analagous to the way that the temporal derivative allows the
> onset of the canonical response to be adjusted?
Absolutely.
[Karl Friston 21 July 2000]
Realignment (a.k.a. Motion Correction)
| I realigned images [creating mean image only], and tried to run spm_sn3d,
| only to be told "not enough overlap". when I viewed the data in Display or
| Check Reg, I found that the origin was somewhere far Northeast of the
| vertex. I then tried to set the coordinates using Hdr Edit, only to fail. I
| think the message below says why:
|
| At 06:25 AM 03/24/2000 , you wrote:
| >Once an image has a .mat file, then SPM99 ignores the origin and
| >voxel size information in the headers. The best way of changing the
| >origin is via the Display button. It also allows you to re-orient
|
| so, this means EITHER: a] set the origin in all images PRIOR to realign
| using Hdr edit [which can be applied to many images at once]
| OR b] once realigned, only Display can be used. [one image at a time]
| True?
Display can be used to reorient many images at the same time. It is simply
a matter of selecting all the images that are in register with the one
currently being displayed after you click the "Reorient Images..." button.
The reorientation applies a relative transformation to the images, so if
the images have been realigned or coregistered, or have different voxel sizes
or whatever, they will still be in register with each other after reorienting.
|
| To use Hdr edit, I would open an image in display, and set my crosshairs to
| the vicinity of the AC. Then, I would enter those voxel coordinates [in mm]
| into Hdr_edit, and apply those values to the relevant images. yes?
If you were to do it this way, then it should work (providing the images
have no .mat files).
[John Ashburner 21 July 2000]
|Does one always need to reslice while doing movement correction, or is
|coregister alone enough? I'm asking because it appears that one can reslice
|later at the spatial normalization stage anyway.
Reslicing once only at the normalisation stage will work fine. Note that
the smoothness of the resultant data will be slightly less with one
reslice than with two.
[Geraint Rees 10 Jul 2000]
| Dear SPManagers: I am realigning multiple SPECT scans within
| subjects, and am not clear what this option offers me. I have looked
| through help files relating to realign, and am not enlightened.
Weighting of the reference image allows the realignment parameters
to be estimated from only a specific region of the reference image. For
example, there may be artifacts in the images that you do not wish
to influence the estimation of the realignment parameters. By giving
these regions zero weight in the realignment, they have no influence
on the estimated parameters. The weighting procedure uses an image
which can contain zeros and ones, or more properly, it can be thought of
as containing the reciprocals of the standard deviation at each voxel
(unlike weighting in the spatial normalisation where the weight is
the reciprocal of the variance - I must fix this).
The function minimised in the realignment is something like:
\sum_i (wt_i * ( g_i - s * f_i ))^2
whereas for the spatial normalisation it is more like:
\sum_i wt_i * ( g_i - s * f_i )^2
|
| I do understand that the defualt for PEt and SPECT is to make a mean
| image from a "first-pass" realignment, and tehn realigns all images to
| that. Is this other option data-type specific?
It does this whenever you use the PET or SPECT modality. It would also
do this for fMRI, but I figured it would slow things down too much if
it did two passes. Also, PET and SPECT images are noisier, so realigning
to a mean image improves the results more. Ideally, the procedure would
be repeated a few times, but again, this would be too slow.
| 1. is there a number which corresponds to hard-coding "Create mean image
| only" for spm_realign?
I'm afraid the sptl_CrtWht variable only accepts the two values.
|
| 2. what is the range of possible values for regularisation? what numbers
| correspond to "medium" and "heavy"?
Any positive value you like. Medium and heavy are given by 0.01 and 0.1
respectively. A value of zero does not regularise the nonlinear part
of the spatial normalisation.
[John Ashburner 19 July 2000]
| I have applied slice timing to my event-related series. For motion correction
| (spatial realignment) I would like to use a non-SPM software. This software can
| read the aV*.img images but not aV*.mat files.
|
| My question is: have aV* images been actually written with the slice timing
| correction imbedded? That is, if I use them outside SPM without their .mat
| files, will slice timing be still taken into account? If not, what should I do?
I think you can quite happily delete these .mat files as they probably
don't contain any additional information. Whenever any new images are
derived from existing ones, then the positional information is preserved
in the new set of images. This positional information is derived from the
.mat files if they exist, but otherwise from the voxel-size and origin
fields of the .hdr files. If the origin contains [0 0 0], then it defaults
to mean the centre of the image, which, depending if you have odd or even
image dimensions, is either an integer value or halfway between two voxels.
Because the origin field can only store integers, half voxel translations
can not be represented in the .hdr files, so this information is
written to .mat files.
[John Ashburner 25 July 2000]
| I want to coregister a structural (anat.img) and 60
| functional (func.img) images. Shall I: 1. coregister
| anat.img with <coregister> button and 2. coregister
| func.img with <coregister> button or first do 2. and
| then 1.. During second coregistration I am asked after
| target and object image. What is best to choose for
| this?
Realign the functional images, possibly creating a mean at
the same time. Then coregister the anat.img to the mean
(or possibly one of the individual images from the series).
To do this, you would have target=mean_func.img, object=anat.img
and other=none.
[John Ashburner, 13 July 2000]
| In "realign" what does mean "adjust sampling errors" and when I must
| use these option?
It removes a tiny amount of interpolation error from the data. In reality
it should not do much to the data, but it can increase your t statistics
slightly. It does slow things down a lot though. Full documentation of
what it does can be obtained via the <Help> facility in SPM99.
[John Ashburner 2 Aug 2000]
When you coregister a pair of images, and want to carry an additional image
along, then you can specify the additional image as other. In the example
below, there were two ways of doing the coregistration:
1) Target: Image 1
Object: Image 2
Other: Image 3
Changes the .mat file of image 2 so that it matches image 1, and applies
the same change to image 3.
2) Target: Image 2
Object: Image 1
Other: none
Updates the mat file of image 1 so that it matches image 2. Image
2 is already in register with image 1.
Because the voxels of image 2 are aligned with those of image 3, then all
you need to do is ensure that image 3 has the same .mat file as image 2.
In this case, you can do this by simply copying the .mat file of image 2
to that of image 3. Use the <Check Reg> button to make sure everything
is OK.
[John Ashburner 3 Aug 2000]
If your objective is ultimately to superimpose your functional activations on to
your high resolution structural image, then the route I would take would be:
1) Without spatial normalisation:
Coregister the structural image to the mean functional.
Do the stats on the realigned functional images.
Simply display the activations on the structural image (not the resliced
version).
This works because the .mat file that is written for the structural
image encodes the relative positioning of the structural image relative
to the mean functional image. You can check that this has worked with
the <Check Reg> button, and selecting the unresliced high res
structural and the mean (or any of the individual functional images).
2) With spatial normalisation:
Coregister the structural image to the mean functional.
Estimate spatial normalisation parameters either from the mean functional
or the structural image.
Apply the spatial normalisation parameters to the functional images
to get spatially
normalised functional images with whatever resolution you like.
Hit the <Defaults> button, select spatial normalisation, then the option for
changing the defaults on how the images are written, and specify
something like 1x1x1mm resolution.
Write the spatially normalised structural image using the new default
voxel sizes
(selecting the original structural image, rather than the resliced one).
The .mat files created by the coregistration (or realignment for that
matter) are incorporated into the affine part of the spatial
normalisation procedure. Processing the structural image in this way
means that it is not resampled down to the resolution of the functional
images at any stage.
[John Ashburner 4 Jul 2000]
| 1. in the case of PET/SPECT, the "reference image" is the mean image
| calculated on the first pass
For PET/SPECT realignment, the reference image is the first of the series
during the first pass, and the mean of the realigned series for the
second pass.
| 2. the default setting is NOT to weight this image
This is true.
| 3. one cannot choose another image, since this is data-derived, reflecting
| variance -StdDev, really-- at each voxel
When weighting the realignment, the user normally specifies their own
image. The weighting is not actually derived from the residual variance,
although I did think about incorporating this in the realingment model.
|
| in my case, I am aligning 2 or 3 images per subject, so I conclude this
| option would not help me, as the voxel varainces would not be a useful
| index of anything. Do you agree?
I don't think you could obtain a useful variance image from 2 or 3 images,
although I guess that some optimal variance smoothing could be used in
principle.
|
| >on the estimated parameters. The weighting procedure uses an image
| >which can contain zeros and ones, or more properly, it can be thought of
| >as containing the reciprocals of the standard deviation at each voxel
| >(unlike weighting in the spatial normalisation where the weight is
| >the reciprocal of the variance - I must fix this).
|
| when you say "fix this", are you referring to Realign or Spatial? fix to
| which, var or SD? why ?
I was referring to making the weighting of the spatial normalisation
consistent with the weighting for the realignment. Currently one uses
images that would be proportional to 1/variance whereas the other uses
weighting images proportional to 1/sqrt(variance). However, normally
the weights are either zero or one, in which case the distinction does
not make any difference.
[John Ashburner 21 July 2000]
| is it a requirement that all data from multiple subjects hav the same voxel
| sizes when running spm_sn3d?
They don't all need to have the same voxel sizes.
[John Ashburner 26 July 2000]
> Is it possible to retrieve SPM-non-linear-transformation information
> computed after spatial normalization with the T1-template in order to
> apply it to an other volume in the same coordinate system ?
>
The record of all the spatial transforms (linear and non-linear) are
kept in the *sn3d.mat file produced by the normalization process
carried out on your object image. This can be applied to any image that
starts off in the same space as the original object image (normalize >
write normalized only > subjects (1, presumably) > select the *sn3d.mat
file from the smpget window > select image to be transformed).
If you just want the non-linear transforms only, that is possible using
commands in the matlab window, but you would have to try someone else
who knows a bit more about this.
[Alex Leff 27 Jun 2000]
| with 128x128/30 Slices and voxel size 1.95x1.95x4.5 is
| it worth to do sinc normalisation or is bilinear quite
| enough?
Sinc interpolation is generally recommended for interpolation
when doing movement correction. If you reslice the images at
the realignmnt step, then I don't think you gain much by
using sinc interpolation at the normalisation stage. However,
if you just estimate the movement parameters at the realignment
stage, then these movements are incorporated into the spatial
transformations at the normalisation stage, so it is probably
better to use sinc interpolation.
[John Ashburner 17 July 2000]
If its functional data I would have thought bilinear is 'quite enough'
[Karl Friston 17 July 2000]
| Similarly, I noticed that the defaults non linear basis function parameters
| are 7x8x7. It was set at 4x5x4 in SPM 96. I've read in the spm archives that
| 7x8x7 is suitable for T1 MRI images but not for PET images. Shall I go back
| to the 4x5x4 value ?
More basis functions generally works better than having fewer when the images
can be easily matched to the template. It is sometimes better to use fewer
basis functions if the brain images contain lesions, or if the image contrast
differs slightly from that of the templates. Alternatively, the amount of
regularisation can be varied in order to modify the amount of allowable warping.
The main reason for the extra basis functions used in SPM99, is that spatial
normalisation in SPM99 tends to be much more stable than the version in SPM96.
[John Ashburner, 12 July 2000]
| Can you telle me please the meaning of X ,Y, Z, when i use the mutual
| information registration method?
| I have used a PET cardiac images and I want to compare the angles that
| I've imposed with the results of SPM.
The matrix multiplication displayed after running mutual information
coregistration, shows a mapping from voxels in the stationary image,
to those in the image that was rotated and translated. This mapping
is derived from a series of rotations and translations (and zooms where
voxel sizes differ between the images). The X, Y and Z refer to voxel
co-ordinates in the stationary image, whereas X1, Y1 and Z1 refer to
co-ordinates in the other one. The matrix can be decomposed into a
series of translations, rotations, zooms and shears using the spm_imatrix
function. For example, if the display says:
X1 = 0.9998*X - 0.0175*Y + 0*Z - 10.0000
Y1 = 0.0174*X + 0.9997*Y + 0.0175*Z + 0
Z1 = -0.0003*X - 0.0174*Y + 0.9998*Z + 10.0000
Then typing:
M = [0.9998 -0.0175 0 -10.0000
0.0174 0.9997 0.0175 0
-0.0003 -0.0174 0.9998 10.0000
0 0 0 1.0000];
spm_imatrix(M)
should produce:
ans =
Columns 1 through 7
-10.0000 0 10.0000 0.0175 0 -0.0175 1.0000
Columns 8 through 12
1.0000 1.0000 0.0000 0 0
which describes translations in the x and z directions of -10 and 10 voxels
and rotations about the x and z axes (pitch and yaw) of 1 and -1 degrees
(0.0175 and -0.0175 radians). The parameters are probably better explained
if you type:
help spm_matrix
[John Ashburner 25 July 2000]
|if I do normalisation on anatomical and functional
|images, shall I coregister both modalities first or not?
If you want to use the anatomical image to overlay the functional
activations, then one way would be to coregister the T1-weighted
anatomical to the T2*-weighted EPI; normalise the EPI to the EPI
template; then normalise the T1 image using the same parameters.
If you are normalising the T1-weighted and T2*-weighted images separately,
to separate templates, then prior coregistration is irrelevant as the
normalisation parameters will be determined independently. But this
strategy might not be best, unless you have a specific reason.
[Geraint Rees 15 July 2000]
| I am trying to normalize the contrast images of individual subjects
| to run a random effect analysis. I read some of the messages on the
| list about this and the biggest concern it seems to be that with the
| normalization procedure one could lose or get strange results on the
| outer rim of brain, because of the interpolation of NaN. I tried both
| bilinear and nearest neighbour interpolation and, just eyeballing,
| couldn't notice any strange border patterns coming up in both cases.
| Would you think anyway that with nearest neighbour interpolation
| this border effect is negligible (how does NN interp. treat NaN?)?
The edge effects involve possibly losing some voxels. For tri-linear
interpolation, if any of the 8 closest voxels are NaN, then the
interpolated voxel is set to NaN. For nearest neighbour interpolation,
if the nearest voxel is NaN, then the voxel is output as NaN.
[John Ashburner 2 Aug 2000]
> Was wondering if there are any new methods for converting
> "Talairach" coordinates obtained using spm96 spatial normalization with MNI
> single brain template to the canonical Talairach's atlas coordinates. I used
> the transform from this template to the template from spm95 (PET) that
> Andreas posted but it is not perfect since the template is not matched to
> Talairach. Since the Talairach Daemon contains a scanned version of the
> atlas has anybody warped this to the MNI template?
The page:
http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html
has a routine on it which does a reasonable job of MNI to Talairach atlas
conversion.
[Matthew Brett 16 Feb 2000]
> I notice that the documentation describes the template images supplied with
> SPM as, approximate to the space described in the atlas of Talairach and
> Tournoux (1988). I was just wondering how 'approximate' they are and
> whether or not the co-ordinates provided by SPM should be reported as being
> 'Talairach'. For example, we are interested in the fusiform gyrus and it
> seems to me that the co-ordinates provided by SPM are about 2-4mm inferior
> compared to the Talairach atlas.
Matthew Brett has posted a helpful discussion of MNI/Talairach differences
at http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html that I think will
answer your queries. The bottom line in terms of reporting is to reference
activation loci to the surface anatomy of that individual subject if in
doubt.
[Geraint Reese 15 Aug 2000]
> Wouldn't it be a good idea to move the smoothing procedure
> from the "spatial preprocessing" to a step just before the result
> section. The idea is, that since smoothing (convolution with a
> kernel) and beta estimation (projection) are both linear operations
> they commute, and thus the order in which they are applied does not
> matter. So why not smooth a few beta images and the ResMS.img instead
> of hundreds raw-images.
>
> I forgot to say that switching the order of smoothing and estimation is
> a problem in first level analyses because the RPV.img is calculated in
> the "estimate" section and not in the "results" section. So how about
> moving the two steps: smoothing and resel per voxel estimation, to the
> results section?
You are absolutely right about the commutative nature of the estimation
and convolution operators
y*K = X*B*K + e*K ....smooth before
B*K = pinv(X)*y*K
y = X*B + e
B = pinv(X)*y
B*K = pinv(X)*y*K ....smooth after
However nonlinearities enter with error vaiance estimation. One would
have to smooth the residual images and then compute the sum of
squares. This part is not commutative and the number of residual
images equals the number of raw images.
i.e.diag(K'*e'*e*K) ~= K'*diag(e'*e)
Taking the sum of squared smoothed residuals is not the same as
smoothing the sum of sqaured residuals.
The reason one can smooth after a 1st level analysis is because the sum
of squared residuals do not enter into second level.
[Karl Friston]
One caveat which you may know if you've followed the list, is that the
con**.img and beta*.img images have the areas outside the brain values set
to NaN. Thus any smoothing operation at this stage will lose the outer layer
of voxels. Methods of dealing with that have been discussed previously by
John and Russell Poldrack I believe.
[Darren Gitelman]
> I am conducting a research on the response of PTSD and non PTSD patient
> to the repetition of their traumatic event. We have 2 group one of
> PTSD patients and one of non PTSD patients. For each patient we have 3
> baselines and 4 repetition of the traumatic story.
>
> We want to check the difference in the reaction to the traumatic script
> between the PTSD and control group.
>
> We use three type of covariates
>
> constant response - 0 0 0 1 1 1 1
> rise during the repetition - 0 0 0 1 2 3 4
> decrease during the repetition- 0 0 0 3 2 1 0
>
> These covariates are not orthogonal. If I want to check in what region
> of the brain the response correspond to each of the covariate how
> should I define my contrasts?
The repetition-dependent increases and decreases are modelling the same
effect and you only need to specify one regressor:
main effect of traumatic script - -1 -1 -1 1 1 1 1
script x [linear] time interaction - 0 0 0 -3 -1 1 3
Note that these regressors are orthogonal (and orthogonal to the
constant term) and can be tested with contrasts [1 0], [-1 0], [0 1]
and [0 -1]. The last two give you increases and decreases
respectively.
[Karl Friston 13 Mar 2000]
> Alternatively would one use 2 covariates ? Each covariate consisting of
> the mean centered values for a single group with 0 padding for the
> subjects in the other group, essentially what you get when you specify a
> group x covariate interaction The effect of the covariate for group 1
> alone would be tested with the contrast 0 0 0 0 1 0 ( (Group 1, Group 2,
> Condition 1, Condition 2, Covariate1, Covariate 2) and the interaction
> across groups tested with the contrast 0 0 0 0 1 -1 ?
>
> Would the contrast 0 0 0 0 1 1 in the multi-group model be a
> test of the effect of the covariate collapsed across all subjects
> disregarding group membership ?
Yes indeed - it would be the main effect of the covariate.
[Karl Friston 13 Mar 2000]
> Our data is as follows: 11 subjects and 8 scans per subject, which
> makes 88 scans. At each scan, each subject gave a subjective rating (0
> -10).
> We are trying to do a correlation analysis between subjective ratings
> and actual voxel values. The problem is that our data is not
> independent i.e. does not follow the assumption for correlation
> (regression analysis).
> Is it possible to analyze this kind of data using correlation
> analysis? Anyway, we tried the following model:
> Multi-subject : Covariates only, Covariate interaction with
> subject. Is this correct?
Yes - this models the main effect of the covariate and the covariate x
subject interactions (i.e. computes a regression coefficient for each
subject). You can test for the significance of the average regression
(or indeed differences among the subjects) with the approproate
contrast.
[Karl Friston 11 Jul 2000]
> I have a few more questions concerning the multisubject correlation
> analysis.
> Does "Covariates only: interaction with subject" model take into account
> the dependence within subject?
I am not sure what 'dependence within subject' means. This design fits
a different regression slope for each subject and assumes the error
within subject is independently and identically distributed.
[Karl Friston 12 Jul 2000]
> Given 2 conditions, 1 scan/condition, 1 covariate obtained at each scan,
> mean-centered covariate with proportional global scaling. A condition &
> covariate design with a contrast 0 0 1 is equivalent to correlation
> between the change in covariate and the change in the scans.
Indeed or more precisely the partial correlation between the covariate
and scan-by-scan changes having accounted for the condition-specific
activations.
> Can this approach be generalized to a multi-group design ? If there are 2
> groups and 2 conditions, with 1 scan for each subject under each
> condition, and a single covariate collected during each scan, then would
> one specify 1 or 2 covariates.
I would specify two, each with a group-centered covariate. This would
allow you to look for differences in the partial correlation with the
contrast [0 0 0 0 1 -1]. i.e. models group x covariate interactions.
> If only one covariate is specified, would one test for a covariate effect
> in group 1 alone with the contrast 1 0 0 0 1 (Group 1, Group 2, Condition
> 1, Condition 2, Covariate), and the group x covariate interaction with the
> contrast 1 -1 0 0 1 ?
No. The interaction is not modeled with only one covariate. This contrast
is simply the main effect of group plus the main effect of contrast.
> Alternatively would one use 2 covariates ? Each covariate consisting of
> the mean centered values for a single group with 0 padding for the
> subjects in the other group, essentially what you get when you specify a
> group x covariate interation The effect of the covariate for group 1
> alone would be tested with the contrast 0 0 0 0 1 0 ( (Group 1, Group 2,
> Condition 1, Condition 2, Covariate1, Covariate 2) and the interaction
> across groups tested with the contrast 0 0 0 0 1 -1 ?
Exactly.
[Karl Friston 28 June 2000]
> I have a very similar question to that posted by Steven Grant on June
> 9th. I have two groups of subjects who, on prescreening, exhibited
> differential mood responses (one group positive scores, the other
> negative) to a drug. So with 2 groups (positive and negative
> responders), 2 conditions (drug and placebo), 1 scan/subject under each
> condition, and 1 covariate (mood score) collected/scan, how would I go
> about determing whether rCMglu is affected by:
>
> 1) prescreening mood scores both within and across groups
These are the simple and main effects of mood (or group) and would be
best addressed with a second-level analysis using the subject-effect
parameter estimate images (i.e. averaging over condotions for each
subject).
> 2) post drug scan mood scores both within and across groups
> and also whether:
This is a main effect of 'post scan mood score' within the post drug
level of the condition effect. This is best analysed using a
condition-centered covariate ('post scan mood score') and testing for a
significant regression with 'drug'.
> 3) mean centering of the covariate is useful/necessary in these cases
Yes. For (1) there is not covariate required.
> 4) mean should be computed within group or across all subjects
For (2) within condition. There are other centering you could use to
look at different interactions. e.g. group-centered would allow you to
see if there was any interaction between prescreening and post scan
mood.
[Karl Friston 28 June 2000]
> When one performs a multisession fMRI analysis with SPM, in either its
> SPM96 or SPM99 incarnation, my guess is that SPM removes intersession
> effects, perhaps behind the scenes. If this is so, if each session were
> a different subject, and if one tried to use the subjects' age (rounded
> to the nearest year) as a confound in the analysis, would this result in
> a problem of linear dependence in the columns of the design matrix?
>
Yes and no. It would result in a linear dependence in the design matrix
(there will be a linear combination of "session-regressors" that equals
your "age-regressor"). It will not be a problem as long as all you want to
do is to use it as a confound (since SPM uses the generalised inverse), but
then again it would not do you any good either since the space of the
confounds is identical in both cases. You cannot use it as a covariate of
interest since it is exactly in your confound space.
In short, the confounds already modelled removes any age effects, and more.
[Jesper Anderson]
> Dear Jesper: May be I am misunderstanding something here, but I am still
> slightly puzzled at the apparent impossibility to enter age or IQ as
> covariates in an SPM fMR analysis.
> I assume it would be possible to trick the analysis into doing it by
> treating all data from one group as a single session and entering the age
> covariate for the data from each respective subject. But then
> between-session variance would probably smother any task-related effects.
You are right on the first count, one can enter data as if they were from a
single session and "trick" SPM into looking at age effects.
I very strongly suspect you are right on the second count as well,
inter-session variance originating from other sources of variance would
dominate over any "true" age effects. The question is related to one by Kris
Boksman a few days ago.
>
> Would all this mean that I can only look for age or IQ effects post hoc,
> e.g. looking at Z scores or mean signal change within ROIs etc.?
I don't really think it is meaningful in any way to look at main effect of age
using T2* weighted data. You could look at main effect of age using a
morphological technique (e.g. using T1 weighted and Voxel based morphometry) or
you could use a quantitative technique for measuring perfusion (i.e. PET or
perusion MRI).
With T2* data you may look at task-by-age interactions, i..e. how age affects
the response to a given stimuli. To do this you would generate the appropriate
contrast for each subject (say you are interested in how the difference between
conditions 1 and 3 changes with age, then you would enter the contrast [-1 0 1
...] for each subject. In "Basic models" pick "simple regression (correlation)"
and enter the resulting con*.img images as input images and enter the age of
each subject as your covariate. This will constitute a Random effects model and
will allow you to make proper population inferences.
>From your suggestion above (i.e. to look at z-scores post-hoc) I suspect it may
really have been a condition-by-age interaction you were after in the first
place. Note though that by using z-scores (rather than the linear combination
of parameter estimates offered by the con*.img images) you would be assessing
reliability of activation across subjects rather than magnitude. That is
slightly different and more akin towards a meta analysis.
[Jesper Anderson, 12 July 2000]]
> I'm analysing some PET data, and am interested in looking at regions where
> activity correlates with RT, and was wondering what was the best way to
> proceed.
> We have 6 subjects, 12 scans per subject
> When I choose the multi-subject covariates only design, there appear to be
> two ways to proceed. One is to not have covariate * subject interactions,
> to mean centre the RTs, and then to make the following contrasts: 1 to look
> at regions where activity correlates with increasing RT and -1 the converse.
> The second is to select covariate by subject interactions, and then to have
> the following contrasts: 1 1 1 1 1 1 and -1 -1 -1 -1 -1 -1.
> Could someone help explain what the differences are between these two
> analyses?
If you don't model the subject by covariate interaction, you assume that
there is a common slope of the covariate over all subjects. This saves
you some degrees of freedom, but essentially you're assuming that the
slope of these covariates is the same for each subject, if there is some
component in the observations, which can be explained by your covariate.
If you do model subject by covariate interaction, you don't make this
assumption of the same slope for each subject, but allow for fitting a
different slope for each subject. Note that this model can also be used
to generate subject specific contrast-images, which you can use as input
to a second level analysis.
[Stefan Kiebel 3 Aug 2000]
Contrasts: F-contrasts explained
> Thank for you help. I have done what you suggested, and now, I'm stuck at the
> contrast stage.
>
> > and use F-contrasts to test for mean effect and differences in the
> > epoch-related responses.
>
>
> I have four conditions and the design matrix now has 8 columns, 2 for each
> condition. I'm not used to looking at F maps. Usually, if I was comparing
> t-maps, I would enter a contrast 1 -1 0 0 if I wanted to compare condition A
> with B. Do I now enter:
> 1 1 -1 -1 0 0 0 0
> or do I look at the individual activations
> 1 1 0 0 0 0 0 0 and
> 0 0 1 1 0 0 0 0
> and then use making to look at commonalities/differences?
First use the F-contrasts computed by default in the results section -
contrast manger, under F-contrasts. These will give you the condition
specific F-contrasts. For example the responses due to condition 1
should look like:
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
To look for the differences between condition 1 and 2 use something like:
1 0 -1 0 0 0 0 0
0 1 0 -1 0 0 0 0
If you have used 'mean and decay' than you can also try the
conventional T-contrasts looking for differential respones in terms of
mean or decay. For the 'mean' it is simply:
1 0 -1 0 0 0 0 0
An F-contrast can be though of as a collection of T-contrasts, that you
wish to test jointly.
[Karl Friston 28 Jun 2000]
>I'm still struggling a little with understanding how contrasts need to be
>specified in spm99... The timecourse does not always look like I expect it to!
>I have the following blocked fmri design:
>control task control task control task
>If a set it up as one condition and use the contrast [1] then I see areas
>that are activated with respect to the control. The contrast [-1] reveals
>areas that are deactivated with respect to control.
>However, I'm interested in the task vs. control (activation) x time
>interaction. So I specified the design as 3 conditions. I thought that I
>could mask [1 1 1] (task activated wrt control) with [1 2 3] (increasing
>trend over time) or [3 2 1] (decreasing trend over time). However, the [1
>1 1] contrast appears to show regions that are both activated and
>deactivated for task wrt control. Can anyone explain this?
If I understand correctly, you are primarily interested in
time-by-condition interactions, where you have a control and a task
condition that alternate over the time-series.
I would set up the design matrix in the following way.
Your design matrix should have four othogonal covariates:
i) Control condition (control condition not modulated over time)
ii) Task condition (task condition not modulated over time)
iii) Control condition x time (control modulated by time)
iv) Task condition x time (task modulated by time)
(iii) and (iv) are simply (i) and (ii) multiplied by a trend (linear or
non-linear - see below). SPM99 implements this in the following way. If I
remember correctly, after you have entered the details of your variables,
it will ask about parametric specifications. The choices offered are
"none", "time" or "other". Your choice should be "time". The next choice
will relate to the nature of the expansion ("linear", "polynomial" or
"exponential"). I would choose "linear"as a first pass. You will then be
asked which trial types to apply the expansion to. Select both your trial
types.
If you choose to modulate both your conditions, there will be four
covariates of interest in your design matrix (first four columns). Your
contrasts will be:
1. Task > control (not over time) -1 1 0 0
2. Control > Task (not over time) 1 -1 0 0
3. Task > control (interaction with time) 0 0 -1 1
4. Control > task (interaction with time) 0 0 1 -1
This provides a flexible design matrix in which you may wish to compare
(iv) either with (iii) (control and task both change over time).
Alternatively, if there is good reason to believe that the control
condition itself remains unchanging, the time-by-condition interaction may
be found by -1 0 1 0 and 1 0 -1 0 (compare (i) with (iii)).
[Narender Ramnani 14 Aug 2000]
>>>However, I'm interested in the task vs. control (activation) x time
>>>interaction. So I specified the design as 3 conditions.
>>
>actually what I specified was block one (first presentation of
>control, task) as condition 1, block two (second presentation of the
>same control, task) as condition 2, and block three (third
>presentation) as condition 3.
Thanks. Sorry not to have worked this out first time around. Now I
think I see the idea behind of your contrasts. The contrast 1 2 3
was supposed to pick out voxels which show an increase in
task-specific activity over time. In fact, this contrast asks a
completely different question (not one that you are interested in),
i.e. is the sum of the parameter estimate for the first column, plus
twice the parameter estimate for the second column, plus three times
the parameter estimate for the third column, significantly different
from zero. A voxel which shows, for example, exactly the same
task-related activity in all three blocks (i.e. no condition by time
interaction) will show up in this contrast.
The contrast 1 0 -1, however, is beginning to get towards what you
are after. This will pick out voxels which show significantly more
task-related activity in block 1 than in block 3, suggesting a
time-dependent decrease. Similarly, contrast -1 0 1 will show voxels
which show significantly more task-related activity in condition 3
than condition 1, suggesting a time-dependent increase.
>However, if I specify it as one condition, use the parametric
>modulation with time, and then use the contrast
>0 1 0, will this tell me the task x time interaction across all of
>the scans? (ie rather than blockwise as I tried to specify it
>above)? does this tell me the interaction between areas activated
>(task wrt control) that increase with time?
Yes, it would tell you the task x time interaction across all of the
scans. This new model is more tightly constrained, in that you have
to specify the shape of the parametric modulation with time. I would
guess that you are happy with a linear model, but SPM also offers you
an exponential model and one other model too (I can't quite remember
what).
If a voxel shows a net increase in task-related activity over time,
then in the new model it should show up with the contrast 0 1 0. The
voxels which will be best fitted by the model are those in which the
increase over time is linear (e.g. one in which the task-related
activity is 1 in the first block, 2 in the second block and 3 in the
third block). However, even a voxel in which the relationship with
time is more complicated will be fitted to some extent, provided
there is an increase overall during the experiment (i.e. there is a
linear component to the relationship).
>and 0 -1 0 would tell me areas of activation that decrease with
>time? these are the two contrasts I'm interested in.
You have to be careful with use of language here. 0 -1 0 does not
tell you 'areas of activation that decrease with time', in the sense
that it would also include 'areas of deactivation which increase with
time'. The contrast shows the voxels whose task-related BOLD becomes
more negative during the experiment. The question of whether, over
the whole experiment, there is a net positive task-related signal is
an orthogonal question.
If by 'areas of activation that decrease with time' you mean voxels
which satisfy the following 2 criteria ...
1. the signal during all of the task epochs is greater than the
signal during all of the control epochs (taking the whole experiment
together (to give you 'areas of activation...'); and
2. the task-related signal becomes more negative during the course of
the experiment (to give you '...that decrease with time')
...then you should probably mask the contrast 0 -1 0 with the contrast 1 0 0
Similarly, if you wanted to find 'areas of activation that increase
with time' then you might mask the contrast 0 1 0 with the contrast 1
0 0.
[Richard Perry 14 Aug 2000]
>Dear Narender, Richard-
>aha yes!! I was using F contrasts rather than t. Suddenly these
>contrast maps look much more like what I expected them to... How do
>the F and t contrasts differ? (I can also look this one up on the
>archives..)
There's a whole lot of stuff to F contrasts and how to use them (only
some of which I understand). But briefly, in a situation like yours
the F contrast is the t contrast squared. Hence it doesn't matter
whether you use +1 or -1, the result is the same.
In general, F contrasts test whether the covariates that you specify
contribute significantly to modelling the variance, regardless of the
sign of the parameter estimate. Your contrast 0 1 (or 0 -1) was
pulling out all of the voxels within which the second covariate
explained a significant amount of the variance in the data.
[Richard Perry 15 Aug 2000]
> What would be the apropriate Contrast for three conditions A B C that
> tests for A > B & C ?
The contrast [2 -1 -1] tests if the activity in A is larger than the
mean activity in B and C. The conjunction between contasts [1 -1 0]
and [1 0 -1] tests if the activity in A is larger than the activity in
B, AND is larger than the activity in C. I suspect the latter makes a
little more sense.
[Jesper Andersson 10 Jul 2000]
> I have a simple contrast question. I have a paradigm wiht 3 conditions
> (a, b, ab). If I set a contrast of -1 -1 1 does this show me the areas
> where ab>a+b? If not what does this contrast represent?
The contrast [-1 -1 2] would show you, where ab>a+b, i.e. where ab has a
larger effect than the averaged effect due to a and b.
[Stefen Kiebel, 14 July 2000]
I'm not sure if you are working with PET or fMRI. Certainly with PET
paradigms and most fMRI paradigms, contrasts across conditions within a
group, need to total zero; i.e. they need to be balanced. It appears from
what you have written that you have three conditions a, b, and ab. If so you
need to specify contrasts across these conditions that add up to zero. So to
test for areas that are more active in b than a, you would need to enter: -1
1 0. For areas more active in ab than a AND b: -1 -1 2; which I think
answers the latter part of your query.
[Alexander Leff, 16 July 2000]
> I have a simple question (I hope). I have completed a multi-subject (6)
> multi-condition (3) fmri study. I have completed individual analysis
> and am working with a fixed effect group analysis because my degrees of
> freedom are too small. I am interested in the best method to determine
> the area(s) that are activated in the study population across all three
> conditions. In other words, what are the common areas activated across
> the three conditions in this study. If anyone has suggestions I would
> be grateful.
A conjunction analysis would be appropriate but would necessitate each
active condotion being referred to its own control, to ensure three
orthogonal contrasts. Conjunctions are specified by holding down the
'control' key during contrast selection.
[Karl]
> I have a few questions concerning conjunction analyses. I have a study
> with 9 subjects. I would like to do a conjunction
> analysis but have several questions.
>
> 1. Should corrected or uncorreted p values be used for the analysis.
> The mailbase continually refers to uncorrected p values.
>
In SPM99 a conjunction SPM comprises the minimium t values of the
component SPMs. These minimum t values have their own distributional
approximation which allows one to compute both corrected and
uncorrected p values, just like ordinary SPMs. The criteria for using
corrected or uncorrected inference is exactly the same as for any other
SPM.
> 2. In relation to question 1, should a height threshold be used. I have
> worked with SPM and realize that extent thresholds cannot be used with
> conjunction analyses.
>
The distributional approximations for the spatial extent of a
conjunction SPM are not known (at present) and therefor inference based
on spatial extent is precluded. Consequently height is currently us