Conjunction analysis and posthoc contrasts in GLM_Flex_Fast4

155 views
Skip to first unread message

Olga Kurakova

unread,
Aug 10, 2018, 9:07:34 AM8/10/18
to Aaron's fMRI matlab tools.
Hi Aaron,

I am trying to do a conjunction analysis as following.

I have a single group of participants who performed 3 tasks, and I am interested in areas that consistently show significant activation in all the tasks. According to previous discussions here (https://groups.google.com/forum/#!msg/fmri_matlab_tools/pfrufbmHQhI/AkCbUliPrC8J) and in SPM mailing list (https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=spm;bf2b3882.1309), there are two ways to do this:

1) run 3 separate one-sample t-tests in SPM; 
2) use GLM_Flex to run a single model for all 3 tasks.

Using each way, one can get 3 group activation maps (one for each condition), then threshold and binarize them and finally overlap with Imcalc (i1.*i2.*i3). 

If I understand it correctly, the second way (using GLM_Flex) is the preferred one, as it accounts for the within-subject variability and allows to build mixed-effect models.

I tried to do this analysis in Fast4 (version included in MRtools_2018-03-17.zip), but have troubles with posthoc contrasts in mixed-effect model. My script is the following:


Scans = dir_wfp('/path_to_data/*.nii');

clear dat
dat.fn = [];
dat.Condition = [];
dat.SS = [];

for ii = 1:numel(Scans)
    [a, b, c] = fileparts(lower(Scans{ii}));
    tmp = regexp(b,'_','split');
    dat.fn{ii,1} = Scans{ii};
    dat.SS{ii,1} = tmp{7};
    dat.Condition{ii,1} = tmp{6};
end

clear I;
I.Scans = dat.fn;
I.Model = 'Condition + random(SS|Condition)';
I.Data = dat;
I.OutputDir = '/path_to_rand_model';
I.RemoveOutliers = 0;
I.DoOnlyAll = 1;
I.KeepResiduals = 1;
I.estSmooth = 1; 

I.PostHocs = {'Condition$cond1' 'cond1';
              'Condition$cond2' 'cond2';
              'Condition$cond3' 'cond3'};          

GLM_Flex_Fast4(I);
FIVE;


This produces an error:

Index exceeds matrix dimensions.
Error in GLM_Flex_Fast4 (line 866)
        fileNames{jj} = regexprep(fileNames{jj},':','_x_');

When I set I.DoOnlyAll = 0, the script runs without errors, but the resulting files with contrasts are empty (NaNs only).

However, when I try to run a fixed-effect model I.Model = 'Condition' with I.DoOnlyAll = 1, it works fine and produces the results rather similar to those I get with separate t-tests in SPM. But in this model the within-subject variability is not accounted for.

I would be very grateful if you could help with setting the correct contrasts for mixed-effect model, or point me to what I am doing wrong.
Thank you!

Best wishes
Olga

Aaron Schultz

unread,
Aug 20, 2018, 10:26:35 AM8/20/18
to Aaron's fMRI matlab tools.
My guess is that there is something wrong with the data specification for the model.  I would ensure that each subject has all three conditions, as this model, and those post hocs should run.  Also check the the size of your data structure matches the number of input images. 

Let me know if you are still having issues.

-Aaron
Reply all
Reply to author
Forward
0 new messages