Home > vbmeg > demo > test_scripts > sbi > sbi_channel_rejection.m

sbi_channel_rejection

PURPOSE ^

Reject the selected channels from bexp,pick,Qpick,CoilWeight.

SYNOPSIS ^

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

DESCRIPTION ^

 Reject the selected channels from bexp,pick,Qpick,CoilWeight.

 [MEGinfo,bexp,pick,Qpick] = ...
     sbi_channel_rejection(MEGinfo,bexp,pick,Qpick,CoilWeight,reject_channel)
 [IN]
   MEGinfo : struct with MEG acquisition information
       .MEGch_id         Active MEG channel index (absolute channel inndex)
       .sensor_weight  % weight to calculate lead field
   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.
   CoilWeight             : = MEGinfo.sensor_weight of yokogawa.
   reject_channel        : vector of rejected channel number .
                           absolute channel inndex
 [OUT]
   MEGinfo : struct with MEG acquisition information after rejection
       .MEGch_id         Active MEG channel index (absolute channel inndex)
       .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.
   CoilWeight             : = MEGinfo.sensor_weight of yokogawa

 MEG channel index 
 MEGinfo.MEGch_id  : Active MEG channel index (absolute channel inndex)
   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)
   CoilWeight             

   2006-05-08 Masanori Osako
   2006-05-14 M. Sato
   2006-06-19 D. Kawawaki modified based on "yokogawa_channel_rejection".

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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005