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

vb_meginfo_get_channel_active_extra

PURPOSE ^

return active list of extra channels

SYNOPSIS ^

function [active_list, result] =vb_meginfo_get_channel_active_extra(meg_info, active_swt)

DESCRIPTION ^

 return active list of extra channels
 [usage]
   [active_list, result] = ...
     vb_meginfo_get_channel_active_extra(meg_info, active_swt)
 [input]
      meg_info : <required> <<struct>> MEGinfo which has 'ExtraChannelInfo'
    active_swt : <optional> <<boolean>> active filter switch [true]
               :   true) return as it is
               :  false) return all one list
 [output]
   active_list : ExtraChannelInfo.Channel_active
        result : <<integer>> error code
               :  0) success
               :  1) error - bad MEGinfo
 [note]
   return value includes reference channels if exist
 [history]
   2008-04-17 (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 [active_list, result] = ...
0002   vb_meginfo_get_channel_active_extra(meg_info, active_swt)
0003 % return active list of extra channels
0004 % [usage]
0005 %   [active_list, result] = ...
0006 %     vb_meginfo_get_channel_active_extra(meg_info, active_swt)
0007 % [input]
0008 %      meg_info : <required> <<struct>> MEGinfo which has 'ExtraChannelInfo'
0009 %    active_swt : <optional> <<boolean>> active filter switch [true]
0010 %               :   true) return as it is
0011 %               :  false) return all one list
0012 % [output]
0013 %   active_list : ExtraChannelInfo.Channel_active
0014 %        result : <<integer>> error code
0015 %               :  0) success
0016 %               :  1) error - bad MEGinfo
0017 % [note]
0018 %   return value includes reference channels if exist
0019 % [history]
0020 %   2008-04-17 (Sako) initial version
0021 %
0022 % Copyright (C) 2011, ATR All Rights Reserved.
0023 % License : New BSD License(see VBMEG_LICENSE.txt)
0024 
0025 % --- CHECK ARGUMENTS --- %
0026 if ~exist('meg_info', 'var'), meg_info = []; end
0027 if ~exist('active_swt', 'var'), active_swt = []; end
0028 [meg_info, active_swt, result] = inner_check_arguments(meg_info, active_swt);
0029 
0030 % --- MAIN PROCEDURE --------------------------------------------------------- %
0031 %
0032 active_list = [];
0033 if result ~= 0
0034   return;
0035 end
0036 
0037 if ~isfield(meg_info.ExtraChannelInfo, 'Channel_active')
0038   active_list = [];
0039   return;
0040 else
0041   active_list = meg_info.ExtraChannelInfo.Channel_active;
0042   if ~active_swt
0043     % convert all elments one
0044     active_list = ones(length(active_list),1);
0045   end
0046 end
0047 return;
0048 %
0049 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0050 
0051 % --- INNER FUNCTIONS -------------------------------------------------------- %
0052 %
0053 % --- inner_check_arguments()
0054 %
0055 function [meg_info, active_swt, result] = ...
0056   inner_check_arguments(meg_info, active_swt)
0057 func_ = mfilename;
0058 result = 0; % success
0059 
0060 if isempty(meg_info)
0061   fprintf('(%s)meg_info is a required parameter\n', func_);
0062   result = 1;
0063   return
0064 end
0065 
0066 if ~isfield(meg_info, 'ExtraChannelInfo')
0067   fprintf('(%s)meg_info must have ExtraChannelInfo field\n', func_);
0068   result = 1;
0069   return;
0070 end
0071 
0072 if isempty(active_swt)
0073   active_swt = true;
0074 end
0075 return;
0076 %
0077 % --- end of inner_check_arguments()
0078 %
0079 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0080 
0081 %%% END OF FILE %%%

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