Home > functions > device > meg > vb_meginfo_set_acqtype.m

vb_meginfo_set_acqtype

PURPOSE ^

<<setter>> for acquisition type of MEGinfo

SYNOPSIS ^

function [meginfo] = vb_meginfo_set_acqtype(meginfo, acqinfo)

DESCRIPTION ^

 <<setter>> for acquisition type of MEGinfo

 [usage]
   [meginfo] = vb_meginfo_set_acqtype(meginfo, acqinfo)

 [input]
   meginfo : <required> <<struct>> MEGinfo
   acqinfo : <optional> <<struct>> or <<string>>
           :  --- <<struct>> ---
           :  If acqinfo is struct it is expected to have following fields.
           :   (must)
           :   .type
           :   .type_code
           :   (following fields are not used here)
           :   .sample_rate
           :   .frame_length
           :   .pretrigger_length
           :   .num_epoch
           :   .setup_sample_count
           :   .trigger_mode
           :   .trigger_setting
           :
           :  --- <<string>> ---
           :  acquisition type string []
           :  e.g.
           :  'Continuous_Raw'
           :  'Evoked_Ave'
           :  'Evoked_Raw'

 [output]
   meginfo : MEGinfo after updating

 [note]
   
 [history]
   2008-02-21 (Sako) initial version
   2011-05-26 (Sako) modified according to the new data format
   2011-06-24 (Sako) modified to fit the new YOKOGAWA library

 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 [meginfo] = vb_meginfo_set_acqtype(meginfo, acqinfo)
0002 % <<setter>> for acquisition type of MEGinfo
0003 %
0004 % [usage]
0005 %   [meginfo] = vb_meginfo_set_acqtype(meginfo, acqinfo)
0006 %
0007 % [input]
0008 %   meginfo : <required> <<struct>> MEGinfo
0009 %   acqinfo : <optional> <<struct>> or <<string>>
0010 %           :  --- <<struct>> ---
0011 %           :  If acqinfo is struct it is expected to have following fields.
0012 %           :   (must)
0013 %           :   .type
0014 %           :   .type_code
0015 %           :   (following fields are not used here)
0016 %           :   .sample_rate
0017 %           :   .frame_length
0018 %           :   .pretrigger_length
0019 %           :   .num_epoch
0020 %           :   .setup_sample_count
0021 %           :   .trigger_mode
0022 %           :   .trigger_setting
0023 %           :
0024 %           :  --- <<string>> ---
0025 %           :  acquisition type string []
0026 %           :  e.g.
0027 %           :  'Continuous_Raw'
0028 %           :  'Evoked_Ave'
0029 %           :  'Evoked_Raw'
0030 %
0031 % [output]
0032 %   meginfo : MEGinfo after updating
0033 %
0034 % [note]
0035 %
0036 % [history]
0037 %   2008-02-21 (Sako) initial version
0038 %   2011-05-26 (Sako) modified according to the new data format
0039 %   2011-06-24 (Sako) modified to fit the new YOKOGAWA library
0040 %
0041 % Copyright (C) 2011, ATR All Rights Reserved.
0042 % License : New BSD License(see VBMEG_LICENSE.txt)
0043 
0044 % --- CHECK ARGUMENTS --- %
0045 if ~exist('meginfo', 'var'), meginfo = []; end
0046 if ~exist('acqinfo', 'var'), acqinfo = []; end
0047 [meginfo, acqinfo] = inner_check_arguments(meginfo, acqinfo);
0048 
0049 % --- MAIN PROCEDURE --------------------------------------------------------- %
0050 %
0051 if isstruct(acqinfo)
0052   % --- <<struct>>
0053   if isfield(acqinfo, 'type')
0054     meginfo.device_info.acq_type = acqinfo.type;
0055   end
0056   if isfield(acqinfo, 'type_code')
0057     meginfo.acq_type_code = acqinfo.type_code;
0058   end
0059 else
0060   % --- <<string>> = old fashion
0061   meginfo.device_info.acq_type = acqinfo;
0062 end
0063 return;
0064 %
0065 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0066 
0067 % --- INNER FUNCTIONS -------------------------------------------------------- %
0068 %
0069 % --- inner_check_arguments()
0070 %
0071 function [meginfo, acqinfo] = inner_check_arguments(meginfo, acqinfo)
0072 func_ = mfilename;
0073 
0074 if isempty(meginfo)
0075   error('(%s)meginfo is a required parameter', func_);
0076 end
0077 
0078 if isempty(acqinfo)
0079   acqinfo = '';
0080   % require no action because this will be set as it is empty
0081 end
0082 return;
0083 %
0084 % --- end of inner_check_arguments()
0085 %
0086 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0087 
0088 % --- END OF FILE --- %

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