Home > functions > device > meg > yokogawa > vb_ykgwfile_load_acq_cond.m

vb_ykgwfile_load_acq_cond

PURPOSE ^

load data acquisition condition from yokogawa file

SYNOPSIS ^

function [acq_cond] = vb_ykgwfile_load_acq_cond(ykgwfile)

DESCRIPTION ^

 load data acquisition condition from yokogawa file

 [usage]
   [acq_cond] = vb_ykgwfile_load_acq_cond(ykgwfile)

 [input]
   ykgwfile : <required> <<file>> yokogawa file

 [output]
   acq_cond : <<struct>> acquisition condition 
            :  (Continuous, Evoked, sampling rate, trigger settings, etc)

 [note]
 
 [history]
   2011-04-15 (Sako) replaced old function with this

 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 [acq_cond] = vb_ykgwfile_load_acq_cond(ykgwfile)
0002 % load data acquisition condition from yokogawa file
0003 %
0004 % [usage]
0005 %   [acq_cond] = vb_ykgwfile_load_acq_cond(ykgwfile)
0006 %
0007 % [input]
0008 %   ykgwfile : <required> <<file>> yokogawa file
0009 %
0010 % [output]
0011 %   acq_cond : <<struct>> acquisition condition
0012 %            :  (Continuous, Evoked, sampling rate, trigger settings, etc)
0013 %
0014 % [note]
0015 %
0016 % [history]
0017 %   2011-04-15 (Sako) replaced old function with this
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 % --- CHECK ARGUMENTS --- %
0023 [ykgwfile] = inner_check_arguments(ykgwfile);
0024 
0025 % --- MAIN PROCEDURE --------------------------------------------------------- %
0026 %
0027 acq_cond_org = getYkgwHdrAcqCond(ykgwfile);
0028 vb_define_device;
0029 
0030 % AcqTypeContinuousRaw = 1;
0031 % AcqTypeEvokedAve     = 2;
0032 % AcqTypeEvokedRaw     = 3;
0033 
0034 switch acq_cond_org.acq_type
0035   case AcqTypeContinuousRaw
0036     % extra return values are as follows.
0037     %  .sample_rate  : Sampling rate [Hz]
0038     %  .sample_count : The number of samples which were actually acquired
0039     acq_cond = ...
0040       struct('type'                , 'Continuous_Raw', ...
0041              'type_code'           , acq_cond_org.acq_type, ...
0042              'sample_rate'         , acq_cond_org.sample_rate, ...
0043              'frame_length'        , acq_cond_org.sample_count, ...
0044              'pretrigger_length'   , [], ...
0045              'num_epoch'           , 1 , ...
0046              'setup_sample_count'  , [], ...
0047              'trigger_mode'        , [], ...
0048              'trigger_setting'     , [] );
0049     
0050   case AcqTypeEvokedAve
0051     % extra return values are as follows.
0052     %  .sample_rate
0053     %  .frame_length
0054     %  .pretrigger_length
0055     %  .average_count
0056     acq_cond = ...
0057       struct('type'                  , 'Evoked_Ave', ...
0058              'type_code'             , acq_cond_org.acq_type, ...
0059              'sample_rate'           , acq_cond_org.sample_rate, ...
0060              'frame_length'          , acq_cond_org.frame_length, ...
0061              'pretrigger_length'     , acq_cond_org.pretrigger_length, ...
0062              'setup_average_count'   , [], ...
0063              'actual_average_count'  , acq_cond_org.average_count, ...
0064              'num_epoch'             , 1, ...
0065              'rejected_average_count', [], ...
0066              'trigger_mode'          , [], ...
0067              'trigger_setting'       , [], ...
0068              'multi_trigger_count'   , [], ...
0069              'multi_trigger_list'    , [] );
0070     
0071   case AcqTypeEvokedRaw
0072     % extra return values are as follows.
0073     %  .sample_rate
0074     %  .frame_length
0075     %  .pretrigger_length
0076     %  .average_count
0077     acq_cond = ...
0078       struct('type'                  , 'Evoked_Raw', ...
0079              'type_code'             , acq_cond_org.acq_type, ...
0080              'sample_rate'           , acq_cond_org.sample_rate, ...
0081              'frame_length'          , acq_cond_org.frame_length, ...
0082              'pretrigger_length'     , acq_cond_org.pretrigger_length, ...
0083              'setup_measure_count'   , [], ...
0084              'num_epoch'             , acq_cond_org.average_count, ...
0085              'rejected_measure_count', [], ...
0086              'trigger_mode'          , [], ...
0087              'trigger_setting'       , [], ...
0088              'multi_trigger_count'   , [], ...
0089              'multi_trigger_list'    , [] );
0090            
0091   otherwise
0092     warning('(%s) invalid acq_type : %d\n', mfilename, acq_cond_org.acq_type);
0093     acq_cond = [];
0094 end
0095 return;
0096 %
0097 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0098 
0099 % --- INNER FUNCTIONS -------------------------------------------------------- %
0100 %
0101 % --- inner_check_arguments()
0102 %
0103 function [ykgwfile] = inner_check_arguments(ykgwfile)
0104 func_ = mfilename;
0105 if isempty(ykgwfile)
0106   error('(%s) ykgwfile is a required parameter', func_);
0107 end
0108 
0109 if exist(ykgwfile, 'file') ~= 2
0110   error('(%s) cannot find ykgwfile : %s', func_, ykgwfile);
0111 end
0112 return;
0113 %
0114 % --- end of inner_check_arguments()
0115 %
0116 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0117 
0118 % --- END OF File --- %

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