0001 function [extra_info] = neuromag_load_extra_info(fiffile)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 info = fiff_read_meas_info(fiffile);
0014
0015
0016
0017 NullChannel = 0;
0018 MagnetoMeter = 1;
0019 AxialGradioMeter = 2;
0020 PlannerGradioMeter = 3;
0021
0022 EegChannel = -2;
0023
0024 EtcChannel = -4;
0025
0026 ch_name = info.ch_names';
0027
0028
0029
0030
0031
0032 Nch = length(ch_name);
0033 next = 0;
0034 Channel_name = [];
0035 Channel_type = [];
0036 Channel_id = [];
0037 Channel_pos = [];
0038 Channel_active = [];
0039 gain = [];
0040
0041 for n=1:Nch
0042 if strcmp(ch_name{n}(1:3),'STI')==1,
0043 next = next + 1;
0044 Channel_name{next} = ch_name{n};
0045 Channel_id(next) = n;
0046 Channel_type(next) = EtcChannel;
0047 Channel_pos = [Channel_pos; nan, nan, nan];
0048 Channel_active(next) = 1;
0049 end
0050
0051 if strcmp(ch_name{n}(1:3),'EEG')==1,
0052 next = next + 1;
0053 Channel_name{next} = ch_name{n};
0054 Channel_id(next) = n;
0055 Channel_type(next) = EegChannel;
0056 if ~isempty(info.chs(n).eeg_loc)
0057 Channel_pos = [Channel_pos; info.chs(n).eeg_loc(:,1)'];
0058 end
0059 Channel_active(next) = 1;
0060 end
0061 end
0062
0063 extra_info.Channel_name = Channel_name';
0064 extra_info.Channel_type = Channel_type(:);
0065 extra_info.Channel_id = Channel_id(:);
0066 extra_info.Channel_pos = Channel_pos;
0067 extra_info.Channel_active = Channel_active(:);
0068 extra_info.gain = gain(:);
0069
0070
0071
0072
0073
0074
0075