0001 function [acq_cond] = vb_ykgwfile_load_acq_cond(ykgwfile)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 [ykgwfile] = inner_check_arguments(ykgwfile);
0024
0025
0026
0027 acq_cond_org = getYkgwHdrAcqCond(ykgwfile);
0028 vb_define_device;
0029
0030
0031
0032
0033
0034 switch acq_cond_org.acq_type
0035 case AcqTypeContinuousRaw
0036
0037
0038
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
0052
0053
0054
0055
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
0073
0074
0075
0076
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
0098
0099
0100
0101
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
0115
0116
0117
0118