diff --git a/src/pspm_extract_segments.m b/src/pspm_extract_segments.m index 4af2e5549..0b8e32a4d 100644 --- a/src/pspm_extract_segments.m +++ b/src/pspm_extract_segments.m @@ -91,15 +91,20 @@ % check consistency of input for the other methods if strcmpi(method, 'file') % in this case use pspm_check_model to verify channel = varargin{1}; - model = pspm_check_model( ... - struct('modelfile', 'dummyfile.mat', ... + model = struct('modelfile', 'dummyfile.mat', ... 'datafile', data, ... 'timing', timing, ... - 'timeunits', options.timeunits), ... - 'glm'); + 'timeunits', options.timeunits); + if isfield(options, 'missing') + model.missing = options.missing; + end + model = pspm_check_model(model, 'glm'); if model.invalid, return; end timing = model.timing; datafile = model.datafile; + if isfield(options, 'missing') + options.missing = model.missing; + end elseif strcmpi(method, 'data') % verify directly sr = varargin{1}; if isnumeric(data) @@ -213,8 +218,6 @@ if sts < 1, return; end end - - if options.plot fg = figure('Name', 'Condition mean per subject', 'Visible', 'off'); ax = axes('NextPlot', 'add'); diff --git a/src/pspm_pp.m b/src/pspm_pp.m index d6c52cb81..e777d706d 100644 --- a/src/pspm_pp.m +++ b/src/pspm_pp.m @@ -2,7 +2,7 @@ % ● Description % pspm_pp contains various preprocessing utilities for reducing noise in % the data. It features a 'butter' option that allows downsampling after -% application of an anti-alias filter. +% application of an anti-alias filter. % ● Format % [sts, fn] = pspm_pp('median', fn, channel, n, options) or % [sts, fn] = pspm_pp('butter', fn, channel, filt, options) or @@ -11,7 +11,8 @@ % method: [string] Method of filtering. Currently implemented % methods are 'median' and 'butter'. (1) 'median': a median % filter will be applied. (2) 'butter': Butterworth band -% pass filter potentially including downsampling. +% pass filter potentially including downsampling; any NaN +% data are interpolated before filtering and then removed % (3) 'leaky_integrator': Applies a leaky integrator filter % where tau is specified in seconds. % fn: [string] The datafile that saves data to process