Home > vbmeg > external > mne > mne_get_current_comp.m

mne_get_current_comp

PURPOSE ^

SYNOPSIS ^

function [comp] = mne_get_current_comp(info)

DESCRIPTION ^

 [comp] = mne_get_current_comp(info)

 Get the current compensation in effect in the data

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [comp] = mne_get_current_comp(info)
0002 %
0003 % [comp] = mne_get_current_comp(info)
0004 %
0005 % Get the current compensation in effect in the data
0006 %
0007 
0008 
0009 %
0010 %   Author : Matti Hamalainen, MGH Martinos Center
0011 %   License : BSD 3-clause
0012 %
0013 %
0014 %   Revision 1.2  2006/04/23 15:29:40  msh
0015 %   Added MGH to the copyright
0016 %
0017 %   Revision 1.1  2006/04/12 10:51:19  msh
0018 %   Added projection writing and compensation routines
0019 %
0020 %
0021 
0022 me='MNE:mne_get_current_comp';
0023 
0024 global FIFF;
0025 if isempty(FIFF)
0026    FIFF = fiff_define_constants();
0027 end
0028 
0029 comp = 0;
0030 first_comp = -1;
0031 for k = 1:info.nchan
0032     if info.chs(k).kind == FIFF.FIFFV_MEG_CH
0033         comp = bitshift(double(info.chs(k).coil_type),-16);
0034         if first_comp < 0
0035             first_comp = comp;
0036         elseif comp ~= first_comp
0037             error(me,'Compensation is not set equally on all MEG channels');
0038         end
0039     end
0040 end
0041 
0042 return;
0043

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