Home > functions > device > meg > yokogawa > utility > vb_yokogawa_channel_rejection.m

vb_yokogawa_channel_rejection

PURPOSE ^

Reject the selected channels from bexp,pick,Qpick,MEGinfo.sensor_weight.

SYNOPSIS ^

function [MEGinfo,bexp,pick,Qpick] = vb_yokogawa_channel_rejection(MEGinfo,bexp,pick,Qpick,reject_channel)

DESCRIPTION ^

 Reject the selected channels from bexp,pick,Qpick,MEGinfo.sensor_weight.

 [MEGinfo,bexp,pick,Qpick] = ...
     vb_yokogawa_channel_rejection(MEGinfo,bexp,pick,Qpick,reject_channel)
 [IN]
   MEGinfo : struct with MEG acquisition information
       .MEGch_id       % Active MEG channel index (absolute channel index)
       .sensor_weight  % weight to calculate lead field
       .Nchannel       % number of active gardiometers
   bexp(ch,t,trial)       : MEG data (Channel, Time, Trial)
   pick(ch,          1:3) : position of detector coils.
       (ch+Nchannel, 1:3) : position of conpensation coils.
   Qpick(ch,         1:3) : direction of detector coils.
       (ch+Nchannel, 1:3) : direction of conpensation coils.
   reject_channel        : vector of rejected channel number .
                           absolute channel index
 [OUT]
   MEGinfo : struct with MEG acquisition information after rejection
       .MEGch_id       % Active MEG channel index (absolute channel index)
       .MEGch_name     % Active MEG channel name
       .sensor_weight  % weight to calculate lead field
       .Nchannel       % number of active gardiometers after rejection
   bexp(ch,t,trial)       : MEG data (Channel, Time, Trial) after rejection
   pick(ch,          1:3) : position of detector coils.
       (ch+Nchannel, 1:3) : position of conpensation coils.
   Qpick(ch,         1:3) : direction of detector coils.
       (ch+Nchannel, 1:3) : direction of conpensation coils.

 MEG channel index 
 MEGinfo.MEGch_id  : Active MEG channel index (absolute channel index)
   bexp(ch,:)              <-> MEGinfo.MEGch_id(n)
   pick(ch,          1:3)  <-> MEGinfo.MEGch_id(n)
       (ch+Nchannel, 1:3)  <-> MEGinfo.MEGch_id(n)
   Qpick(ch,         1:3)  <-> MEGinfo.MEGch_id(n)
       (ch+Nchannel, 1:3)  <-> MEGinfo.MEGch_id(n)

   2006-05-08 Masanori Osako
   2006-05-14 M. 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 [MEGinfo,bexp,pick,Qpick] = vb_yokogawa_channel_rejection(MEGinfo,bexp,pick,Qpick,reject_channel)
0002 % Reject the selected channels from bexp,pick,Qpick,MEGinfo.sensor_weight.
0003 %
0004 % [MEGinfo,bexp,pick,Qpick] = ...
0005 %     vb_yokogawa_channel_rejection(MEGinfo,bexp,pick,Qpick,reject_channel)
0006 % [IN]
0007 %   MEGinfo : struct with MEG acquisition information
0008 %       .MEGch_id       % Active MEG channel index (absolute channel index)
0009 %       .sensor_weight  % weight to calculate lead field
0010 %       .Nchannel       % number of active gardiometers
0011 %   bexp(ch,t,trial)       : MEG data (Channel, Time, Trial)
0012 %   pick(ch,          1:3) : position of detector coils.
0013 %       (ch+Nchannel, 1:3) : position of conpensation coils.
0014 %   Qpick(ch,         1:3) : direction of detector coils.
0015 %       (ch+Nchannel, 1:3) : direction of conpensation coils.
0016 %   reject_channel        : vector of rejected channel number .
0017 %                           absolute channel index
0018 % [OUT]
0019 %   MEGinfo : struct with MEG acquisition information after rejection
0020 %       .MEGch_id       % Active MEG channel index (absolute channel index)
0021 %       .MEGch_name     % Active MEG channel name
0022 %       .sensor_weight  % weight to calculate lead field
0023 %       .Nchannel       % number of active gardiometers after rejection
0024 %   bexp(ch,t,trial)       : MEG data (Channel, Time, Trial) after rejection
0025 %   pick(ch,          1:3) : position of detector coils.
0026 %       (ch+Nchannel, 1:3) : position of conpensation coils.
0027 %   Qpick(ch,         1:3) : direction of detector coils.
0028 %       (ch+Nchannel, 1:3) : direction of conpensation coils.
0029 %
0030 % MEG channel index
0031 % MEGinfo.MEGch_id  : Active MEG channel index (absolute channel index)
0032 %   bexp(ch,:)              <-> MEGinfo.MEGch_id(n)
0033 %   pick(ch,          1:3)  <-> MEGinfo.MEGch_id(n)
0034 %       (ch+Nchannel, 1:3)  <-> MEGinfo.MEGch_id(n)
0035 %   Qpick(ch,         1:3)  <-> MEGinfo.MEGch_id(n)
0036 %       (ch+Nchannel, 1:3)  <-> MEGinfo.MEGch_id(n)
0037 %
0038 %   2006-05-08 Masanori Osako
0039 %   2006-05-14 M. Sato
0040 %
0041 % Copyright (C) 2011, ATR All Rights Reserved.
0042 % License : New BSD License(see VBMEG_LICENSE.txt)
0043 
0044 % Absolute channel innex for bexp, pick & Qpick
0045 MEGch_id = MEGinfo.MEGch_id;
0046 MEGch_name = MEGinfo.MEGch_name;
0047 Nchannel = length(MEGch_id);
0048 
0049 % Extract active channel index from 'MEGch_id' different from 'reject_channel'
0050 MEG_act = vb_setdiff2(MEGch_id, reject_channel);
0051 
0052 MEGinfo.Nchannel = length(MEG_act);
0053 MEGinfo.MEGch_id = MEG_act;
0054 MEGinfo.MEGch_name = MEGch_name(MEG_act);
0055 
0056 Nmax   = max(MEGch_id);
0057 
0058 if max(reject_channel) > Nmax,
0059     error('Reject channel index is larger than channel number');
0060 end
0061 
0062 if Nchannel ~= (MEGinfo.Nchannel + length(reject_channel))
0063     error('Reject channel index is not in channel index');
0064 end
0065 
0066 % Convert absolute index to relative index
0067 itrans = zeros(Nmax,1);
0068 itrans(MEGch_id) = 1:Nchannel;
0069 
0070 id_act = itrans(MEG_act);                % active channel index
0071 ix_act = [id_act ; id_act + Nchannel];    % active coil index
0072 
0073 % Extract active channel
0074 bexp  = bexp(id_act,:,:);
0075 
0076 pick  = pick(ix_act,:);
0077 Qpick = Qpick(ix_act,:);
0078 
0079 sensor_weight = MEGinfo.sensor_weight(id_act,:);
0080 MEGinfo.sensor_weight = sensor_weight(:,ix_act);

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