Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ft_freqstatistics for EEG data (cluster correction) #519

Closed
DCP-INS opened this issue Sep 11, 2017 · 7 comments
Closed

ft_freqstatistics for EEG data (cluster correction) #519

DCP-INS opened this issue Sep 11, 2017 · 7 comments

Comments

@DCP-INS
Copy link

DCP-INS commented Sep 11, 2017

Hi,
I would like to use the Fieldtrip function ft_freqstatistics to perform cluster statistics at the channel level on frequency-resolved (but not time-resolved) EEG data (63 channels), comparing 2 conditions. For each participant and condition the data have the following size: 63x2x20 (channels/time/frequency). When I run the process, even with only 2 participants (and 100 permutations), I obtain after 2 minutes a Java exception (OutOfMemoryError).
I run the process on a mac book pro 2016 (3,1 GHz Intel Core i7). I have a java heap size of 4,096MB on MATLAB.
This exception does not occur if I use another type of correction (bonferroni, fdr...).

Might you please help me to resolve this issue ?
Please find enclosed the input data (cfg = statcfg, and the 2*2 (2 participants * 2 conditions) data = ftAllFiles): thedata.mat.zip

thank you,
Benjamin Morillon

ps: the info appearing on the Matlab screen when I run the process:
the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 9 MB
using "ft_statistics_montecarlo" for the statistical testing
using "ft_statfun_depsamplesT" for the single-sample statistics
constructing randomized design
total number of measurements = 4
total number of variables = 2
number of independent variables = 1
number of unit variables = 1
number of within-cell variables = 0
number of control variables = 0
using a permutation resampling approach
repeated measurement in variable 2 over 2 levels
number of repeated measurements in each level is 2 2
computing a parametric threshold for clustering
computing statistic
estimated time per randomization is 0.07 seconds
computing statistic 100 from 100

@ftadel
Copy link
Contributor

ftadel commented Sep 15, 2017

How are we supposed to reproduce your error?
If I load your file and run: ft_freqstatistics(statcfg, ftAllFiles{:}), it works with fieldtrip-20170809 on windows 10.
Which version of FieldTrip are you using?
Have you tried on a different computer?

@DCP-INS
Copy link
Author

DCP-INS commented Sep 15, 2017

Thanks, François, for your reply. That's what I wanted to know (files are good, it should work as is). I'll thus download the last version (I had 20170401) and try on a different computer.
cheers

@DCP-INS DCP-INS closed this as completed Sep 15, 2017
@DCP-INS DCP-INS reopened this Sep 15, 2017
@DCP-INS
Copy link
Author

DCP-INS commented Sep 15, 2017

Hi again,
After installing the last version, I obtain the following error, seemingly linked to the function spm_bwlabel (see below). Do you have by chance any idea of the underlying issue ?
thanks
bn

Error in findcluster (line 90)
[labelmat(spatdimlev, :, :), num] =
spm_bwlabel(double(reshape(onoff(spatdimlev, :, :), nfreq, ntime)), 6); % the
previous code contained a '4' for input

Error in clusterstat (line 197)
posclusobs = findcluster(reshape(postailobs,
[cfg.dim,1]),channeighbstructmat,cfg.minnbchan);

Error in ft_statistics_montecarlo (line 347)
[stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_freqstatistics (line 193)
[stat, cfg] = statmethod(cfg, dat, design);

@robertoostenveld
Copy link
Contributor

which version of fieldtrip are you using (which date or which git version code), which version of MATLAB are you using and on which operating system are you running this?

@robertoostenveld
Copy link
Contributor

and what is the exact (and full) error message that you see on screen?

@DCP-INS
Copy link
Author

DCP-INS commented Sep 17, 2017

Hi,
Thanks for your reply.
I am using fieldtrip 20170914 on Matlab R2017a, on a macOS system (sierra 10.12.4).
The error message is so long that I can't grab it all. Basically it's associated with the compilation of mex files related to the function spm_bwlabel (called in findcluster.m, l.90). Attached is copy/pasted the portion of the error message: errormessage copy.docx

that I can retrieve.
Thank you,
Benjamin

@robertoostenveld
Copy link
Contributor

I suppose you are running into something like this http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3330.

SPM mex files are in external and not maintained by the FieldTrip team. Please recompile the spm mex files for your platform or contact the SPM team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants