Hi,
On 20 Aug 2007, at 18:34, Sophie Anisa wrote:
> Hi, I have a problem with analysing a slightly complicated design in
> FEAT and would
> like some advice about FEAT internals.
>
> Main question. Is it possible *in principle* to set up a third level
> model in FEAT which
> takes its inputs from a mixture of 1st level COPES and 2nd level
> COPES?
>
>
> (1) Background. I have a design that looks like this
>
> Subject TASK Run Repeat
> 1 A 1
> 1 B 1
> 2 A 1
> 2 B 1
> 2 A 2
> 2 B 2
> 3 A 1
> 3 B 1
> 3 A 2
> 3 B 2
> ...
> etc
>
> In other words all subjects *except* the first subject do 2 runs of
> task A and 2 runs of task B. But subject 1 did only 1 run of task A
> and task B.
>
> I have previously analysed this data set using v3.3 of FEAT and
> following the instructions for
> the 3 level multisubject multisession design using a 2nd level
> analysis to model the cross
> session variance. This worked fine. I suppose I should have stopped
> when I was ahead but
> alas I did not. Eager to see what surprises awaited me I then tried
> reananlysing (using v3.3) the data with the new advice now given for
> FSL v4 on multisubject multisession designs. I created new 2nd level
> FE analyses for all subjects (*except* subject 1) using a higher level
> FE design to combine the 2 runs for task A and the 2 runs for task B.
>
> At this stage I have
>
> Subject Task FEAT Level
> 1 A 1
> 1 B 1
> 2 A 2
> 2 B 2
> 3 A 2
> 3 B 2
> ..
> etc
>
>
> (2) Firstly, I tried to combine these at third level (e.g. simple
> group average for task A) by
> using as input FEAT dirs:
>
> subject1_A.feat
> subject2_A.gfeat
> subject3_A.gfeat
> etc
>
> This fails with "Error - registration has not been run" for all inputs
> after subject 1.
> Clearly, this is a wrong thing to do.
>
> Q: I assume at this point that I cannot use the above option of using
> "lower level FEAT dirs" because there is a mismatch between the two
> levels?
>
> Subjects 2 onwards are level 2 .gfeat analyses. Inside these
> directories
> are cope1.feat etc that relate only to EV 1, whereas the subject 1
> level 1 .feat
> directory contains all the stats/cope images and reg_standard/stats/
> cope images.
> So I assume it also makes no sense to setup a 3rd level model with
> inputs:
>
> subject1_A.feat
> subject2_A.gfeat/cope1.feat
> subject3_A.gfeat/cope1.feat
> etc?
>
> Thus, it seems I need to use as input type "3D COPE images from
> FEAT dirs"
> Q: I hope all my assumptions and logic are correct so far?
Yes - I would select copes as input here not FEAT directories.
> (3) I then set up a third level model for the simple group average for
> EV1 in task A by
> using as inputs the COPEs
>
> subject1_A.feat/stats/cope1.nii.gz
> subject2_A.gfeat/cope1.feat/stats/cope1.nii.gz
> subject3_A.gfeat/cope1.feat/stats/cope1.nii.gz
>
> and ran this. It *appeared* to work and produced rendered images
> (but see below)
>
>
> (4) Encouraged, I went on and reran my more complicated 2x3
> factorial design
> that I have previously emailed you about:
> http://www.jiscmail.ac.uk/cgi-bin/webadmin?
> A2=ind0707&L=FSL&P=R40723&I=-3
>
> Although this *appeared* to run, the rendered stats images showed no
> activation - completely different to the previous analysis I had run
> using the earlier recipe for multisubject multisession analysis that
> the FSL web page showed. Digging into the
> log files showed multiple errors like this in cope1.feat/report.log:
>
> /usr/local/fsl/bin/avwroi tdof_filtered_func_data tmptdof9 0 91 0
> 109 9 1
>
> /usr/local/fsl/bin/flame --cope=tmpcope9 --vc=tmpvarcope9
> --dvc=tmptdof9 --mask=tmpmask9 --ld=stats9 --dm=design.mat
> --cs=design.grp --tc=design.con --fc=design.fts --ols --nj=10000
> --bi=500 --se=1 --fm
> --zlt=2.25 --zut=2.65
> Log directory is: stats9
> Setting up:
> nevs=21
> ntpts=96
> ngs=1
> nvoxels=88
> Running:
> nmaskvoxels=2
> njumps = 10000
> burnin = 500
> sampleevery = 1
> nsamples = 9500
>
> Metropolis Hasting Sampling
> Number of voxels=2
> Percentage done:
> 1
>
>
> An exception has been thrown
> Logic error:- detected by Newmat: index error: requested index = 91
>
> MatrixType = Rect # Rows = 90; # Cols = 1
>
>
> After digging into this further, I found the problem was that the
> tdof_filtered_func_data.nii.gz file in the cope1.feat subdir was the
> wrong size.
> I have 16 subjects, and there are 6 COPES in this experiment. I
> therefore expect
> the intermediate merged files in the gfeat/cope1.feat dirs to have
> 16*6 = 96 vols.
>
> And indeed this is the case for merged cope and varcope files:
>
> avwinfo filtered_func_data.nii.gz | grep "^dim4"
> dim4 96
> avwinfo var_filtered_func_data.nii.gz | grep "^dim4"
> dim4 96
>
> but not for the tdof file:
>
> avwinfo tdof_filtered_func_data.nii.gz | grep "^dim4"
> dim4 90
>
> Q: Is this a bug or am I doing something wrong?
> If so, what is the correct way of doing this?
Aha - here's an idea - for all the first-level FEATs that you wanted
to use directly into the third-level, just convert them into second-
level by running a FE second-level analysis - eg if you have 4 of
them, use a single FE-based second-level run:
EVs = [
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
]
contrasts=[
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
]
I just checked that this runs fine, and then hopefully your 3rd level
should now run fine.
Cheers.
>
>
> (5) Finally, as sanity check I have:
>
> (a) gone back to my simple group analysis explained in (2) above
> and looked at
> it more carefully. The tdof mismatch is here too, and has
> presumably corrupted
> my final output stats, but oddly it did not create any errors in the
> report.log file.
>
> filtered_func_data.nii.gz dim4 16
> var_filtered_func_data.nii.gz dim4 16
> tdof_filtered_func_data.nii.gz dim4 15
>
>
> (b) rerun the factorial model using FSLv4 (FEAT 5.90). This causes
> similar
> errors to be reported in cope1.feat/report_log.html
>
> usr/local/fsl4/bin/flame --cope=tmpcope0 --vc=tmpvarcope0
> --dvc=tmptdof0 --mask=tmpmask0 --ld=stats0 --dm=design.mat
> --cs=design.grp --tc=design.con --fc=design.fts --ols
> --nj=10000 --bi=500 --se=1 --fm --zlt=2.25 --zut=2.65
>
> An exception has been thrown
> Logic error:- detected by Newmat: index error: requested index = 91
>
> MatrixType = Rect # Rows = 90; # Cols = 1
> Trace: Mcmc_Mh::setup; Gsmanager::run.
>
> And once again the volume sizes of the merged files are out of sync:
>
> filtered_func_data.nii.gz dim4 96
> var_filtered_func_data.nii.gz dim4 96
> tdof_filtered_func_data.nii.gz dim4 90
>
> It appears that the problem comes in the creation of the merged
> tdof_filtered_func_data file. On creation of this file, the FEAT
> analysis silently
> drops the tdof volumes that should have been present from subject 1,
> without any
> warnings being generated. Presumably these are not created for first
> level analyses,
> and this is the real origin of the problem? In which case, I refer
> back to my original
> question about whether one can mix COPEs from different levels? And
> if so, how
> best to do it?
>
> Apologies for the long email but I hope I have explained the
> problem clearly.
> Please advise!
>
>
> kind regards
>
> Sophie
------------------------------------------------------------------------
---
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director, Oxford University FMRIB Centre
FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
+44 (0) 1865 222726 (fax 222717)
[log in to unmask] http://www.fmrib.ox.ac.uk/~steve
------------------------------------------------------------------------
---
|