0001 function [comp] = mne_get_current_comp(info)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
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