Home > vbmeg > functions > device > meg > vb_meginfo_get_extra_channel_name.m

vb_meginfo_get_extra_channel_name

PURPOSE ^

return name of extra channel

SYNOPSIS ^

function [ch_name] = vb_meginfo_get_extra_channel_name(meginfo, ex_type)

DESCRIPTION ^

 return name of extra channel
 [usage]
   [ch_name] = vb_meginfo_get_extra_channel_name(meginfo, ex_type)
 [input]
   meginfo : <required> <<struct>> MEG information which must have EEGinfo
   ex_type : <required> extra type as follows
           :  0) all_ch_name
           :  1) eeg_ch_name
           :  2) null_ch_name
           :  3) ecg_ch_name
           :  4) refmg_ch_name
           : 10) all_ch_name
 [output]
   ch_name : appropriate channel name
 [note]
   In the new specification, refference magnetometer channel is set apart
   from extra channels
   So, ex_type was redefined as follows.
     0) all extra channels except refmg_ch  (as new)
    10) all extra channels include refmg_ch (as old)
 [history]
   2007-06-27 (Sako) initial version

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [ch_name] = vb_meginfo_get_extra_channel_name(meginfo, ex_type)
0002 % return name of extra channel
0003 % [usage]
0004 %   [ch_name] = vb_meginfo_get_extra_channel_name(meginfo, ex_type)
0005 % [input]
0006 %   meginfo : <required> <<struct>> MEG information which must have EEGinfo
0007 %   ex_type : <required> extra type as follows
0008 %           :  0) all_ch_name
0009 %           :  1) eeg_ch_name
0010 %           :  2) null_ch_name
0011 %           :  3) ecg_ch_name
0012 %           :  4) refmg_ch_name
0013 %           : 10) all_ch_name
0014 % [output]
0015 %   ch_name : appropriate channel name
0016 % [note]
0017 %   In the new specification, refference magnetometer channel is set apart
0018 %   from extra channels
0019 %   So, ex_type was redefined as follows.
0020 %     0) all extra channels except refmg_ch  (as new)
0021 %    10) all extra channels include refmg_ch (as old)
0022 % [history]
0023 %   2007-06-27 (Sako) initial version
0024 %
0025 % Copyright (C) 2011, ATR All Rights Reserved.
0026 % License : New BSD License(see VBMEG_LICENSE.txt)
0027 
0028 % --- CHECK ARGUMENTS --- %
0029 if ~exist('meginfo', 'var') meginfo = []; end
0030 if ~exist('ex_type', 'var') ex_type = []; end
0031 [meginfo, ex_type] = inner_check_arguments(meginfo, ex_type);
0032 
0033 % --- MAIN PROCEDURE --------------------------------------------------------- %
0034 %
0035 func_ = 'vb_meginfo_get_extra_channel_name';
0036 
0037 switch ex_type
0038   case  0, ch_name = 'all_ch_name';
0039   case  1, ch_name = 'eeg_ch_name';
0040   case  2, ch_name = 'null_ch_name';
0041   case  3, ch_name = 'ecg_ch_name';
0042   case  4, ch_name = 'refmg_ch_name';
0043   case 10, ch_name = 'all_ch_name';
0044   otherwise
0045     error('(%s)unexpected ex_type : %d', func_, ex_type);
0046 end
0047 
0048 if ~isfield(meginfo.EEGinfo, ch_name)
0049   error('(%s)MEGinfo.EEGinfo must have ''%s''', func_, ch_name');
0050 end
0051 %
0052 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0053 
0054 % --- INNER FUNCTIONS -------------------------------------------------------- %
0055 %
0056 % --- inner_check_arguments()
0057 %
0058 function [meginfo, ex_type] = inner_check_arguments(meginfo, ex_type)
0059 
0060 func_ = 'vb_meginfo_get_extra_channel_name';
0061 
0062 if isempty(meginfo)
0063   error('(%s)meginfo is a required parameter', func_);
0064 end
0065 
0066 if ~isfield(meginfo, 'EEGinfo')
0067   error('(%s)MEGinfo must have EEGinfo field', func_);
0068 end
0069 
0070 if isempty(ex_type)
0071   error('(%s)ex_type is a required parameter', func_);
0072 end
0073 return;
0074 %
0075 % --- end of inner_check_arguments()
0076 %
0077 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0078 
0079 %%% END OF FILE %%%

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005