Back to the main page.

Bug 1067 - sourcedescriptives should support cfg.trials if possible or warn the user

Status CLOSED FIXED
Reported 2011-10-24 10:21:00 +0200
Modified 2012-08-23 14:02:00 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Jörn M. Horschig
URL:
Tags:
Depends on:
Blocks:
See also:

Jörn M. Horschig - 2011-10-24 10:21:32 +0200

The former case is possible sometimes - once I work at weekends, I do things that arenot supposed to be... how stupid from me ^^. The latter is in accordance with another enhancement Robert suggested once (if I recall correctly) that illegal or misleading cfg-options should throw a warning to notify the user of wrongly using cfgs, so that the user does not think that the function did something different.


Robert Oostenveld - 2011-10-24 10:27:37 +0200

I general you should be able to do something like global ft_default ft_default.checkconfig = 'pedantic'; ft_default.trackconfig = 'report' or 'cleanup' ft_default.checksize = inf; disp(ft_default); Please have a look at this and report in the next FT meeting whether you find it appropriate.


Jörn M. Horschig - 2011-11-23 11:00:38 +0100

this helped for me, but especially since sourcedescriptive feels like an analogy to freqdescriptives, I think it should be explicitly be clear to the user that the cfg options are not the same. Don't you think so?


Jörn M. Horschig - 2012-03-13 14:21:35 +0100

I could check for each ft_source* function if it has an analog ft_freq* function and compare cfg-options. Then, for any option that is used in either but not both functions, I could add a ft_checkconfig(cfg, 'unused' call. This will reduce the number of user erros or unexpected FT-behaviour. Any objections?


Robert Oostenveld - 2012-03-13 14:23:45 +0100

good idea


Jörn M. Horschig - 2012-03-14 12:38:07 +0100

I wrote a small script that checks this automatically and outputs the cfg options that are not used by one but by the other. Could we look over the output together to see whether it makes sense to just bluntly add all these (actually, I find some findings quite surprising... e.g. ft_sourcestatistics does not use cfg.statistics) 497 $ svn ci test_bug1067.m -m "enhancement-#1067-script that outputs cfg fieldnames in source* functions that are not used in freq* functions and vice versa" Adding test_bug1067.m Transmitting file data . Committed revision 5463. btw, I think the function can be quite handy also for other, similar, purposes here is the list (sorry for the length): Function ft_sourceanalysis.m uses the following fields that ft_freqanalysis.m does not use: cfg.keepleadfield cfg.trialweight cfg.jackknife cfg.pseudovalue cfg.bootstrap cfg.singletrial cfg.rawtrial cfg.randomization cfg.numrandomization cfg.permutation cfg.numpermutation cfg.wakewulf cfg.killwulf cfg.supdip cfg.latency cfg.grid cfg.vol cfg.grad cfg.mri cfg.headshape cfg.tightgrid cfg.symmetry cfg.smooth cfg.threshold cfg.spheremesh cfg.inwardshift cfg.sourceunits cfg.refdip cfg.refchan cfg.supchan cfg.frequency cfg.numcondition cfg.numbootstrap cfg.lcmv Function ft_freqanalysis.m uses the following fields that ft_sourceanalysis.m does not use: cfg.inputfile cfg.outputfile cfg.feedback cfg.inputlock cfg.outputlock cfg.trials cfg.method cfg.methodcase cfg.taper cfg.foi cfg.width cfg.gwidth cfg.filttype cfg.filtorder cfg.filtdir cfg.pad cfg.output cfg.calcdof cfg.channel cfg.precision cfg.foilim cfg.correctt_ftimwin cfg.polyremoval cfg.keeptrials cfg.keeptapers cfg.channelcmb cfg.t_ftimwin cfg.tapsmofrq cfg.toi Function ft_sourcedescriptives.m uses the following fields that ft_freqdescriptives.m does not use: cfg.transform cfg.projectmom cfg.numcomp cfg.powmethod cfg.cohmethod cfg.supmethod cfg.resolutionmatrix cfg.eta cfg.fa cfg.kurtosis cfg.keepcsd cfg.fwhm cfg.fwhmremovecenter cfg.fixedori cfg.demean cfg.baselinewindow cfg.zscore cfg.singletrial cfg.powmethodcase cfg.supmethodcase cfg.cohmethodcase Function ft_freqdescriptives.m uses the following fields that ft_sourcedescriptives.m does not use: cfg.feedback cfg.jackknife cfg.variance cfg.trials cfg.channel cfg.foilim cfg.toilim cfg.keeptrials cfg.inputfile cfg.outputfile Function ft_sourcegrandaverage.m uses the following fields that ft_freqgrandaverage.m does not use: cfg.concatenate cfg.randomization cfg.permutation cfg.c1 cfg.c2 cfg.numrandomization cfg.numrandomizationres cfg.numpermutation cfg.numpermutationflip Function ft_freqgrandaverage.m uses the following fields that ft_sourcegrandaverage.m does not use: cfg.inputfile cfg.outputfile cfg.keepindividual cfg.channel cfg.foilim cfg.toilim cfg.parameter Function ft_sourceinterpolate.m uses the following fields that ft_freqinterpolate.m does not use: cfg.inputfile cfg.downsample cfg.voxelcoord cfg.feedback cfg.outputfile cfg.parameter cfg.interpmethod cfg.sphereradius cfg.interpmat Function ft_freqinterpolate.m uses the following fields that ft_sourceinterpolate.m does not use: cfg.method cfg.foilim Function ft_sourcestatistics.m uses the following fields that ft_freqstatistics.m does not use: cfg.implementation cfg.roi cfg.avgoverroi cfg.inputcoord cfg.atlas cfg.hemisphere cfg.origdim Function ft_freqstatistics.m uses the following fields that ft_sourcestatistics.m does not use: cfg.outputfile cfg.parameter cfg.channel cfg.latency cfg.trials cfg.frequency cfg.avgoverchan cfg.avgoverfreq cfg.avgovertime cfg.design cfg.correctm cfg.dim cfg.dimord cfg.method cfg.statistic cfg.chancmbindx >>


Jörn M. Horschig - 2012-03-14 15:17:10 +0100

okidoki, forgot the list above, there was stupid bug in my script, this is the correct list: Function ft_sourceanalysis.m uses the following fields that ft_freqanalysis.m does not use: cfg.keepleadfield cfg.trialweight cfg.jackknife cfg.pseudovalue cfg.bootstrap cfg.singletrial cfg.rawtrial cfg.randomization cfg.numrandomization cfg.permutation cfg.numpermutation cfg.wakewulf cfg.killwulf cfg.supdip cfg.latency cfg.grid cfg.vol cfg.grad cfg.mri cfg.headshape cfg.tightgrid cfg.symmetry cfg.smooth cfg.threshold cfg.spheremesh cfg.inwardshift cfg.sourceunits cfg.refdip cfg.refchan cfg.supchan cfg.frequency cfg.numcondition cfg.numbootstrap cfg.lcmv Function ft_freqanalysis.m uses the following fields that ft_sourceanalysis.m does not use: cfg.inputfile cfg.outputfile cfg.feedback cfg.inputlock cfg.outputlock cfg.trials cfg.methodcase cfg.taper cfg.foi cfg.width cfg.gwidth cfg.filttype cfg.filtorder cfg.filtdir cfg.pad cfg.output cfg.calcdof cfg.precision cfg.foilim cfg.correctt_ftimwin cfg.polyremoval cfg.keeptapers cfg.channelcmb cfg.t_ftimwin cfg.tapsmofrq cfg.toi Function ft_sourcedescriptives.m uses the following fields that ft_freqdescriptives.m does not use: cfg.transform cfg.projectmom cfg.numcomp cfg.powmethod cfg.cohmethod cfg.supmethod cfg.resolutionmatrix cfg.eta cfg.fa cfg.kurtosis cfg.keepcsd cfg.fwhm cfg.fwhmremovecenter cfg.fixedori cfg.demean cfg.baselinewindow cfg.zscore cfg.singletrial cfg.powmethodcase cfg.supmethodcase cfg.cohmethodcase Function ft_freqdescriptives.m uses the following fields that ft_sourcedescriptives.m does not use: cfg.jackknife cfg.variance cfg.trials cfg.channel cfg.foilim cfg.toilim cfg.inputfile cfg.outputfile Function ft_sourcegrandaverage.m uses the following fields that ft_freqgrandaverage.m does not use: cfg.concatenate cfg.randomization cfg.permutation cfg.c1 cfg.c2 cfg.numrandomization cfg.numrandomizationres cfg.numpermutation cfg.numpermutationflip Function ft_freqgrandaverage.m uses the following fields that ft_sourcegrandaverage.m does not use: cfg.inputfile cfg.outputfile cfg.channel cfg.foilim cfg.toilim Function ft_sourceinterpolate.m uses the following fields that ft_freqinterpolate.m does not use: cfg.inputfile cfg.downsample cfg.voxelcoord cfg.feedback cfg.outputfile cfg.parameter cfg.interpmethod cfg.sphereradius cfg.interpmat Function ft_freqinterpolate.m uses the following fields that ft_sourceinterpolate.m does not use: cfg.method cfg.foilim Function ft_sourcestatistics.m uses the following fields that ft_freqstatistics.m does not use: cfg.implementation cfg.roi cfg.avgoverroi cfg.inputcoord cfg.atlas cfg.hemisphere cfg.origdim Function ft_freqstatistics.m uses the following fields that ft_sourcestatistics.m does not use: cfg.outputfile cfg.trials cfg.correctm cfg.statistic cfg.chancmbindx


Jörn M. Horschig - 2012-03-21 10:24:26 +0100

In line with bug 1376, ft_sourcenanalysis and -descriptives must not have cfg.trials (ft_checkconfig(cfg, 'forbidden', {...}) and ft_freqanalysis must not have cfg.latency (ft_sourceanalysis does use that one) For all other things to do, see bug 1373 bug 1374 bug 1375 and especially bug 1376 Let me know whether a 'forbidden' is regarded as too strict Committed revision 5496.


Jörn M. Horschig - 2012-08-23 14:02:00 +0200

bug closing time (http://www.youtube.com/watch?v=xGytDsqkQY8)