Mensen / ept_TFCE-matlab

Advanced EEG Statistics
27 stars 9 forks source link

Time frequency clusters #16

Open manvincent opened 6 years ago

manvincent commented 6 years ago

Hi Armand,

Great toolbox and paper- thanks for putting this out for us all!

I hope I didn't missing something in the documentation, but I was wondering how to set up your scripts to conduct TFCE in time-frequency space? I've had success with both channel time (e.g. 80 subjects 64 channels 36 time samples), as well as channel frequency (e.g. 80 subjects 64 channels 8 frequency bins). This latter analysis was for some second level data, and I had already aggregated over time samples at the first level. In both cases I ran repeated measures ANOVA on a 2x2 design.

I'd like to do use a TFCE approach to data in time frequency space for the same design. So for each of say 40 subjects, I have one average time-frequency (36 time samples * 50 frequency bins) matrix per condition, and would like to run a similar 2x2 repeated measures ANOVA on these time-frequency matrices.

My question is how set up the script since I now no longer have 64 channels as a dimension in the matrix? I've been using the ept_TFCE_ANOVA.m function and it looks like I need to feed in a location file.

Thank you very much! Vince

Mensen commented 6 years ago

Hi Vince,

So in this case it would just be a single channel (or some average)?

You can do this by specifying as an input, that this is specifically just time-frequency using the option 'flag_tf' and setting this to 1. This can really only be done using the command line version.

This will then ignore the locations (you can leave that input empty '[]' ).

I'm not sure I've ever run this with the ANOVA version (as opposed to just the simple T-test comparisons)... so let me know if this looks okay and works... otherwise I might have to make some relatively minor changes to the scripts.

Good luck! Armand

manvincent commented 6 years ago

Hi Armand,

Awesome, I will try that right away (yup, it's an average of a few channels). Thank you for such a fast response! I'll post here about how it goes.

Cheers, Vince

manvincent commented 6 years ago

Hi Armand,

It doesn't seem to work with the ept_TFCE_ANOVA.m function -- I poked around in the script and it doesn't look like that function takes the flag parameter. I tried to bring over the code from ept_TFCE.m that invovles 'flag_ft' but got a bit lost- it looks like you're artificially creating a dimension to sub in the channel space?

% if data is not in channel neighbourhood % artificially create 3rd dimension T_Obs = repmat(T_Obs, [1, 1, 2]); deltaT = max(abs(T_Obs(:)))/50; TFCE_Obs = ept_mex_TFCE(T_Obs, deltaT); % remove extra dimension T_Obs = T_Obs(:, :, 1); TFCE_Obs = TFCE_Obs(:, :, 1);

It looks like T values are being computed here - not sure how to translate this into the repeated measures ANOVA. Can I trouble you to take a look?

Thanks again, Vince