Home > vbmeg > functions > device > vb_info_get_channel_number.m

vb_info_get_channel_number

PURPOSE ^

get number of original channels

SYNOPSIS ^

function Nch = vb_info_get_channel_number(info, active_swt)

DESCRIPTION ^

 get number of original channels
 [usage]
   Nch = vb_info_get_channel_number(info, active_swt)
 [input]
         info : <required> info struct EEGinfo or MEGinfo(unimplemented)
   active_swt : <optional> <<boolean>> [false] switch for active channel
              :   true) only active channels (EEG)
              :  false) all the channels (EEG)
 [output]
          Nch : number of original channels
 [note]
   @see vb_meginfo_get_channel_number_whole.m
   @see vb_eeginfo_get_channel_number.m
 [history]
   2007-08-02 (Sako) initial version
   2008-05-01 (Sako) added vb_info_get_channel_number

 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 Nch = vb_info_get_channel_number(info, active_swt)
0002 % get number of original channels
0003 % [usage]
0004 %   Nch = vb_info_get_channel_number(info, active_swt)
0005 % [input]
0006 %         info : <required> info struct EEGinfo or MEGinfo(unimplemented)
0007 %   active_swt : <optional> <<boolean>> [false] switch for active channel
0008 %              :   true) only active channels (EEG)
0009 %              :  false) all the channels (EEG)
0010 % [output]
0011 %          Nch : number of original channels
0012 % [note]
0013 %   @see vb_meginfo_get_channel_number_whole.m
0014 %   @see vb_eeginfo_get_channel_number.m
0015 % [history]
0016 %   2007-08-02 (Sako) initial version
0017 %   2008-05-01 (Sako) added vb_info_get_channel_number
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 % --- CHECK ARGUMENTS --- %
0023 if ~exist('info', 'var'), info = []; end;
0024 if ~exist('active_swt', 'var'), active_swt = []; end
0025 [info, active_swt] = inner_check_arguments(info, active_swt);
0026 
0027 % --- MAIN PROCEDURE --------------------------------------------------------- %
0028 %
0029 func_ = mfilename;
0030 
0031 measurement = vb_info_get_measurement(info);
0032 switch measurement
0033   case  'EEG'
0034     Nch = vb_eeginfo_get_channel_number(info, active_swt);
0035     return;
0036     
0037   case  'MEG'
0038     Nch = vb_meginfo_get_channel_number_whole(info, active_swt);
0039     return;
0040     
0041   otherwise
0042     error('(%s)unknown measurement ''%s''', func_, measurment);
0043 end
0044 %
0045 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0046 
0047 % --- INNER FUNCTIONS -------------------------------------------------------- %
0048 %
0049 % --- inner_check_arguments()
0050 %
0051 function [info, active_swt] = inner_check_arguments(info, active_swt)
0052 if isempty(info)
0053   error('(%s)info is a required parameter', mfilename);
0054 end
0055 if isempty(active_swt)
0056   active_swt = false;
0057 end
0058 return;
0059 %
0060 % --- end of inner_check_arguments()
0061 
0062 %%% END OF FILE %%%

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