Back to the main page.

Bug 911 - add memtic/memtoc to all fieldtrip functions

Status CLOSED FIXED
Reported 2011-08-30 22:58:00 +0200
Modified 2012-02-03 21:46:27 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2011-08-30 22:58:32 +0200

similar to the measurement of tic/toc time in the output cfg.callinfo.proctime, it would be nice to have an estimate of the memory use. That is possible with the memprofile function (part of peer). Based on memprofile I have implemented a memtic/memtoc. Using these functions, I have just updated ft_preprocessing with the new feature. All other ft_xxx main functions should follow. Furthermore, the inconsistent time keeping in ft_componentanalysis has to be fixed. Furthermore, at the end of each ft_xxx main function it should print the time and memory that was used by the function. This will help people to get a better feeling of the time/mem requirements of a function, which are relevant for distributed computing (e.g. with peercellfun or qsubcellfun)


Robert Oostenveld - 2011-09-03 17:52:05 +0200

I hgave done a whole lot of functions, but noticed that not all ft main functions behave consistent. There are some that still need to be done (including tic/toc, matlavversion, username etc.), and for some the order of the code at the end of the function has to be made consistent (i.e. first save, then record toc) mbp> svn commit *.m Sending besa2fieldtrip.m Sending fieldtrip2spss.m Sending ft_appenddata.m Sending ft_appendfreq.m Sending ft_appendsource.m Sending ft_appendspike.m Sending ft_appendtimelock.m Sending ft_artifact_clip.m Sending ft_artifact_ecg.m Sending ft_artifact_manual.m Sending ft_artifact_threshold.m Sending ft_channelnormalise.m Sending ft_channelrepair.m Sending ft_combineplanar.m Sending ft_componentanalysis.m Sending ft_conjunctionanalysis.m Sending ft_connectivityanalysis.m Sending ft_connectivityplot.m Sending ft_connectivitysimulation.m Sending ft_databrowser.m Sending ft_databrowser_old.m Sending ft_definetrial.m Sending ft_denoise_pca.m Sending ft_denoise_synthetic.m Sending ft_dipolefitting.m Sending ft_dipolesimulation.m Sending ft_electroderealign.m Sending ft_examplefunction.m Sending ft_freqanalysis.m Sending ft_freqanalysis_tfr.m Sending ft_freqbaseline.m Sending ft_freqdescriptives.m Sending ft_freqgrandaverage.m Sending ft_freqinterpolate.m Sending ft_freqsimulation.m Sending ft_freqstatistics.m Sending ft_interactiverealign.m Sending ft_lateralizedpotential.m Sending ft_megplanar.m Sending ft_megrealign.m Sending ft_movieplotER.m Sending ft_mvaranalysis.m Sending ft_neighbourplot.m Sending ft_neighbourselection.m Sending ft_prepare_femmodel.m Sending ft_prepare_leadfield.m Sending ft_preprocessing.m Sending ft_qualitycheck.m Sending ft_redefinetrial.m Sending ft_rejectartifact.m Sending ft_rejectcomponent.m Sending ft_rejectvisual.m Sending ft_resampledata.m Sending ft_scalpcurrentdensity.m Sending ft_sensorrealign.m Sending ft_sourceanalysis.m Sending ft_sourcedescriptives.m Sending ft_sourcegrandaverage.m Sending ft_sourceinterpolate.m Sending ft_sourcemovie.m Sending ft_sourcestatistics.m Sending ft_spike_sub_defaultcfg.m Sending ft_spike_triggeredspectrum.m Sending ft_spikeanalysis.m Sending ft_spikedetection.m Sending ft_spikedownsample.m Sending ft_spikesimulation.m Sending ft_spikesorting.m Sending ft_spikesplitting.m Sending ft_spiketriggeredaverage.m Sending ft_spiketriggeredinterpolation.m Sending ft_spiketriggeredspectrum.m Sending ft_timelockanalysis.m Sending ft_timelockbaseline.m Sending ft_timelockgrandaverage.m Sending ft_timelockstatistics.m Sending ft_volumedownsample.m Sending ft_volumenormalise.m Sending ft_volumerealign.m Sending ft_volumereslice.m Sending ft_volumesegment.m Sending loreta2fieldtrip.m Sending nutmegBeam2fieldtripSource.m Sending spass2fieldtrip.m Sending spm2ft.m Sending statistics_montecarlo.m Transmitting file data ...................................................................................... Committed revision 4096.


Robert Oostenveld - 2011-09-12 11:35:38 +0200

I went over the ft_artifact_xxx functions


Robert Oostenveld - 2011-09-12 12:13:53 +0200

I did the following batch manzana> svn commit Sending ft_artifact_eog.m Sending ft_artifact_jump.m Sending ft_artifact_muscle.m Sending ft_clusterplot.m Sending ft_connectivityplot.m Sending ft_freqanalysis_mtmwelch.m Sending ft_freqanalysis_mvar.m Sending ft_freqanalysis_tfr.m Sending ft_headmodelplot.m Sending ft_layoutplot.m Sending ft_movieplotER.m Sending ft_multiplotCC.m Sending ft_multiplotER.m Sending ft_multiplotTFR.m Sending ft_neighbourplot.m Sending ft_singleplotER.m Sending ft_singleplotTFR.m Sending ft_sourceplot.m Sending ft_spike_plot_isi.m Sending ft_spike_plot_isireturn.m Sending ft_spike_plot_jpsth.m Sending ft_spike_plot_psth.m Sending ft_spike_plot_raster.m Sending ft_topoplotCC.m Sending ft_topoplotER.m Sending ft_topoplotIC.m Sending ft_topoplotTFR.m Transmitting file data ........................... Committed revision 4155.


Robert Oostenveld - 2011-09-12 12:14:47 +0200

I have also identified functions that do not need memtoc/memtoc, and gradually I have filtered them out of the list of functions that still needs to be looked at. The remaining functions to look at are ft_freqcomparison.m ft_headmovement.m ft_neighbourselection.m ft_prepare_atlas.m ft_prepare_bemmodel.m ft_prepare_concentricspheres.m ft_prepare_femmodel.m ft_prepare_headmodel.m ft_prepare_layout.m ft_prepare_localspheres.m ft_prepare_mesh.m ft_prepare_singleshell.m ft_prepare_sourcemodel.m ft_recodeevent.m ft_sliceinterp.m ft_sourcewrite.m ft_spike_data2spike.m ft_spike_isihist.m ft_spike_jpsth.m ft_spike_maketrials.m ft_spike_psth.m ft_spike_rate.m ft_spike_rate_condition.m ft_spike_rate_orituning.m ft_spike_spike2data.m ft_spike_sub_defaultcfg.m ft_spike_xcorr.m ft_spikedensity.m ft_spikefixdmafile.m ft_spiketriggeredspectrum_tfr.m ft_stratify.m ft_volumelookup.m ft_volumesegment.m ft_volumewrite.m


Robert Oostenveld - 2011-10-12 11:27:45 +0200

I found this list as text file with the name TODO_BUG911... ft_freqcomparison.m ft_headmovement.m ft_neighbourselection.m ft_prepare_atlas.m ft_prepare_bemmodel.m ft_prepare_concentricspheres.m ft_prepare_femmodel.m ft_prepare_headmodel.m ft_prepare_layout.m ft_prepare_localspheres.m ft_prepare_mesh.m ft_prepare_singleshell.m ft_prepare_sourcemodel.m ft_recodeevent.m ft_sliceinterp.m ft_sourcewrite.m ft_spike_data2spike.m ft_spike_isihist.m ft_spike_jpsth.m ft_spike_maketrials.m ft_spike_psth.m ft_spike_rate.m ft_spike_rate_condition.m ft_spike_rate_orituning.m ft_spike_spike2data.m ft_spike_sub_defaultcfg.m ft_spike_xcorr.m ft_spikedensity.m ft_spikefixdmafile.m ft_spiketriggeredspectrum_tfr.m ft_stratify.m ft_volumelookup.m ft_volumesegment.m ft_volumewrite.m ~


Robert Oostenveld - 2011-10-19 12:43:11 +0200

*** Bug 1058 has been marked as a duplicate of this bug. ***


Robert Oostenveld - 2011-10-19 17:30:25 +0200

Instead of adding more and more to the header and footer of each fieldtrip function, we decided in the FT meeting to try to work towards a consistent and short preamble and postamble. I implemented ft_preamble and ft_postamble and associated scripts, and included that (to test) in ft_freqdescriptives. See http://code.google.com/p/fieldtrip/source/detail?r=4526


Robert Oostenveld - 2011-10-19 18:11:03 +0200

also added it to ft_freqanalysis, to see whether in a heavily used function it also works .... (I keep my fingers crossed).


Robert Oostenveld - 2011-10-28 17:49:29 +0200

over the last few days I have gone over may functions to add ft_preamble and to clean up the begin of the function. Note that the ft_postamble still needs to be done. Besides the ft_spike* functions (for which there is another plan), the following functions remain that do not use ft_preamble manzana> grep -L ft_preamble *.m Contents.m besa2fieldtrip.m do_edit.m fieldtrip2spss.m fieldtripdefs.m ft_appendfreq.m ft_artifact_clip.m ft_artifact_ecg.m ft_artifact_eog.m ft_artifact_jump.m ft_artifact_muscle.m ft_artifact_threshold.m ft_artifact_zvalue.m ft_channelcombination.m ft_channelselection.m ft_compile_mex.m ft_conjunctionanalysis.m ft_defaults.m ft_definetrial.m ft_documentationindex.m ft_documentationreference.m ft_freqanalysis_tfr.m ft_neighbourplot.m ft_topoplotER.m ft_wizard.m loreta2fieldtrip.m nutmeg2fieldtrip.m spass2fieldtrip.m spm2fieldtrip.m statistics_analytic.m statistics_crossvalidate.m statistics_montecarlo.m statistics_stats.m


Robert Oostenveld - 2011-10-28 17:50:35 +0200

(In reply to comment #9) These still have to be done for sure ft_appendfreq.m ft_conjunctionanalysis.m ft_neighbourplot.m ft_topoplotER.m


Robert Oostenveld - 2011-11-11 11:22:52 +0100

All changes have either been delegated, or have been made and committed, so the bug can be closed. It also has been running for some time at the Donders without complaints, so I also believe it works as intended. The following ones will be done by Arjen and Jorn ft_conjunctionanalysis.m ft_neighbourplot.m The spike functions will be done in conjunction with bug 1056