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

vb_meginfo_get_channel_name_extra

PURPOSE ^

return channel name list which you want to get

SYNOPSIS ^

function [ch_name] = vb_meginfo_get_channel_name_extra(meg_info, type_id)

DESCRIPTION ^

 return channel name list which you want to get
 [usage]
   [ch_name] = vb_meginfo_get_extra_channel_name(meg_info, type_id)
 [input]
   meg_info : <required> <<struct>> MEGinfo which must have ExtraChannelInfo
    type_id : <optional> <<integer>> type id []
            :  the case of YOKOGAWA-MEG, as follows
            :    0) Null Channel
            :   -1) Trigger Channel
            :   -2) Eeg Channel
            :   -3) Ecg Channel
            :   -4) Etc Channel
            :  if this is empty, return names of all channel
 [output]
   ch_name : [N x 1] name (number) list of acceptable channels
 [note]

 [history]
   2008-02-05 (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_channel_name_extra(meg_info, type_id)
0002 % return channel name list which you want to get
0003 % [usage]
0004 %   [ch_name] = vb_meginfo_get_extra_channel_name(meg_info, type_id)
0005 % [input]
0006 %   meg_info : <required> <<struct>> MEGinfo which must have ExtraChannelInfo
0007 %    type_id : <optional> <<integer>> type id []
0008 %            :  the case of YOKOGAWA-MEG, as follows
0009 %            :    0) Null Channel
0010 %            :   -1) Trigger Channel
0011 %            :   -2) Eeg Channel
0012 %            :   -3) Ecg Channel
0013 %            :   -4) Etc Channel
0014 %            :  if this is empty, return names of all channel
0015 % [output]
0016 %   ch_name : [N x 1] name (number) list of acceptable channels
0017 % [note]
0018 %
0019 % [history]
0020 %   2008-02-05 (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('type_id', 'var'), type_id = []; end
0028 [meg_info, type_id] = inner_check_arguments(meg_info, type_id);
0029 
0030 % --- MAIN PROCEDURE --------------------------------------------------------- %
0031 %
0032 if isfield(meg_info.ExtraChannelInfo, 'Channel_type') ...
0033     && isfield(meg_info.ExtraChannelInfo, 'Channel_name')
0034   
0035   if isempty(type_id)
0036     ch_name = meg_info.ExtraChannelInfo.Channel_name;
0037   else
0038     ch_name = ...
0039       meg_info.ExtraChannelInfo.Channel_name(...
0040         meg_info.ExtraChannelInfo.Channel_type == type_id);
0041   end
0042 else
0043   ch_name = [];
0044 end
0045 return;
0046 %
0047 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0048 
0049 % --- INNER FUNCTIONS -------------------------------------------------------- %
0050 %
0051 % --- inner_check_arguments()
0052 %
0053 function [meg_info, type_id] = inner_check_arguments(meg_info, type_id)
0054 func_ = mfilename;
0055 if isempty(meg_info)
0056   error('(%s)meg_info is a required parameter', func_);
0057 end
0058 
0059 if ~isfield(meg_info, 'ExtraChannelInfo')
0060   error('(%s)meg_info must have ExtraChannelInfo field', func_);
0061 end
0062 
0063 if isempty(type_id)
0064   % require no action
0065 end
0066 return;
0067 %
0068 % --- end of inner_check_arguments()
0069 %
0070 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0071 
0072 %%% END OF FILE %%%

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