Back to the main page.
Bug 2324 - data.cfg field required for plotting
Status | CLOSED FIXED |
Reported | 2013-10-15 17:03:00 +0200 |
Modified | 2014-01-15 14:47:10 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P3 minor |
Assigned to: | Jan-Mathijs Schoffelen |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Jörn M. Horschig - 2013-10-15 17:03:46 +0200
I created surrogate data, thus no cfg, and wanted to plot that. I stumbled on this: ??? Reference to non-existent field 'cfg'. Error in ==> topoplot_common at 301 tempdata.cfg = data.cfg; Error in ==> ft_topoplotTFR at 185 [cfg] = topoplot_common(cfg, varargin{:}); http://fieldtrip.fcdonders.nl/reference/ft_datatype_freq states: Required fields: - label, dimord, freq
Robert Oostenveld - 2013-10-15 18:02:23 +0200
this might well be a recurring mistake in the code, i.e. assuming the presence of a cfg whereas it is not required. I think it is worth to check globally for ".cfg" in the code.
Jan-Mathijs Schoffelen - 2013-11-30 08:52:30 +0100
jan2-mac:fieldtrip-svn jan$ grep -l \\.cfg *.m besa2fieldtrip.m fieldtrip2fiff.m ft_analysispipeline.m ft_analysisprotocol.m ft_annotate.m ft_appenddata.m ft_appendspike.m ft_artifact_zvalue.m ft_componentanalysis.m ft_databrowser.m ft_examplefunction.m ft_freqcomparison.m ft_interpolatenan.m ft_math.m ft_movieplotTFR.m ft_multiplotER.m ft_multiplotTFR.m ft_neighbourplot.m ft_prepare_sourcemodel.m ft_qualitycheck.m ft_recodeevent.m ft_removetmsartifact.m ft_singleplotER.m ft_singleplotTFR.m ft_sliceinterp.m ft_sourcemovie.m
Jan-Mathijs Schoffelen - 2013-11-30 08:53:33 +0100
jan2-mac:fieldtrip-svn jan$ grep -l \\.cfg */*.m compat/ft_databrowser_old.m fileio/ft_read_data.m private/artifact_viewer.m private/browse_movieplotER.m private/comp2timelock.m private/constructplanargrad.m private/fixsampleinfo.m private/fourier2crsspctrm.m private/freq2cumtapcnt.m private/freq2timelock.m private/prepare_timefreq_data.m private/rejectvisual_channel.m private/rejectvisual_summary.m private/rejectvisual_trial.m private/rollback_provenance.m private/topoplot_common.m private/univariate2bivariate.m test/test_bug1041.m test/test_bug1153.m test/test_bug1162.m test/test_bug1163.m test/test_bug1168.m test/test_bug1397.m test/test_bug1775.m test/test_bug2224.m test/test_bug2378.m test/test_bug27.m test/test_bug46.m test/test_ft_componentanalysis.m test/test_ft_fetch_data.m test/test_ft_freqstatistics.m test/test_ft_math.m test/test_ft_networkanalysis.m test/test_ft_selectdata.m test/test_ft_timelockstatistics.m test/test_tutorial_clusterpermutationtimelock.m test/test_tutorial_coherence.m utilities/ft_checkconfig.m utilities/ft_checkdata.m utilities/ft_datatype_raw.m utilities/ft_datatype_spike.m utilities/ft_fetch_event.m utilities/ft_selectdata_new.m utilities/ft_source2full.m utilities/ft_source2sparse.m
Jan-Mathijs Schoffelen - 2013-11-30 08:54:00 +0100
jan2-mac:fieldtrip-svn jan$ grep -l \\.cfg */*/*.m contrib/misc/nonlinearassociation.m contrib/spike/ft_spike_plot_isi.m contrib/spike/ft_spike_plot_isireturn.m contrib/spike/ft_spike_plot_jpsth.m contrib/spike/ft_spike_plot_psth.m contrib/spike/ft_spike_plot_raster.m contrib/spike/ft_spike_xcorr.m external/ctf/readCTFds.m external/ctf/writeCTFds.m external/eeglab/eeglab2fieldtrip.m fileio/private/fixsampleinfo.m fileio/private/ft_checkdata.m fileio/private/ft_datatype_raw.m fileio/private/ft_datatype_spike.m fileio/private/read_ctf_ascii.m realtime/online_meg/ft_realtime_headlocalizer.m utilities/private/fixsampleinfo.m utilities/private/ft_postamble_history.m utilities/private/ft_postamble_previous.m
Jan-Mathijs Schoffelen - 2014-01-13 09:48:43 +0100
A better search would be: bash-4.1$ grep -l "=.*\.cfg" *.m */*.m */*/*.m |wc 59 59 1585 bash-4.1$ grep -l "=.*\.cfg" *.m */*.m */*/*.m fieldtrip2fiff.m ft_analysispipeline.m ft_analysisprotocol.m ft_appenddata.m ft_appendspike.m ft_artifact_zvalue.m ft_componentanalysis.m ft_multiplotER.m ft_multiplotTFR.m ft_neighbourplot.m ft_prepare_sourcemodel.m ft_qualitycheck.m ft_recodeevent.m ft_singleplotER.m ft_singleplotTFR.m ft_sliceinterp.m ft_sourcemovie.m headmotiontracking.m compat/ft_databrowser_old.m denoise_functions/ft_denoise_tsr.m junk/ft_combineplanarOwn.m private/artifact_viewer.m private/browse_movieplotER.m private/comp2timelock.m private/fixsampleinfo.m private/fourier2crsspctrm.m private/freq2cumtapcnt.m private/freq2timelock.m private/prepare_timefreq_data.m private/rejectvisual_channel.m private/rejectvisual_summary.m private/rejectvisual_trial.m private/rollback_provenance.m private/topoplot_common.m private/univariate2bivariate.m test/test_bug1168.m test/test_bug1397.m test/test_ft_componentanalysis.m test/test_tutorial_clusterpermutationtimelock.m test/test_tutorial_coherence.m utilities/ft_checkdata.m utilities/ft_datatype_raw.m utilities/ft_datatype_spike.m utilities/ft_fetch_event.m utilities/ft_selectdata_new.m utilities/ft_source2full.m utilities/ft_source2sparse.m contrib/misc/nonlinearassociation.m contrib/spike/ft_spike_plot_jpsth.m contrib/spike/ft_spike_plot_raster.m external/ctf/readCTFds.m external/ctf/writeCTFds.m fileio/private/fixsampleinfo.m fileio/private/ft_checkdata.m fileio/private/ft_datatype_raw.m fileio/private/ft_datatype_spike.m realtime/online_meg/ft_realtime_headlocalizer.m utilities/private/fixsampleinfo.m utilities/private/ft_postamble_previous.m
Jan-Mathijs Schoffelen - 2014-01-13 09:58:00 +0100
going over the main functions, one by one. fieldtrip2fiff.m: calls ft_findcfg ft_analysispipeline.m: OK ft_analysisprotocol.m: OK ft_appenddata.m: calls ft_findcfg on data.cfg within a try catch ft_appendspike.m: calls ft_findcfg on data.cfg without checking presence of cfg ft_artifact_zvalue.m: OK ft_componentanalysis.m: OK ft_multiplotER.m: assumes cfg to be present -> FIX it ft_multiplotTFR.m: assumes cfg to be present -> FIX it ft_neighbourplot.m: OK ft_prepare_sourcemodel.m: OK ft_qualitycheck.m: OK, because this is not intended to work on surrogate data ft_recodeevent.m: calls ft_findcfg, assumes cfg in the data ft_singleplotER.m: assumes cfg to be present -> FIX it ft_singleplotTFR.m: assumes cfg to be present -> FIX it ft_sliceinterp.m: OK ft_sourcemovie.m: OK headmotiontracking.m: JM's private code, not necessary to look into right now.
Jan-Mathijs Schoffelen - 2014-01-13 09:59:33 +0100
The following need to be addressed: fieldtrip2fiff.m: calls ft_findcfg ft_appenddata.m: calls ft_findcfg on data.cfg within a try catch ft_appendspike.m: calls ft_findcfg on data.cfg without checking presence of cfg ft_recodeevent.m: calls ft_findcfg, assumes cfg in the data ft_singleplotER.m: assumes cfg to be present -> FIX it ft_singleplotTFR.m: assumes cfg to be present -> FIX it ft_multiplotER.m: assumes cfg to be present -> FIX it ft_multiplotTFR.m: assumes cfg to be present -> FIX it
Jan-Mathijs Schoffelen - 2014-01-13 11:15:17 +0100
bash-4.1$ svn commit -m "enhancement - built in check for the presence of a cfg-field in data object" fieldtrip2fiff.m ft_appendspike.m ft_recodeevent.m ft_singleplotER.m ft_singleplotTFR.m ft_multiplotER.m ft_multiplotTFR.m Sending fieldtrip2fiff.m Sending ft_appendspike.m Sending ft_multiplotER.m Sending ft_multiplotTFR.m Sending ft_recodeevent.m Sending ft_singleplotER.m Sending ft_singleplotTFR.m Transmitting file data ....... Committed revision 9091.
Jan-Mathijs Schoffelen - 2014-01-13 11:23:49 +0100
private/artifact_viewer.m: soo low level, assume it to be present private/browse_movieplotER.m: soo low level, assume it to be present private/comp2timelock.m: built in if isfield... -> COMMIT private/fixsampleinfo.m: OK private/fourier2crsspctrm.m: OK private/freq2cumtapcnt.m: sufficiently low-level to assume it to be there private/freq2timelock.m: built in if isfield... -> COMMIT private/prepare_timefreq_data.m: OK private/rejectvisual_channel.m: OK private/rejectvisual_summary.m: OK private/rejectvisual_trial.m: OK private/rollback_provenance.m: OK private/topoplot_common.m: built in isfield... -> COMMIT private/univariate2bivariate.m: built in isfield... -> COMMIT bash-4.1$ svn commit -m "enhancement - increased robustness in the absence of a cfg-field in the input data" comp2timelock.m freq2timelock.m topoplot_common.m univariate2bivariate.m Sending comp2timelock.m Sending freq2timelock.m Sending topoplot_common.m Sending univariate2bivariate.m Transmitting file data .... Committed revision 9092.