spm_eeg_copy.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. function D = spm_eeg_copy(S)
  2. % Copy EEG/MEG data to new files
  3. % FORMAT D = spm_eeg_copy(S)
  4. % S - input struct (optional)
  5. % fields of S:
  6. % S.D - MEEG object or filename of MEEG mat-file
  7. % S.outfile - filename for the new dataset
  8. % S.updatehistory - update history information [default: true]
  9. %
  10. % D - MEEG object of the new dataset
  11. %__________________________________________________________________________
  12. % Copyright (C) 2008-2017 Wellcome Trust Centre for Neuroimaging
  13. % Vladimir Litvak
  14. % $Id: spm_eeg_copy.m 7132 2017-07-10 16:22:58Z guillaume $
  15. SVNrev = '$Rev: 7132 $';
  16. %-Startup
  17. %--------------------------------------------------------------------------
  18. spm('FnBanner', mfilename, SVNrev);
  19. spm('FigName','M/EEG copy');
  20. if ~isfield(S, 'updatehistory'), S.updatehistory = 1; end
  21. D = spm_eeg_load(S.D);
  22. D = copy(D, S.outfile);
  23. if ~isfield(S, 'updatehistory') || S.updatehistory
  24. D = D.history('spm_eeg_copy', S);
  25. end
  26. save(D);
  27. %-Cleanup
  28. %--------------------------------------------------------------------------
  29. spm('FigName','M/EEG copy: done');