Home > functions > common > loadfunc > vb_load_channel.m

vb_load_channel

PURPOSE ^

This function returns channel coordinate value for plot

SYNOPSIS ^

function [pos] = vb_load_channel(megfile, active_swt)

DESCRIPTION ^

 This function returns channel coordinate value for plot
 [usage]
   [pos] = vb_load_channel(megfile, active_swt)
 [input]
      megfile : <required> <<file>> MEG/EEG-MAT file
   active_swt : <optional> <<boolean>> active switch [false]
              :   true) return only active channels
              :  false) return all then channels
 [output]
          pos : 3D-coordinate of channel position [Nchannel x 3]
 [note]
   does not check parameter
 [history]
   2007-8-23 Masa-aki Sato
   2008-04-16 (Sako) added active_swt
   2011-08-31 (Sako) modified how to call vb_load_sensor

 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    [pos] = vb_load_channel(megfile, active_swt)
0002 % This function returns channel coordinate value for plot
0003 % [usage]
0004 %   [pos] = vb_load_channel(megfile, active_swt)
0005 % [input]
0006 %      megfile : <required> <<file>> MEG/EEG-MAT file
0007 %   active_swt : <optional> <<boolean>> active switch [false]
0008 %              :   true) return only active channels
0009 %              :  false) return all then channels
0010 % [output]
0011 %          pos : 3D-coordinate of channel position [Nchannel x 3]
0012 % [note]
0013 %   does not check parameter
0014 % [history]
0015 %   2007-8-23 Masa-aki Sato
0016 %   2008-04-16 (Sako) added active_swt
0017 %   2011-08-31 (Sako) modified how to call vb_load_sensor
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 if ~exist('active_swt', 'var') || isempty(active_swt)
0023   active_swt = false;
0024 end
0025 
0026 [pos, Qpick, CoilWeight] = vb_load_sensor(megfile, '', '', active_swt);
0027 
0028 if isempty(CoilWeight)
0029     ix_coil = 1:size(pos,1);
0030 else    
0031     [ix_ch, ix_coil] = find( CoilWeight > 0);
0032 end
0033 
0034 pos = pos(ix_coil,:);
0035 
0036 % --- END OF FILE --- %

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