Home > functions > device > meg > vb_meginfo_get_channel_number_refmg.m

vb_meginfo_get_channel_number_refmg

PURPOSE ^

get number of refference magnetometer channel from MEGinfo struct

SYNOPSIS ^

function Nchannel = vb_meginfo_get_channel_number_refmg(meginfo, active_swt)

DESCRIPTION ^

 get number of refference magnetometer channel from MEGinfo struct
 [usage]
   Nchannel = vb_meginfo_get_channel_number_refmg(meginfo, active_swt)
 [input]
      meginfo : <required> <<struct>> MEG information
   active_swt : <optional> <<boolean>> [false] switch for active filter
              :   true) only active channels
              :  false) all the channels
 [output]
     Nchannel : number of refference magnetometer channel
 [note]
   @see MEGinfo.ExtraChannelInfo
   @see vb_meginfo_get_channel_label_refmg
 [history]
   2007-06-27 (Sako) initial version
   2008-02-01 (Sako) modified for new spec
   2008-05-01 (Sako) added active_swt

 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 Nchannel = vb_meginfo_get_channel_number_refmg(meginfo, active_swt)
0002 % get number of refference magnetometer channel from MEGinfo struct
0003 % [usage]
0004 %   Nchannel = vb_meginfo_get_channel_number_refmg(meginfo, active_swt)
0005 % [input]
0006 %      meginfo : <required> <<struct>> MEG information
0007 %   active_swt : <optional> <<boolean>> [false] switch for active filter
0008 %              :   true) only active channels
0009 %              :  false) all the channels
0010 % [output]
0011 %     Nchannel : number of refference magnetometer channel
0012 % [note]
0013 %   @see MEGinfo.ExtraChannelInfo
0014 %   @see vb_meginfo_get_channel_label_refmg
0015 % [history]
0016 %   2007-06-27 (Sako) initial version
0017 %   2008-02-01 (Sako) modified for new spec
0018 %   2008-05-01 (Sako) added active_swt
0019 %
0020 % Copyright (C) 2011, ATR All Rights Reserved.
0021 % License : New BSD License(see VBMEG_LICENSE.txt)
0022 
0023 % --- CHECK ARGUMENTS --- %
0024 if ~exist('meginfo', 'var'), meginfo = []; end
0025 if ~exist('active_swt', 'var'), active_swt = []; end
0026 [meginfo, active_swt] = inner_check_arguments(meginfo, active_swt);
0027 
0028 % --- MAIN PROCEDURE --------------------------------------------------------- %
0029 %
0030 refmg_ch_name = vb_meginfo_get_channel_label_refmg(meginfo, active_swt);
0031 Nchannel = size(refmg_ch_name,1);
0032 return;
0033 %
0034 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0035 
0036 % --- INNER FUNCTIONS -------------------------------------------------------- %
0037 %
0038 % --- inner_check_arguments()
0039 %
0040 function [meginfo, active_swt] = inner_check_arguments(meginfo, active_swt)
0041 func_ = mfilename;
0042 if isempty(meginfo)
0043   error('(%s)meginfo is a required parameter', func_);
0044 end
0045 
0046 if ~isfield(meginfo, 'ExtraChannelInfo')
0047   error('(%s)meginfo must have ExtraChannelInfo field', func_);
0048 end
0049 
0050 if isempty(active_swt)
0051   active_swt = false;
0052 end
0053 return;
0054 %
0055 % --- end of inner_check_arguments()
0056 
0057 %
0058 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0059 
0060 %%% END OF FILE %%%

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