Home > functions > gui > preAnalysis > trial_extractor > private > vb_continuous_file_new.m

vb_continuous_file_new

PURPOSE ^

continuous file data.

SYNOPSIS ^

function [obj] = vb_continuous_file_new(file, read_ch_list)

DESCRIPTION ^

 continuous file data.
 [USAGE]
    obj = continous_file_new(file);
 [IN]
              file : continous MEG/EEG-MAT file.
      read_ch_list : <<optional>> if this list is specified,
                     continous_file_get_sample() only returns these
                     channels.
 [OUT]
     obj : continous_file object.

 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:

SOURCE CODE ^

0001 function [obj] = vb_continuous_file_new(file, read_ch_list)
0002 % continuous file data.
0003 % [USAGE]
0004 %    obj = continous_file_new(file);
0005 % [IN]
0006 %              file : continous MEG/EEG-MAT file.
0007 %      read_ch_list : <<optional>> if this list is specified,
0008 %                     continous_file_get_sample() only returns these
0009 %                     channels.
0010 % [OUT]
0011 %     obj : continous_file object.
0012 %
0013 % Copyright (C) 2011, ATR All Rights Reserved.
0014 % License : New BSD License(see VBMEG_LICENSE.txt)
0015 
0016 %
0017 % --- Previous check
0018 %
0019 if ~exist('file', 'var')
0020     error('file is a required parameter.');
0021 end
0022 if exist(file, 'file') ~= 2
0023     error('Specified continous file doesn''t exist.');
0024 end
0025 if ~exist('read_ch_list', 'var')
0026     read_ch_list = ''; % means read all channel
0027 end
0028 
0029 %
0030 % --- Main Procedure
0031 %
0032 
0033 % Check continous data or not
0034 MEGinfo = vb_load_meg_info(file);
0035 if MEGinfo.Nrepeat ~= 1
0036     error('Specfied file is not a continuous MEG/EEG file.');
0037 end
0038 
0039 %
0040 % --- Main Procedure
0041 %
0042 obj = struct;
0043 obj.filename = file;
0044 obj.MEGinfo  = MEGinfo;
0045 obj.read_ch_list = read_ch_list;
0046 
0047 %
0048 % --- After check
0049 %
0050 if nargout < 1
0051     error('continuous_file object should be received.');
0052 end

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