Skip to content

Commit

Permalink
ENH - implemented keepcfg and keepprevious in ft_default
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoostenveld committed Jan 15, 2024
1 parent d49eb8c commit b92cfc0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ft_defaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
if ~isfield(ft_default, 'checksize'), ft_default.checksize = 1e5; end % number in bytes, can be inf
if ~isfield(ft_default, 'showlogo'), ft_default.showlogo = 'yes'; end % yes or no, this is relevant for SPM and EEGLAB
if ~isfield(ft_default, 'showcallinfo'), ft_default.showcallinfo = 'yes'; end % yes or no, this is used in ft_pre/postamble_provenance
if ~isfield(ft_default, 'keepprevious'), ft_default.keepprevious = 'yes'; end % yes, no, this is used in ft_postamble_previous
if ~isfield(ft_default, 'keepcfg'), ft_default.keepcfg = 'yes'; end % yes, no, this is used in ft_postamble_history
if ~isfield(ft_default, 'debug'), ft_default.debug = 'no'; end % no, save, saveonerror, display, displayonerror, this is used in ft_pre/postamble_debug
if ~isfield(ft_default, 'outputfilepresent'), ft_default.outputfilepresent = 'overwrite'; end % can be keep, overwrite, error

Expand Down
5 changes: 5 additions & 0 deletions utilities/private/ft_postamble_history.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
%
% $Id$

if isfield(cfg, 'keepcfg') && ~istrue(cfg.keepcfg)
% do not keep the configuration in the output
return
end

% large fields should be removed in the output configuration
cfg = ft_checkconfig(cfg, 'checksize', 'yes');

Expand Down
5 changes: 5 additions & 0 deletions utilities/private/ft_postamble_previous.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
%
% $Id$

if isfield(cfg, 'keepprevious') && ~istrue(cfg.keepprevious)
% do not keep the previous configuration in the output
return
end

% remember the cfg history of the input data structures
cfg.previous = {};
cnt = 0;
Expand Down

0 comments on commit b92cfc0

Please sign in to comment.