[res] = fiff_reset_ch_pos(chs) Reset channel position data to their original values as listed in the fif file NOTE: Only the coil_trans field is modified by this routine, not loc which remains to reflect the original data read from the fif file
0001 function [res] = fiff_reset_ch_pos(chs) 0002 % 0003 % [res] = fiff_reset_ch_pos(chs) 0004 % 0005 % Reset channel position data to their original values as listed in 0006 % the fif file 0007 % 0008 % NOTE: Only the coil_trans field is modified by this routine, not 0009 % loc which remains to reflect the original data read from the fif file 0010 % 0011 % 0012 0013 % 0014 % Author : Matti Hamalainen, MGH Martinos Center 0015 % License : BSD 3-clause 0016 % 0017 % 0018 % Revision 1.4 2006/05/03 18:53:05 msh 0019 % Approaching Matlab 6.5 backward compatibility 0020 % 0021 % Revision 1.3 2006/04/23 15:29:40 msh 0022 % Added MGH to the copyright 0023 % 0024 % Revision 1.2 2006/04/18 20:44:46 msh 0025 % Added reading of forward solution. 0026 % Use length instead of size when appropriate 0027 % 0028 % Revision 1.1 2006/04/13 22:37:03 msh 0029 % Added head_head_trans field to info. 0030 % 0031 % 0032 0033 me='MNE:fiff_reset_channel_pos'; 0034 0035 global FIFF; 0036 if isempty(FIFF) 0037 FIFF = fiff_define_constants(); 0038 end 0039 0040 if nargin ~= 1 0041 error(me,'Wrong number of arguments'); 0042 end 0043 0044 res = chs; 0045 for k = 1:length(res) 0046 loc = res(k).loc; 0047 if res(k).kind == FIFF.FIFFV_MEG_CH || ... 0048 res(k).kind == FIFF.FIFFV_REF_MEG_CH 0049 res(k).coil_trans = [ [ loc(4:6) loc(7:9) ... 0050 loc(10:12) ... 0051 loc(1:3) ] ; [ 0 0 0 1 ] ]; 0052 res(k).coord_frame = FIFF.FIFFV_COORD_DEVICE; 0053 elseif res(k).kind == FIFF.FIFFV_EEG_CH 0054 res(k).eeg_loc = [ loc(1:3) loc(4:6) ]; 0055 res(k).coord_frame = FIFF.FIFFV_COORD_HEAD; 0056 end 0057 end 0058 0059 return; 0060 0061 end