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

vb_yokogawa_get_channel_type

PURPOSE ^

return channel type definition

SYNOPSIS ^

function [channel_type] = vb_yokogawa_get_channel_type(select_code)

DESCRIPTION ^

 return channel type definition

 [usage]
   [channel_type] = vb_yokogawa_get_channel_type(select_code)

 [input]
   select_code : <optional> which channel do you want?
               : 1 || 2 || 4 or bitor of them
               :    1) MEG
               :    2) EXTRA
               :    4) REFERENCE
               :  [7]) all

 [output]
   channel_type : <<struct>> [Ntype x 1]
                :  .id   : defined by YOKOGAWA
                :  .name : defined by ATR

 [note]

 [history]
   2008-02-01 (Sako) initial version
   2008-05-16 (rhayashi) repair misspelled(Planner -> Planar)
   2011-06-24 (Sako) modified to increment type_index after EtcChannel

 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:

SOURCE CODE ^

0001 function [channel_type] = vb_yokogawa_get_channel_type(select_code)
0002 % return channel type definition
0003 %
0004 % [usage]
0005 %   [channel_type] = vb_yokogawa_get_channel_type(select_code)
0006 %
0007 % [input]
0008 %   select_code : <optional> which channel do you want?
0009 %               : 1 || 2 || 4 or bitor of them
0010 %               :    1) MEG
0011 %               :    2) EXTRA
0012 %               :    4) REFERENCE
0013 %               :  [7]) all
0014 %
0015 % [output]
0016 %   channel_type : <<struct>> [Ntype x 1]
0017 %                :  .id   : defined by YOKOGAWA
0018 %                :  .name : defined by ATR
0019 %
0020 % [note]
0021 %
0022 % [history]
0023 %   2008-02-01 (Sako) initial version
0024 %   2008-05-16 (rhayashi) repair misspelled(Planner -> Planar)
0025 %   2011-06-24 (Sako) modified to increment type_index after EtcChannel
0026 %
0027 % Copyright (C) 2011, ATR All Rights Reserved.
0028 % License : New BSD License(see VBMEG_LICENSE.txt)
0029 
0030 % --- local constant
0031 CH_MEG = 1;
0032 CH_EXT = 2;
0033 CH_REF = 4;
0034 
0035 % --- DEFINITION of SENSOR TYPE ID
0036 NullChannel         = 0;
0037 MagnetoMeter        = 1;
0038 AxialGradioMeter    = 2;
0039 PlanarGradioMeter   = 3;
0040 
0041 % ReferenceChannelMark
0042 RCMark = hex2dec('0100');
0043 % Ref_ means Reference
0044 Ref_MagnetoMeter       = bitor(RCMark, MagnetoMeter);
0045 Ref_AxialGradioMeter   = bitor(RCMark, AxialGradioMeter);
0046 Ref_PlanarGradioMeter  = bitor(RCMark, PlanarGradioMeter);
0047 
0048 TriggerChannel      = -1;
0049 EegChannel          = -2;
0050 EcgChannel          = -3;
0051 EtcChannel          = -4;
0052 
0053 % set channel_type fields
0054 type_index = 1;
0055 
0056 if bitand(select_code, CH_MEG) == CH_MEG
0057   channel_type(type_index).id = MagnetoMeter;
0058   channel_type(type_index).name = 'MagnetoMeter';
0059   type_index = type_index + 1;
0060 
0061   channel_type(type_index).id = AxialGradioMeter;
0062   channel_type(type_index).name = 'AxialGradioMeter';
0063   type_index = type_index + 1;
0064 
0065   channel_type(type_index).id = PlanarGradioMeter;
0066   channel_type(type_index).name = 'PlanarGradioMeter';
0067   type_index = type_index + 1;
0068 end
0069 
0070 % --- EXTRA CHANNEL
0071 if bitand(select_code, CH_EXT) == CH_EXT
0072   channel_type(type_index).id = NullChannel;
0073   channel_type(type_index).name = 'NullChannel';
0074   type_index = type_index + 1;
0075 
0076   channel_type(type_index).id = TriggerChannel;
0077   channel_type(type_index).name = 'TriggerChannel';
0078   type_index = type_index + 1;
0079 
0080   channel_type(type_index).id = EegChannel;
0081   channel_type(type_index).name = 'EegChannel';
0082   type_index = type_index + 1;
0083 
0084   channel_type(type_index).id = EcgChannel;
0085   channel_type(type_index).name = 'EcgChannel';
0086   type_index = type_index + 1;
0087 
0088   channel_type(type_index).id = EtcChannel;
0089   channel_type(type_index).name = 'EtcChannel';
0090   type_index = type_index + 1;
0091 end
0092 
0093 % --- REFERENCE CHANNEL
0094 if bitand(select_code, CH_REF) == CH_REF
0095   channel_type(type_index).id = Ref_MagnetoMeter;
0096   channel_type(type_index).name = 'ReferenceMagnetoMeter';
0097   type_index = type_index + 1;
0098 
0099   channel_type(type_index).id = Ref_AxialGradioMeter;
0100   channel_type(type_index).name = 'ReferenceAxialGradioMeter';
0101   type_index = type_index + 1;
0102 
0103   channel_type(type_index).id = Ref_PlanarGradioMeter;
0104   channel_type(type_index).name = 'ReferencePlanarGradioMeter';
0105   type_index = type_index + 1;
0106 end
0107 
0108 channel_type = channel_type';
0109 return;
0110 
0111 % --- END OF FILE --- %

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