modality.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. function [res, list] = modality(this, scalp, planar)
  2. % Returns data modality
  3. % FORMAT [res, list] = modality(this, scalp)
  4. %
  5. % scalp - 1 (default) only look at scalp modalities
  6. % 0 look at all modalities
  7. % planar - 1 distinguish between MEG planar and other MEG
  8. % 0 (default) do not distinguish
  9. % If more than one modality is found the function returns 'Multimodal'
  10. % in res and a cell array of modalities in list.
  11. % _______________________________________________________________________
  12. % Copyright (C) 2008-2012 Wellcome Trust Centre for Neuroimaging
  13. % Vladimir Litvak
  14. % $Id: modality.m 6542 2015-09-09 11:48:34Z karl $
  15. if nargin == 1
  16. scalp = 1;
  17. end
  18. if nargin < 3
  19. planar = 0;
  20. end
  21. list = {};
  22. if ~isempty(indchantype(this, {'MEG', 'MEGPLANAR', 'MEGCOMB'}))
  23. if planar
  24. if ~isempty(indchantype(this, 'MEGPLANAR'))
  25. list = [list {'MEGPLANAR'}];
  26. end
  27. if ~isempty(indchantype(this, 'MEG'))
  28. list = [list {'MEG'}];
  29. end
  30. if ~isempty(indchantype(this, 'MEGCOMB'))
  31. list = [list {'MEGCOMB'}];
  32. end
  33. else
  34. list = [list {'MEG'}];
  35. end
  36. end
  37. if ~isempty(indchantype(this, 'EEG'))
  38. list = [list {'EEG'}];
  39. end
  40. if ~isempty(indchantype(this, 'LFP')) && ~scalp
  41. list = [list {'LFP'}];
  42. end
  43. if ~isempty(indchantype(this, 'ILAM')) && ~scalp
  44. list = [list {'ILAM'}];
  45. end
  46. switch numel(list)
  47. case 0
  48. res = 'Other';
  49. case 1
  50. res = list{1};
  51. otherwise
  52. res = 'Multimodal';
  53. end