Home > vbmeg > functions > device > meg > vb_meginfo_get_data_bit_len.m

vb_meginfo_get_data_bit_len

PURPOSE ^

MEGinfo getter for data bit length

SYNOPSIS ^

function [bit_len] = vb_meginfo_get_data_bit_len(meg_info)

DESCRIPTION ^

 MEGinfo getter for data bit length

 [usage]
   [bit_len] = vb_meginfo_get_data_bit_len(meg_info)

 [input]
   meg_info : <required> <<struct>> MEG header information

 [output]
    bit_len : data bit length

 [note]
   if the given meg_info does not have an appropriate field, return empty
   The new standard format is defined. (2011-05)

 [history]
   2007-06-12 (Sako) initial version
   2011-05-26 (Sako) modified according to the new data format

 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 [bit_len] = vb_meginfo_get_data_bit_len(meg_info)
0002 % MEGinfo getter for data bit length
0003 %
0004 % [usage]
0005 %   [bit_len] = vb_meginfo_get_data_bit_len(meg_info)
0006 %
0007 % [input]
0008 %   meg_info : <required> <<struct>> MEG header information
0009 %
0010 % [output]
0011 %    bit_len : data bit length
0012 %
0013 % [note]
0014 %   if the given meg_info does not have an appropriate field, return empty
0015 %   The new standard format is defined. (2011-05)
0016 %
0017 % [history]
0018 %   2007-06-12 (Sako) initial version
0019 %   2011-05-26 (Sako) modified according to the new data format
0020 %
0021 % Copyright (C) 2011, ATR All Rights Reserved.
0022 % License : New BSD License(see VBMEG_LICENSE.txt)
0023 
0024 % --- CHECK ARGUMENTS --- %
0025 if ~exist('meg_info', 'var'), meg_info = []; end
0026 [meg_info] = inner_check_arguments(meg_info);
0027 
0028 % --- MAIN PROCEDURE --------------------------------------------------------- %
0029 %
0030 bit_len = [];
0031 if isfield(meg_info, 'device_info')
0032   if isfield(meg_info.device_info, 'acq_info')
0033     if isfield(meg_info.device_info.acq_info, 'data_bit_len')
0034       bit_len = meg_info.device_info.acq_info.data_bit_len;
0035     else
0036 %       warning('device_info.acq_info does not have ''data_bit_len'' field\n');
0037     end
0038   else
0039 %     warning('device_info does not have ''acq_info'' field\n');
0040   end
0041 else
0042   if isfield(meg_info, 'acq_info')
0043     if isfield(meg_info.acq_info, 'data_bit_len')
0044       bit_len = meg_info.acq_info.data_bit_len;
0045     else
0046 %       warning('acq_info does not have ''data_bit_len'' field\n');
0047     end
0048   else
0049 %     warning('meg_info does not have ''acq_info'' field\n');
0050   end
0051 end
0052 return;
0053 %
0054 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0055 
0056 
0057 % --- INNER FUNCTIONS -------------------------------------------------------- %
0058 %
0059 % --- inner_check_arguments()
0060 %
0061 function [meg_info] = inner_check_arguments(meg_info)
0062 func_ = mfilename;
0063 if isempty(meg_info)
0064   error('(%s)meg_info is a required parameter', func_);
0065 end
0066 return;
0067 %
0068 % --- end of inner_check_arguments()
0069 %
0070 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0071 
0072 % --- END OF FILE --- %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005