Home > functions > device > eeg > biosemi > vb_read_ch_data.m

vb_read_ch_data

PURPOSE ^

read experiment data from channel binary data file

SYNOPSIS ^

function [new_info, exp_data, read_ch_info] = vb_read_ch_data(old_info, to_read_swt, ch_list, time_from, time_to, verbose_swt)

DESCRIPTION ^

 read experiment data from channel binary data file
 [usage]
   [new_info, exp_data, read_ch_info] = vb_read_ch_data( ...
       old_info, ...
       output_path, to_read_swt, ch_list, time_from, time_to, verbose_swt)
 [input]
       old_info : <required> <<struct>> MEGinfo or EEGinfo
    to_read_swt : <optional> (true or false) purpose of "ch_list". [false]
                :   true : ch_list is to read
                :  false : ch_list is to omit
        ch_list : <conditionally optional>
                :  list of channel label that you want to get
                :   if this "ch_list" is empty and ...
                :     1) if "to_read_swt" is true ---> error
                :     2) if "to_read_swt" is false --> read every channel
      time_from : <optional> [msec]
                :   beginning time that you want to get [0] (>=0)
        time_to : <optional> [msec]
                :   end of time that you want to get [end of data]
                :   (>(time_from))
    verbose_swt : <optional> switch to output verbose message [true]
 [output]
       new_info : new information struct data
                :   (EEGinfo -> EEGinfo, MEGinfo -> MEGinfo)
       exp_data : experiment data ([Nchannel x Nsample x Ntrial])
 [note]
   @see vb_read_ch_data_eeg
   *** This function is DEPRECATED due to its incomplete check. ***
 [history]
   2006-12-21 (Sako) initial version
   2011-05-30 (Sako) modified to convert "Measurement" 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 [new_info, exp_data, read_ch_info] = vb_read_ch_data( ...
0002   old_info, to_read_swt, ch_list, time_from, time_to, verbose_swt)
0003 % read experiment data from channel binary data file
0004 % [usage]
0005 %   [new_info, exp_data, read_ch_info] = vb_read_ch_data( ...
0006 %       old_info, ...
0007 %       output_path, to_read_swt, ch_list, time_from, time_to, verbose_swt)
0008 % [input]
0009 %       old_info : <required> <<struct>> MEGinfo or EEGinfo
0010 %    to_read_swt : <optional> (true or false) purpose of "ch_list". [false]
0011 %                :   true : ch_list is to read
0012 %                :  false : ch_list is to omit
0013 %        ch_list : <conditionally optional>
0014 %                :  list of channel label that you want to get
0015 %                :   if this "ch_list" is empty and ...
0016 %                :     1) if "to_read_swt" is true ---> error
0017 %                :     2) if "to_read_swt" is false --> read every channel
0018 %      time_from : <optional> [msec]
0019 %                :   beginning time that you want to get [0] (>=0)
0020 %        time_to : <optional> [msec]
0021 %                :   end of time that you want to get [end of data]
0022 %                :   (>(time_from))
0023 %    verbose_swt : <optional> switch to output verbose message [true]
0024 % [output]
0025 %       new_info : new information struct data
0026 %                :   (EEGinfo -> EEGinfo, MEGinfo -> MEGinfo)
0027 %       exp_data : experiment data ([Nchannel x Nsample x Ntrial])
0028 % [note]
0029 %   @see vb_read_ch_data_eeg
0030 %   *** This function is DEPRECATED due to its incomplete check. ***
0031 % [history]
0032 %   2006-12-21 (Sako) initial version
0033 %   2011-05-30 (Sako) modified to convert "Measurement" to upper case
0034 %
0035 % Copyright (C) 2011, ATR All Rights Reserved.
0036 % License : New BSD License(see VBMEG_LICENSE.txt)
0037 tic;
0038 
0039 % load common definitions for biosemi functions of vbmeg
0040 vb_define_device;
0041 
0042 % --- CHECK ARGUMENT --- %
0043 if ~exist('old_info', 'var'), old_info = []; end
0044 if ~exist('to_read_swt', 'var'), to_read_swt = []; end
0045 if ~exist('ch_list', 'var'), ch_list = []; end
0046 if ~exist('time_from', 'var'), time_from = []; end
0047 if ~exist('time_to', 'var'), time_to = []; end
0048 if ~exist('verbose_swt', 'var'), verbose_swt = []; end
0049 
0050 [old_info, to_read_swt, ch_list, time_from, time_to, verbose_swt] = ...
0051   inner_check_argument( ...
0052   old_info, to_read_swt, ch_list, time_from, time_to, verbose_swt);
0053 
0054 % --- MAIN PROCEDURE --------------------------------------------------------- %
0055 %
0056 my_measurement = vb_info_get_measurement(old_info);
0057 Measurement = upper(my_measurement);
0058 
0059 switch Measurement
0060   case  'EEG'
0061     [new_info, exp_data, read_ch_info] = ...
0062       vb_read_ch_data_eeg(old_info, ...
0063         to_read_swt, ch_list, time_from, time_to, verbose_swt);
0064     
0065   case  'MEG'
0066     % not be implemented yet
0067     
0068   otherwise
0069     error('unexpected measurement : %s', my_measurement);
0070 end
0071 fprintf('=== READ CHANNEL DATA (%f[sec])=== \n', toc);
0072 %
0073 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0074 
0075 
0076 % --- INNER FUNCTIONS -------------------------------------------------------- %
0077 %
0078 % --- inner_check_argument()
0079 %
0080 function [old_info, to_read_swt, ch_list, time_from, time_to, verbose_swt] = ...
0081   inner_check_argument(old_info, ...
0082     to_read_swt, ch_list, time_from, time_to, verbose_swt)
0083 
0084 if isempty(old_info)
0085   error('old_info is a required parameter');
0086 end
0087 %
0088 % --- end of inner_check_argument()
0089 
0090 % --- END OF FILE --- %

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005