Home > functions > common > loadfunc > vb_load_channel_pos.m

vb_load_channel_pos

PURPOSE ^

This function returns channel coordinate value for plot

SYNOPSIS ^

function [pos] = vb_load_channel_pos(megfile, ch_indx)

DESCRIPTION ^

 This function returns channel coordinate value for plot
 [usage]
   [pos] = vb_load_channel_pos(megfile)
   [pos] = vb_load_channel_pos(megfile, ch_indx)
 [input]
      megfile : <required> <<file>> MEG/EEG-MAT file
   ch_indx    : <optional> channel index to load
 [output]
          pos : 3D-coordinate of channel position [Nchannel x 3]
 [history]
   2007-8-23 Masa-aki Sato
   2009-8-06 Masa-aki Sato

 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_pos(megfile, ch_indx)
0002 % This function returns channel coordinate value for plot
0003 % [usage]
0004 %   [pos] = vb_load_channel_pos(megfile)
0005 %   [pos] = vb_load_channel_pos(megfile, ch_indx)
0006 % [input]
0007 %      megfile : <required> <<file>> MEG/EEG-MAT file
0008 %   ch_indx    : <optional> channel index to load
0009 % [output]
0010 %          pos : 3D-coordinate of channel position [Nchannel x 3]
0011 % [history]
0012 %   2007-8-23 Masa-aki Sato
0013 %   2009-8-06 Masa-aki Sato
0014 %
0015 % Copyright (C) 2011, ATR All Rights Reserved.
0016 % License : New BSD License(see VBMEG_LICENSE.txt)
0017 
0018 [pos, Qpick, CoilWeight] = vb_load_sensor(megfile);
0019 
0020 if isempty(CoilWeight)
0021     if nargin==1 || isempty(ch_indx)
0022         ix_coil = 1:size(pos,1);
0023     else
0024         ix_coil = ch_indx;
0025     end
0026 else    
0027     if nargin==1 || isempty(ch_indx)
0028         [ix_ch, ix_coil] = find( CoilWeight > 0);
0029     else
0030         [ix_ch, ix_coil] = find( CoilWeight(ch_indx,:) > 0);
0031     end
0032 end
0033 
0034 pos = pos(ix_coil,:);

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