Home > vbmeg > functions > device > vb_msrmnt_get_channel_list.m

vb_msrmnt_get_channel_list

PURPOSE ^

load channel list

SYNOPSIS ^

function ch_list = vb_msrmnt_get_channel_list(msrmnt_file, active_swt)

DESCRIPTION ^

 load channel list
 [usage]
   ch_list = vb_msrmnt_get_channel_list(msrmnt_file, active_swt)
 [input]
   msrmnt_file : <required> measurement file which includes channel list
               :    e.g. EEG-MAT (.eeg.mat)  MEG-MAT (.meg.mat)
    active_swt : <optional> <<boolean>> [false] switch for active channel
               :   true) return only active channels (EEG)
               :  false) return all the channels (EEG)
 [output]
       ch_list : (cell array) list of channel label [N x 1]
 [note]
   acceptable "Measurement" are :
     'MEG', 'EEG'
 [history]
   2007-08-02 (Sako) initial version
   2008-05-01 (Sako) added active_swt
   2011-06-01 (Sako) converted return values of vb_load_device to upper case

 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_list = vb_msrmnt_get_channel_list(msrmnt_file, active_swt)
0002 % load channel list
0003 % [usage]
0004 %   ch_list = vb_msrmnt_get_channel_list(msrmnt_file, active_swt)
0005 % [input]
0006 %   msrmnt_file : <required> measurement file which includes channel list
0007 %               :    e.g. EEG-MAT (.eeg.mat)  MEG-MAT (.meg.mat)
0008 %    active_swt : <optional> <<boolean>> [false] switch for active channel
0009 %               :   true) return only active channels (EEG)
0010 %               :  false) return all the channels (EEG)
0011 % [output]
0012 %       ch_list : (cell array) list of channel label [N x 1]
0013 % [note]
0014 %   acceptable "Measurement" are :
0015 %     'MEG', 'EEG'
0016 % [history]
0017 %   2007-08-02 (Sako) initial version
0018 %   2008-05-01 (Sako) added active_swt
0019 %   2011-06-01 (Sako) converted return values of vb_load_device to upper case
0020 %
0021 % Copyright (C) 2011, ATR All Rights Reserved.
0022 % License : New BSD License(see VBMEG_LICENSE.txt)
0023 
0024 % --- CHECK ARGUMENTS --- %
0025 if ~exist('msrmnt_file', 'var'), msrmnt_file = []; end;
0026 if ~exist('active_swt', 'var'), active_swt = []; end
0027 [msrmnt_file, active_swt] = inner_check_arguments(msrmnt_file, active_swt);
0028 
0029 % --- MAIN PROCEDURE --------------------------------------------------------- %
0030 %
0031 func_ = mfilename;
0032 
0033 ch_list = [];
0034 
0035 [measurement] = vb_load_device(msrmnt_file);
0036 Measurement = upper(measurement);
0037 
0038 switch Measurement
0039   case  'MEG'
0040     ch_list = vb_megfile_get_channel_label_whole(msrmnt_file, active_swt);
0041     
0042   case  'EEG'
0043     ch_list = vb_eegfile_get_channel_label(msrmnt_file, active_swt);
0044     
0045   otherwise
0046     fprintf('(%s)unexpected Measurement type : %s\n', func_, Measurement);
0047 end
0048 % arrange to [N x 1]
0049 ch_list = vb_util_arrange_list(ch_list, 0);
0050 return;
0051 %
0052 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0053 
0054 
0055 % --- INNER FUNCTIONS -------------------------------------------------------- %
0056 %
0057 % --- inner_check_arguments()
0058 %
0059 function [msrmnt_file, active_swt] = ...
0060   inner_check_arguments(msrmnt_file, active_swt)
0061 func_ = mfilename;
0062 
0063 if isempty(msrmnt_file)
0064   error('(%s)msrmnt_file is a required parameter', func_);
0065 end
0066 
0067 if exist(msrmnt_file, 'file') ~= 2
0068   error('(%s)cannot find measurement file : %s', func_, msrmnt_file);
0069 end
0070 
0071 if isempty(active_swt)
0072   active_swt = false;
0073 end
0074 return;
0075 %
0076 % --- end of inner_check_argument()
0077 %
0078 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0079 
0080 % --- END OF FILE --- %

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