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

vb_megfile_get_applicable_channel

PURPOSE ^

return applicable channel lists of MEG/EXTRA/REFMG

SYNOPSIS ^

function [ch_info] = vb_megfile_get_applicable_channel(megfile, ch_list)

DESCRIPTION ^

 return applicable channel lists of MEG/EXTRA/REFMG
 [usage]
   [ch_info] = vb_megfile_get_applicable_channel(megfile, ch_list)
 [input]
   megfile : <required> <<file>> MEG-MAT file
   ch_list : <required> channel list
 [output]
   ch_info : <<struct>> lists of each channel
           :   fields are as follows
           :   .meg_channel : MEG channels in ch_list
           :   .ext_channel : EXTRA channels in ch_list
           :   .ref_channel : REFMG channels in ch_list
 [note]
   if the frame of channel type is changed this function must be modified
 [history]
   2007-07-11 (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_info] = vb_megfile_get_applicable_channel(megfile, ch_list)
0002 % return applicable channel lists of MEG/EXTRA/REFMG
0003 % [usage]
0004 %   [ch_info] = vb_megfile_get_applicable_channel(megfile, ch_list)
0005 % [input]
0006 %   megfile : <required> <<file>> MEG-MAT file
0007 %   ch_list : <required> channel list
0008 % [output]
0009 %   ch_info : <<struct>> lists of each channel
0010 %           :   fields are as follows
0011 %           :   .meg_channel : MEG channels in ch_list
0012 %           :   .ext_channel : EXTRA channels in ch_list
0013 %           :   .ref_channel : REFMG channels in ch_list
0014 % [note]
0015 %   if the frame of channel type is changed this function must be modified
0016 % [history]
0017 %   2007-07-11 (Sako) initial version
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('megfile', 'var'), megfile = []; end
0024 if ~exist('ch_list', 'var'), ch_list = []; end
0025 [megfile, ch_list] = inner_check_arguments(megfile, ch_list);
0026 
0027 % --- MAIN PROCEDURE --------------------------------------------------------- %
0028 %
0029 meginfo = vb_megfile_load_meginfo(megfile);
0030 org_meg_ch = vb_meginfo_get_channel_label_meg(meginfo);
0031 org_ext_ch = vb_meginfo_get_channel_label_extra(meginfo);
0032 org_ref_ch = vb_meginfo_get_channel_label_refmg(meginfo);
0033 
0034 ch_info = [];
0035 
0036 ch_info = vb_ch_info_set_channel_info_meg(ch_info, ...
0037             vb_util_get_overlapping_vector(org_meg_ch, ch_list));
0038 
0039 ch_info = vb_ch_info_set_channel_info_ext(ch_info, ...
0040             vb_util_get_overlapping_vector(org_ext_ch, ch_list));
0041 
0042 ch_info = vb_ch_info_set_channel_info_ref(ch_info, ...
0043             vb_util_get_overlapping_vector(org_ref_ch, ch_list));
0044 return;
0045 %
0046 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0047 
0048 % --- INNER FUNCTIONS -------------------------------------------------------- %
0049 %
0050 % --- inner_check_arguments()
0051 %
0052 function [megfile, ch_list] = inner_check_arguments(megfile, ch_list)
0053 func_ = mfilename;
0054 
0055 if isempty(megfile)
0056   error('(%s)megfile is a required parameter', func_);
0057 end
0058 
0059 if isempty(ch_list)
0060   error('(%s)ch_list is a required parameter', func_);
0061 end
0062 return;
0063 %
0064 % --- end of inner_check_arguments()
0065 %
0066 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0067 
0068 %%% END OF FILE %%%

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