Home > vbmeg > external > mne > mne_set_current_comp.m

mne_set_current_comp

PURPOSE ^

SYNOPSIS ^

function new_chs = mne_set_current_comp(chs,value)

DESCRIPTION ^

 mne_set_current_comp(chs,value)

 Set the current compensation value in the channel info structures

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function new_chs = mne_set_current_comp(chs,value)
0002 %
0003 % mne_set_current_comp(chs,value)
0004 %
0005 % Set the current compensation value in the channel info structures
0006 %
0007 
0008 
0009 %
0010 %   Author : Matti Hamalainen, MGH Martinos Center
0011 %   License : BSD 3-clause
0012 %
0013 %
0014 %   Revision 1.5  2008/11/18 02:38:51  msh
0015 %   Modified mne_ex_read_evoked to apply projection and compensation
0016 %   Modified mne_ex_read_raw to call mne_set_current_comp
0017 %
0018 %   Revision 1.4  2006/04/23 15:29:41  msh
0019 %   Added MGH to the copyright
0020 %
0021 %   Revision 1.3  2006/04/18 20:44:46  msh
0022 %   Added reading of forward solution.
0023 %   Use length instead of size when appropriate
0024 %
0025 %   Revision 1.2  2006/04/14 15:49:49  msh
0026 %   Improved the channel selection code and added ch_names to measurement info.
0027 %
0028 %   Revision 1.1  2006/04/12 10:51:19  msh
0029 %   Added projection writing and compensation routines
0030 %
0031 %
0032 
0033 me='MNE:mne_set_current_comp';
0034 
0035 global FIFF;
0036 if isempty(FIFF)
0037    FIFF = fiff_define_constants();
0038 end
0039 
0040 new_chs = chs;
0041 
0042 lower_half = hex2dec('FFFF');
0043 for k = 1:length(chs)
0044     if chs(k).kind == FIFF.FIFFV_MEG_CH
0045         coil_type = bitand(double(chs(k).coil_type),lower_half);
0046         new_chs(k).coil_type = int32(bitor(coil_type,bitshift(value,16)));
0047     end
0048 end
0049 
0050 return;
0051

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