Back to the main page.

Bug 1305 - preproc requires the deprecated offset as input

Status CLOSED FIXED
Reported 2012-02-01 14:38:00 +0100
Modified 2013-01-17 10:44:31 +0100
Product: FieldTrip
Component: preproc
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 minor
Assigned to: Roemer van der Meij
URL:
Tags:
Depends on:
Blocks:
See also:

Roemer van der Meij - 2012-02-01 14:38:56 +0100


Roemer van der Meij - 2012-02-01 14:47:04 +0100

Fixed for clip, zvalue was already fixed some time ago by someone else.


Boris Reuderink - 2012-02-06 15:57:04 +0100

Roemer, I looked through you commits from this period, but I can't find it. Could you look up you change?


Roemer van der Meij - 2012-02-06 17:11:58 +0100

Woops! Wrong bug. I was wondering why I had to close another twice bug twice last wednessday, I appears I accidentally replied and closed this bug. I'll reopen and remove my last comments. (I did nothing to preproc)


Jan-Mathijs Schoffelen - 2012-02-08 13:32:36 +0100

Roemer, could you look into this?


Roemer van der Meij - 2012-02-10 13:57:46 +0100

From the looks of it, offset is a irrelevant field in prerpoc. It is only used to create a time-axis, is a piece of cake to replace it with the non-deprecated time-axis. (i.e. no computation is being done with it). There are not that many dependencies on preproc: (see below) However, what I am more worried about, is external dependencies... The preproc module is being used by SPM right? Can I edit all the below functions and replace offset with time without breaking anything outside of fieldtrip? grep 'preproc(' *.m */*.m */*/*.m */*/*/*.m */*/*/*/*.m ft_artifact_clip.m: datflt = preproc(dat, label, hdr.Fs, artfctdef, trl(trlop,3)); ft_artifact_ecg.m: ecg{j} = preproc(ecg{j}, artfctdef.channel, hdr.Fs, artfctdef, [], fltpadding, fltpadding); ft_artifact_threshold.m: dat = preproc(dat, channel, hdr.Fs, artfctdef, cfg.trl(trlop,3)); ft_artifact_zvalue.m: dat = preproc(dat, cfg.artfctdef.zvalue.channel, hdr.Fs, cfg.artfctdef.zvalue, [], fltpadding, fltpadding); ft_artifact_zvalue.m: dat{trlop} = preproc(dat{trlop}, cfg.artfctdef.zvalue.channel, hdr.Fs, cfg.artfctdef.zvalue, [], fltpadding, fltpadding); ft_artifact_zvalue.m: dat = preproc(dat, cfg.artfctdef.zvalue.channel, hdr.Fs, cfg.artfctdef.zvalue, [], fltpadding, fltpadding); ft_artifact_zvalue.m:% dat{trlop} = preproc(dat{trlop}, cfg.artfctdef.zvalue.channel(sgnlop), hdr.Fs, cfg.artfctdef.zvalue, [], fltpadding, fltpadding); ft_artifact_zvalue.m:%data = preproc(data, '', hdr.Fs, artcfg, [], artcfg.fltpadding, artcfg.fltpadding); ft_connectivitysimulation.m: mixsignal = preproc(mixsignal, label, cfg.fsample, cfg, -fltpad, fltpad, fltpad); ft_connectivitysimulation.m: newtmp = preproc(newtmp, label, cfg.fsample, cfg, -fltpad, fltpad, fltpad); ft_databrowser.m:[dat, lab, tim] = preproc(dat, opt.hdr.label(chanindx), opt.fsample, cfg.preproc, offset); ft_preprocessing.m: [dataout.trial{i}, dataout.label, dataout.time{i}, cfg] = preproc(data.trial{i}(rawindx,:), data.label(rawindx), data.fsample, cfg, time2offset(data.time{i},data.fsample)); ft_preprocessing.m: [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), hdr.Fs, cfg, cfg.trl(i,3), begpadding, endpadding); ft_spikedetection.m: dat = preproc(org, hdr.label(i), hdr.Fs, cfg.preproc); ft_spikedownsample.m: dat = preproc(org, label, hdr.Fs, cfg.preproc); ft_volumesegment.m: p = spm_preproc(Va, px); ft_volumesegment.m: p = spm_preproc(Va); compat/ft_artifact_manual.m: [dataY{i}, dumlab, dumtime, dumcfg] = preproc(dataY{i}', cfg.artfctdef.manual.channel, hdr.Fs, cfg.artfctdef.manual, cfg.trl(i,3)-begpadding, 0, 0); compat/ft_databrowser_old.m:[dat, lab, tim] = preproc(dat, opt.hdr.label(chanindx), opt.fsample, opt.cfg.preproc, offset); private/artifact_viewer.m:% data = preproc(data, channel, hdr.Fs, artfctdef, [], fltpadding, fltpadding); private/preproc.m:function [dat, label, time, cfg] = preproc(dat, label, fsample, cfg, offset, begpadding, endpadding) private/preproc.m:% [dat, label, time, cfg] = preproc(dat, label, fsample, cfg, offset, begpadding, endpadding) private/preproc.m: [dat ] = preproc(dat, label, fsample, tmpcfg, offset, begpadding, endpadding); private/preproc.m: [dat, label ] = preproc(dat, label, fsample, tmpcfg, offset, begpadding, endpadding); private/preproc.m: [dat, label, time ] = preproc(dat, label, fsample, tmpcfg, offset, begpadding, endpadding); private/preproc.m: [dat, label, time, tmpcfg] = preproc(dat, label, fsample, tmpcfg, offset, begpadding, endpadding); private/rejectvisual_channel.m: [data.trial{i}, label, time, cfg.preproc] = preproc(data.trial{i}, data.label, fsample, cfg.preproc, offset(i)); private/rejectvisual_summary.m: [dat] = preproc(info.data.trial{i}, info.data.label, info.fsample, info.cfg.preproc, info.offset(i)); private/rejectvisual_summary.m: [dat, label, time, info.cfg.preproc] = preproc(info.data.trial{i}, info.data.label, info.fsample, info.cfg.preproc, info.offset(i)); private/rejectvisual_trial.m: [data.trial{i}, label, time, cfg.preproc] = preproc(data.trial{i}, data.label, fsample, cfg.preproc, offset(i)); external/spm8/spm_preproc.m:function results = spm_preproc(varargin) external/spm8/spm_preproc.m:% FORMAT results = spm_preproc(V,opts) realtime/example/ft_realtime_downsample.m: % dat = preproc(data.trial{1}, data.label, data.fsample, cfg);


Roemer van der Meij - 2012-02-10 14:52:37 +0100

(I added Robert as CC)


Arjen Stolk - 2012-02-15 13:24:23 +0100

(In reply to comment #6) also remove fsample, and replace it with timeaxis


Roemer van der Meij - 2012-02-29 17:16:55 +0100

changed to input to preproc to be dat, label, time, cfg, optional, and removed the fsample and offset as input. Preproc itself has not been adjusted thoroughly inside, but all code to mak e it work is in place. After this, preproc itself can be cleaned up. --This line, and those below, will be ignored-- M ft_artifact_threshold.m M ft_connectivitysimulation.m M ft_preprocessing.m M ft_spikedetection.m M ft_spikedownsample.m M ft_databrowser.m M ft_artifact_ecg.m M private/preproc.m M private/rejectvisual_summary.m M private/rejectvisual_channel.m M private/rejectvisual_trial.m M ft_artifact_clip.m M compat/ft_databrowser_old.m M compat/ft_artifact_manual.m M ft_artifact_zvalue.m Next step, is adjusting and cleaning up preproc on the inside. (keeping bug open)


Roemer van der Meij - 2012-03-02 15:17:44 +0100

Preproc has been cleaned up, there were only a few lines that were no longer necessary. Switch is now complete, and if now preproccesing bugs pop up during the next few days the bug can be closed.


Roemer van der Meij - 2013-01-17 10:44:31 +0100

bug closing time