Dear Mark,
thanks for the advice. I've got the problem that my 2 Honours students need to submit their honours thesis in 2.5 weeks and that we're stuck in the higher-level analysis (over FLOBS used in first-level analysis). I realise it's maybe already too late, but I'll give this one more shot, in the hope that my students can report some portion of the data.
However, at this stage, I would need some very detailed information (about how to bring the zfstats from the first-level analysis to the higher-level analyses). [I'm more than happy to pay the standard consultant fee of AUD 150/hour for anyone who's able and willing to help me quickly with this.]
So: I have so far registered some zfstat images to standard space using the the ApplyXFM gui; I tried many different things and figured out that this is probably the correct way to do it(?):
transformation matrix: example_func2standard.mat
input image: thresh_zfstat1.nii.gz [tried the zfstat.nii.gz from the stats folder as well]
reference volume: MNI152_T1_2mm_brain.nii.gz
-- I tried the advanced options in the ApplyXFM gui both with 'force data output to be floating point' and without.
A first important question would be: Should I take thresh_zfstat.nii.gz or the zfstat1.nii.gz (from the stats folder)?
Computing the sum(zfstat)/sqrt(n) shouldn't be a problem; I've got 4 runs -- to combine them in an analogue of a FE analysis, I envisage doing something like that with the registered zfstat images (let's label them 'zfstat_stand');
fslmaths zfstat1_stand.nii.gz -add zfstat2_stand.nii.gz -add zfstat3_stand.nii.gz -add zfstat4_stand.nii.gz added_zfstats_stand.nii.gz
fslmaths added_zfstats_stand.nii.gz -div 2 divs_zfstats_stand.nii.gz
-- correct?
Now I had the problem that I couldn't enter the results into a higher-level analysis. I used the Feat Gui, tried to simply average the zfstats (registered to standard space, etc.) with FLAME1, and chose cope images as input files. But FEAT always crashed in the higher-level input files preparation.
When I took the images resulting from applyxfm when output data format float was enforced, I got the following error message in feat (image file preparation):
mean_func /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/reg_standard/mean_func /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S1/DIM2_FLOBS.feat/reg_standard/mean_func
/root/fsl/bin/fslmaths mean_func -Tmean mean_func
syntax error in expression "1 + zfstats_stand_div": variable references require preceding $
while executing
"expr 1 + $copenumber "
(procedure "feat5:proc_gfeatprep" line 267)
invoked from within
"feat5:proc_gfeatprep "
("-gfeatprep" arm line 2)
invoked from within
"switch -- [ lindex $argv $argindex ] {
-I {
...
When I used the images where I had NOT enforced output data format float, I got the following error (in feat, file image preparation).
/root/fsl/bin/fslmaths mean_func -Tmean mean_func
syntax error in expression "0 + ": premature end of expression
while executing
"expr $mean_lcon + $mean_lcon_incr "
(procedure "feat5:proc_gfeatprep" line 272)
invoked from within
"feat5:proc_gfeatprep "
("-gfeatprep" arm line 2)
invoked from within
"switch -- [ lindex $argv $argindex ] {
...
Then I tried renaming the images (resulting from fslmaths) cope11.nii.gz, etc..., but with these images, FEAT ignored that I had selected the higher-level cope images as inputs to the higher-level analysis, and simply replaced the inputs with the following:
1 /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/report.html
2 /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S2/DIM1_FLOBS.feat/report.html
That wasn't at all what I had intended, so I stopped that analysis.
I then tried re-naming my averaged zfstats 'cope1.nii.gz' (in the hope that FEAT would take the cope1 as a default and would then analyse my zfstats). As before, FEAT did not accept the copes but took as input:
1 /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/report.html
...
4 /mnt/hgfs/G/MRI/MRI_Jessie/Data/Converted/S2/DIM1_FLOBS.feat/report.html
I think FEAT then took the original cope-files from the first-level analysis that I had renamed 'cope1xxx'. At least I found a reference to this in the log-file (FEAT higher-level input file preparation):
/root/fsl/bin/flirt -ref reg/standard -in stats/cope1xxx -out frgrot_yaCSvH -applyxfm -init reg/example_func2standard.mat -interp trilinear -datatype float
The analysis is still running (seems to be hanging on the varcope = /root/fsl/bin/fslmaths varcope1 -mas mask varcope1), but even if it completes, I guess that didn't work out.
What I in fact need to do is something like a random-effects analysis comparing the averaged zfstats between different within-subjects conditions. Each subject provided data in 2 blocked conditions that consisted of 4 runs each; the DIM-condition is one condition; let's call the other condition XDIM. We're interested in brain regions that are more active in a specific condition of DIM (EV1, EV2 = 1, -1) than in a specific condition of XDIM (EV1, EV2 = 1, -1) and vice versa. The contrasts 1 -1 were computed at the first level using FLOBS (resulting in zfstat1). Now I would like to average these data across the 4 runs for each subjects (that's done with sum(zfstat)/sqrt(n)).
After that, I need to combine the data from different subjects and conditions, comparing 'EV1>EV2' across the DIM and XDIM conditions -- at this stage I'm not sure whether I should be using FLAME1 for this; in one thread it was said that, with multiple basis functions and zfstats, a random-effects analysis could be approximated with an OLS analysis. So should I be using OLS instead?
In any case, the main problem is that I can't get FEAT to accept the averaged zfstats as inputs to any higher-level analysis. (At this stage, and for the Honours theses, I'm not too concerned about choosing the statistically most appropriate analysis.)
Any help will be greatly appreciated!
Thanks,
Stefanie
***************************************************
Dr. Stefanie I. Becker
School of Psychology
McElwain Building, Room 203
The University of Queensland
St Lucia, QLD 4072
Australia
email: [log in to unmask]
mobile: +61 449 883 870.
homepage: www.sibecker.de
________________________________________
From: FSL - FMRIB's Software Library [[log in to unmask]] On Behalf Of Mark Jenkinson [[log in to unmask]]
Sent: Thursday, 22 September 2011 8:24 PM
To: [log in to unmask]
Subject: Re: [FSL] Fixed effects with FLOBS? and FLIRT-Error
Dear Stefanie,
The first error looks like you've mistyped the name of the file as it is constantly
complaining about "MNI152T_1_2mm_brain" rather than "MNI152_T1_2mm_brain"
(note that T_1 should be _T1). In your command line it looks correct, but maybe
that is because you retyped it into the email and inadvertently fixed it?!? It is hard
to be sure. However, your command line is still not good, as you need to specify
other options - specifically -applyxfm, -init and -out. Have a look at the example
usages in the documentation:
http://www.fmrib.ox.ac.uk/fsl/flirt/examples.html
I would also advise looking at the FSL Course material if you are this unfamiliar
with how things work.
The other error I suspect is to do with the that that you seem to have chosen
a filename of "1" which is very strange and may be misinterpretted as a number
rather than a name at some point. It is a very odd error though, so I would try
and get the command line working instead.
I'm assuming that you've run registration in your original FEAT analysis, in
which case you need to be using the example_func2standard transformations
in the *.feat/reg directory. Again, look at the FSL Course material and the FEAT
documentation for more help about this.
All the best,
Mark
On 22 Sep 2011, at 09:51, Stefanie Becker wrote:
> Hi,
>
> thanks for the response! And sorry for the confusion with FLOBS vs. canonical HRF; I've used FLOBS to analyse my data from separate runs, and I would like to average the results from the combined basis functions, or zfstats ('C1&C2&C3') across runs. Now, I've tried to register the corresponding zfstat1.nii.gz to standard space (only linear registration), but wasn't able to do it.
>
> First, I used flirt from the terminal window:
>
> flirt -in /mnt/hgfs/F/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/thresh_zfstat1.nii.gz -ref /root/fsl/data/standard/MNI152_T1_2mm_brain
>
> ... but I got the following errors:
>
> ** ERROR (nifti_image_read): failed to find header file for '/root/fsl/data/standard/MNI152T_1_2mm_brain'
> ** ERROR: nifti_image_open(/root/fsl/data/standard/MNI152T_1_2mm_brain): bad header info
> ERROR: failed to open file /root/fsl/data/standard/MNI152T_1_2mm_brain
> ERROR: Could not open image /root/fsl/data/standard/MNI152T_1_2mm_brain
> Image Exception : #22 :: Failed to read volume /root/fsl/data/standard/MNI152T_1_2mm_brain
> terminate called after throwing an instance of 'RBD_COMMON::BaseException'
> FE_bash.sh: line 11: 30613 Aborted
>
>
> Second, I tried using FLIRT from the FEAT GUI;
> [/root/fsl/bin/flirt -in /mnt/hgfs/F/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/thresh_zfstat1.nii.gz -ref /root/fsl/data/standard/MNI152_T1_2mm_brain -out -omat 1.mat -bins 256 -cost corratio -searchrx -180 180 -searchry -180 180 -searchrz -180 180 -dof 12 -interp trilinear]
>
> but here the error message said:
> Unrecognised option 1
>
> I got the same error when I tried to register the zfstat to my T1-weighted, brain-extracted image:
> /root/fsl/bin/flirt -in /mnt/hgfs/F/MRI/MRI_Jessie/Data/Converted/S1/DIM1_FLOBS.feat/thresh_zfstat1.nii.gz -ref /mnt/hgfs/F/MRI/MRI_Jessie/Data/Converted/S1/T1_brain.nii.gz -out -omat 1.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12 -interp trilinear
> Unrecognised option 1
> Finished
>
> Any idea what's going wrong here?
> Also, in general, should I register the zfstat directly to standard space, or should I first register it to the T1-image?
>
> Thanks a lot in advance!
> Stef
> ________________________________________
> From: FSL - FMRIB's Software Library [[log in to unmask]] On Behalf Of Stephen Smith [[log in to unmask]]
> Sent: Thursday, 22 September 2011 5:31 PM
> To: [log in to unmask]
> Subject: Re: [FSL] Fixed effects with FLOBS?
>
> Hi - yes if you have done an F-test across the FLOBS basis functions you can resample the zstats or fstats into standard space and feed that into randomise.
> You can use the ApplyXFM GUI to resample the stats into standard space - though if you used nonlinear registration you would need to do this on the command line.
>
> However - the main question is that I'm confused that you're talking about both FLOBS and canonical HRFs - these are two distinct HRF options so I'm not sure quite what you've done...
>
> Cheers.
>
>
>
>
>
> On 20 Sep 2011, at 18:24, Stefanie Becker wrote:
>
>> Hi,
>>
>> I sent two messages to the list that don't appear in the September thread -- not sure what happened there.
>> I'll try again: I've got the problem that I need to combine data in a fixed effects analysis based on FLOBS, and I'd like to use the canonical HRF regression PEs. According to the posts, back in 2008, there was no simple solution to this problem, as the first-level analysis doesn't produce copes for the canonical HRF, only the single basis functions.
>>
>> Is there a simple solution now? If not, can I resample the zfstats into standard space and average across them using the function sum(z)/sqrt(n)?
>> This solution was suggested as an analogue to a fixed effects analysis in an earlier thread... but is it then possible to use the output for a third-level ME analysis comparing between different conditions?
>> And if yes, what function do I have to use for the resampling and averaging?
>>
>> THANKS!!!
>>
>> Stefanie
>>
>
>
> ---------------------------------------------------------------------------
> 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
> ---------------------------------------------------------------------------
|