Hi Anderson, On returning to this to add my F-tests, I noticed that Flameo also generates "zfstat" files that appear to correspond to the fstat files. So that means maybe I don't need to manually convert the F-tests to Zstats using ftoz myself before running cluster correction? However, when I use these Flameo generated files with cluster vs. my own generated fzstat files, I get totally different thresholding results. For example, when I manually use ftoz, using the degrees of freedom, I get rather large clusters surviving for all 4 of my f-tests. When I run cluster with the Flameo generated zfstat files, I get virtually no clusters across all 4 f-tests (at the same t=3.1 and p0.01 threshold). So I am confused, because in theory they should be the same exact data, and therefore yield the same exact clusters. Can you please provide some insight as to (a) whether I am doing the ftoz wrong or (b) whether the zfstat represents something else, that I shouldn't use? Thanks! see my code below, in case helpful. Michelle ############# STEP 1 ############ #get smoothness estimates for the whole brain using mask #DOF for design 3 = 225 - 83 = 142 smoothest -d 142 -r res4d.nii.gz -m mask.nii.gz >> cluster_correction/smoothness_output_wholebrain_mask.txt ########## STEP 2 convert your F stat files ######### foreach f(1 2 3 4) # convert F test into Z test for design 1 # note sure if i need to do this... . # number of columns in F test contrast = 24 # number of rows in contrasts = 142 ftoz -zout fzstat${f}_converted fstat${f} 24 142 #mask zstat image using ANATOMICAL brain mask # "fzstat converted" version is the file I generated using ftoz # "zfstat" version is the Flameo generated file fslmaths zfstat${f}.nii.gz -mas mask.nii.gz zfstat${f}_mask.nii.gz fslmaths fzstat${f}_converted -mas mask.nii.gz fzstat${f}_converted_mask.nii.gz end ############# STEP 3 ############ #####cluster-wise hypothesis testing for voxels passing threshold tcd cl #REQUIRES GETTING INPUTS FROM SMOOTHEST FILE #DLH 0.0444563 #VOLUME 226501 #RESELS 104.047 cd cluster_correction/ foreach f (1 2 3 4) # for "zfstat" version Flameo generated file cluster -i ../zfstat${f}_mask.nii.gz -t 3.1 -o zfstat${f}_corrected_clusters_3.1_p.01 -d 0.044 --volume=226501 -p .01 --othresh=fsztat${f}_corrected_thresh_3.1_p.01.nii.gz > cluster_info_wholebrain_3.1_fzstat${f}_corrected_p.01.txt # for "fzstat converted" - my version generated using ftoz cluster -i ../fzstat${f}_converted_mask.nii.gz -t 3.1 -o fzstat${f}_converted_corrected_clusters_3.1_p.01 -d 0.044 --volume=226501 -p .01 --othresh=fzstat${f}_converted_corrected_thresh_3.1_p.01.nii.gz > cluster_info_wholebrain_3.1_fzstat${f}_converted_corrected_p.01.txt end On Mon, Dec 12, 2016 at 11:13 AM, Anderson M. Winkler < [log in to unmask]> wrote: > Hi Michelle, > > One correction: the dof1 should be the dof of the numerator, so you'd swap > the first and second values. > > All the best, > > Anderson > > > On 9 December 2016 at 11:11, Anderson M. Winkler <[log in to unmask]> > wrote: > >> Hi Michelle, >> >> Yes, the conversion is right. Re: large design, I'm not sure if there is >> a script that would do it... sorry. >> >> All the best, >> >> Anderson >> >> >> On 8 December 2016 at 18:02, Michelle VanTieghem < >> [log in to unmask]> wrote: >> >>> Hi Anderson, >>> >>> So If I have 24 rows of my design1_contrast.con file, and then 24 >>> columns of my ftest file, then the numerator of df is 24, correct? >>> >>> ftoz -zout fzstat fstat1 134 24 >>> >>> Would give me the correctly converted Z statistic for my F-tests? >>> >>> Also, you recommended using FEAT instead of the command line. Did you >>> mean setting it up in the FEAT gui? I haven't been doing that because the >>> FEAT gui freezes when I try to enter this model, because it has so many >>> EVs. I cannot get a work around so that this doesn't happen. If you have >>> any suggests I would greatly appreciate! >>> Alternatively, is there a way to hand-make the .fsf file without having >>> to open the GUI to enter my design? Can I use a .fsf file to only perform >>> cluster thresholding on the f-test files? >>> >>> Thanks! >>> >>> On Thu, Dec 8, 2016 at 5:33 AM, Anderson M. Winkler < >>> [log in to unmask]> wrote: >>> >>>> Hi Michelle, >>>> >>>> F-tests have the same DOF as the t-test (for the denominator). For the >>>> numerator, the t test has always df=1 (usually omitted) and the F-test has >>>> DOF that is the same as the number of lines in the contrast (e.g., for a >>>> simple 3 group comparison with or without nuisance variables, it's 2). >>>> >>>> All the best, >>>> >>>> Anderson >>>> >>>> >>>> On 7 December 2016 at 18:31, Michelle VanTieghem < >>>> [log in to unmask]> wrote: >>>> >>>>> Hi Anderson, >>>>> >>>>> Also, how do I determine the DOF for my F-tests? >>>>> For the z-tests I was using # rows in the design - # of columns (207 - >>>>> 77 = 134) >>>>> However, I'm having trouble thinking about what it should be for >>>>> Ftests since this is a mixed effects design... >>>>> thanks, >>>>> Michelle >>>>> >>>>> On Wed, Dec 7, 2016 at 8:39 AM, Michelle VanTieghem < >>>>> [log in to unmask]> wrote: >>>>> >>>>>> Hi Anderson, >>>>>> >>>>>> Do you mean setting it up in the FEAT gui? I haven't been doing that >>>>>> because the FEAT gui freezes when I try to enter this model, because it >>>>>> has so many EVs. Is there a way to use an .fsf file without having to open >>>>>> the GUI to enter my design? Can I use a .fsf file to only perform cluster >>>>>> thresholding on the f-test files? >>>>>> >>>>>> Thanks! >>>>>> M >>>>>> >>>>>> On Wed, Dec 7, 2016 at 2:55 AM, Anderson M. Winkler < >>>>>> [log in to unmask]> wrote: >>>>>> >>>>>>> Hi Michelle, >>>>>>> >>>>>>> You'd use ftoz to convert to a z-score map. That said, if you'll use >>>>>>> the random field theory for inference, it might be much simpler and less >>>>>>> error-prone to simply use FEAT. It does everything for you and you don't >>>>>>> have to worry about these commands. >>>>>>> >>>>>>> All the best, >>>>>>> >>>>>>> Anderson >>>>>>> >>>>>>> >>>>>>> On 6 December 2016 at 21:33, Michelle VanTieghem < >>>>>>> [log in to unmask]> wrote: >>>>>>> >>>>>>>> Hi Anderson, >>>>>>>> >>>>>>>> Ok great thanks. I have run the f-tests. Now I would like to use >>>>>>>> smoothest and cluster in order to identify significant clusters of >>>>>>>> activation for F4, the Group x Emotion interaction. However, cluster, as >>>>>>>> far as I can tell from the information on FSL wiki, is used with zstat >>>>>>>> files. >>>>>>>> Can I do the same exact thing, but replace zstat files (of a >>>>>>>> specific contrast) with the fstat files (to test the omnibus interaction)? >>>>>>>> When testing F-tests in cluster, does make sense to use a t- >>>>>>>> threshold (e.g. 3.1)? >>>>>>>> I would think there should be F threshold, but that doesn't appear >>>>>>>> to be an option in cluster.... >>>>>>>> Here is an example of what I would like to do: >>>>>>>> >>>>>>>> smoothest -d 134 -r res4d.nii.gz -m mask.nii.gz >> >>>>>>>> cluster_correction/smoothness_output_wholebrain_mask.txt >>>>>>>> >>>>>>>> fslmaths fstat4.nii.gz -mas mask.nii.gz >>>>>>>> cluster_correction/fstat4_mask.nii.gz >>>>>>>> >>>>>>>> cluster -i fstat4_mask.nii.gz -t 3.1 -o fstat4_clusters_3.1 -d >>>>>>>> 0.043 --volume=234781 -p .05 --othresh=fstat4_thresh_3.1.nii.gz > >>>>>>>> cluster_info_wholebrain_3.1_fstat4.txt >>>>>>>> >>>>>>>> I appreciate any input! >>>>>>>> Thank you, >>>>>>>> Michelle >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Michelle VanTieghem >>>>>> PhD student in Psychology >>>>>> Developmental Affective Neuroscience Lab >>>>>> Columbia University >>>>>> [log in to unmask] >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Michelle VanTieghem >>>>> PhD student in Psychology >>>>> Developmental Affective Neuroscience Lab >>>>> Columbia University >>>>> [log in to unmask] >>>>> >>>> >>>> >>> >>> >>> -- >>> Michelle VanTieghem >>> PhD student in Psychology >>> Developmental Affective Neuroscience Lab >>> Columbia University >>> [log in to unmask] >>> >> >> > -- Michelle VanTieghem PhD student in Psychology Developmental Affective Neuroscience Lab Columbia University [log in to unmask]