Back to the main page.

Bug 990 - Incompatibility of new function ft_prepare_neighbours?

Status CLOSED WONTFIX
Reported 2011-09-25 11:39:00 +0200
Modified 2011-11-09 14:37:38 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 normal
Assigned to: Jörn M. Horschig
URL:
Tags:
Depends on:
Blocks:
See also:

Yoni Levy - 2011-09-25 11:39:42 +0200

I am running my script of freqstatistics, and am receiving the following error message: " computing statistic over the frequency range [0.000 0.000] ??? Error using ==> dimlength at 118 inconsistent number of repetitions for dim "rpt" Error in ==> dimlength at 46 n{k}(i) = dimlength(data, dimtok{i}, fn{k}); Error in ==> seloverdim at 39 [reduceddim, fntmp] = dimlength(data); Error in ==> ft_selectdata at 589 if selectchan, data = seloverdim(data, 'chan', selchan, fb); end Error in ==> ft_freqstatistics at 221 data = ft_selectdata(varargin{:}, 'param', cfg.parameter, 'avgoverrpt', false, ... " Could it be related to the new prepare neighbours function? Thanks in advance p.s. My script is as follows: cfg =[]; cfg.method = 'montecarlo'; cfg.statistic = 'pooledT'; cfg.tail = 0; cfg.alpha = 0.025; cfg.correctm = 'cluster'; cfg1.gradfile = '/home/coherence/yonlev/temporary_yonlev/CriticConsc_CriticConsc_20080715_01.ds/CriticConsc_CriticConsc_20080715_01.ds/CriticConsc_CriticConsc_20080715_01.res4'; cfg1.method = 'triangulation'; cfg1.method = 'distance'; cfg1.feedback='yes'; cfg.neighbours = ft_prepare_neighbours(cfg1); cfg.numrandomization = 1000; cfg.clusterstatistic = 'maxsum'; %how to combine the single samples that belong to a cluster, 'maxsum', 'maxsize', 'wcm' (default = 'maxsum') cfg.clusterthreshold = 'parametric';%method for single-sample threshold, 'parametric', 'nonparametric_individual', 'nonparametric_common' (default = 'parametric') cfg.clusteralpha = 0.05;%for either parametric or nonparametric thresholding (default = 0.05) cfg.clustercritval = [-1.96 1.96]; cfg.clustertail = 0; cfg.design(1,1:2*13) = [ones(1,13) 2*ones(1,13)]; cfg.design(2,1:2*13) = [1:13 1:13]; cfg.ivar =1; cfg.uvar =2; stat = ft_freqstatistics(cfg,t2_subj1,t2_subj2,t2_subj3,t2_subj4,t2_subj5,t2_subj6,t2_subj7,t2_subj8,t2_subj9,t2_subj10,t2_subj11,t2_subj12,t2_subj13,t2_subj1_null,t2_subj2_null,t2_subj3_null,t2_subj4_null,t2_subj5_null,t2_subj6_null,t2_subj7_null,t2_subj8_null,t2_subj9_null,t2_subj10_null,t2_subj11_null,t2_subj12_null,t2_subj13_null);


Jörn M. Horschig - 2011-09-26 09:23:00 +0200

Hey Yoni, I doubt that it has something to do with prepare_neighbours, because the only that changed is the function name. You can check your neighbours by calling ft_neighbourplot. Could you check the .freq field of your data-structures? Since the output says that it tries to compute the frequency range from 0Hz to 0Hz, there is definitely something wrong there.


Robert Oostenveld - 2011-09-26 09:37:56 +0200

Hi Jorn, Yoni is doing 2nd level stats where the input to the group freqstatistics (where clustering needs to be done) is the output of the 1st level subject statistics (in which be just computes the contrast of interest). At the 1st level Yoni is doing avgoverfreq=yes, resulting in a chan-only dimord. To get some functions to work, ft_checkdata adds the dummy freq dimension to make it into chan_freq and assigns freq=[0]. I hope that this background info helps to solve the particular problem (which I did not look into in further detail). Robert


Jörn M. Horschig - 2011-09-26 10:06:45 +0200

I see, so then the problem is not in defining frequencies, thanks Robert. Anyhow, the error message suggests that there is a unequal amount of trials for different subjects, could that be the problem? I call ft_freqdescriptives on single subject level first with cfg.keeptrials = 'no'. But, maybe it'd be easier if I just drop by to have a look, is that okay with you?


Yoni Levy - 2011-09-26 16:07:41 +0200

(In reply to comment #3) > I see, so then the problem is not in defining frequencies, thanks Robert. > Anyhow, the error message suggests that there is a unequal amount of trials for > different subjects, could that be the problem? I call ft_freqdescriptives on > single subject level first with cfg.keeptrials = 'no'. But, maybe it'd be > easier if I just drop by to have a look, is that okay with you? Hi Jorn, If you addressed me, then I have to say that I am no more a member at the donders. Do you need me to send you any of the data file to check it out? Yoni


Jörn M. Horschig - 2011-09-27 09:43:17 +0200

Hey Yoni, that would be a good idea, but maybe before that, can you check whether you have the same amount of trials for all your subjects? How did you obtain the data structures? And, just to be sure, could you check your neighbours by setting cfg.feedback='yes' (or by calling ft_neighbourplot)? Did you run the same script in the past already? Best, Jörn


Yoni Levy - 2011-09-27 09:56:13 +0200

(In reply to comment #5) > Hey Yoni, > that would be a good idea, but maybe before that, can you check whether you > have the same amount of trials for all your subjects? How did you obtain the > data structures? And, just to be sure, could you check your neighbours by > setting cfg.feedback='yes' (or by calling ft_neighbourplot)? Did you run the > same script in the past already? > Best, > Jörn Hi Jorn, the reason why I suspected it to be something related to ft_prepare_neighbours was because I just ran that same script 4 days ago, and there was no problem. So it must be a script that changed in the past couple of days. could it be? Yoni


Jörn M. Horschig - 2011-09-27 10:10:18 +0200

Hi Yoni, it would be really strange, because just the function name changed, no functionality. You could try taking neighbourselection from an older version of FieldTrip. But I really doubt that this is related to the function. Could you paste in here the output of size(subjXXX.powspctrm) for all your subjects?


Jörn M. Horschig - 2011-09-27 10:13:48 +0200

or alternatively, just share your data with me, then I can look into this ;)


Yoni Levy - 2011-09-27 23:35:55 +0200

(In reply to comment #7) > Hi Yoni, > it would be really strange, because just the function name changed, no > functionality. You could try taking neighbourselection from an older version of > FieldTrip. But I really doubt that this is related to the function. > Could you paste in here the output of size(subjXXX.powspctrm) for all your > subjects? Hi Jorn, thanks for your assistance. I will however now have no more access in the near future to my dataset. I will therefore (for now) have to waiver attempting to run the script that I mentioned above and that returned an error message in return. So from my side this bug#990 can be closed as I can no longer provide information to help solving it. Thanks, Yoni


Jörn M. Horschig - 2011-10-04 11:07:01 +0200

If you encounter such a problem again, please let us know!