Hi all,<br><br>I've been working with the python tools to build SSP projectors for EOG and ECG. I had thought that it might be necessary to use make_projector after compute_spatial_vectors, but write_proj seems to work perfectly well with the output from compute_spatial_vectors. The output files are usable in both MNE and Neuromag. As with projectors build using mne_process_raw, xfit treats these projectors as if they had been applied explicitly to the data. Using the sample data, what I'm doing is:<div>
<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div>raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'</div></div></div><div><div><div>raw = fiff.Raw(raw_fname)</div>
</div></div><div><div><div>exclude = <a href="http://raw.info" target="_blank">raw.info</a>['bads'] + ['MEG 2443', 'EEG 053'] </div></div></div><div><div><div><br></div></div></div><div><div><div>
# Make list of channel names into an array suitable for index</div>
</div></div><div><div><div>names = np.array(<a href="http://raw.info" target="_blank">raw.info</a>['ch_names'], dtype='S7')</div></div></div><div><div><div><br></div></div></div><div># Do EOG</div><div><div>
<div>event_id = 998</div>
</div></div><div><div><div>eog_events = mne.artifacts.find_eog_events(raw, event_id)</div></div></div><div><div><div>picks = fiff.pick_types(<a href="http://raw.info" target="_blank">raw.info</a>, meg=True, eeg=False, eog=False, ecg=False, stim=False, exclude=exclude)</div>
</div></div><div><div><div>ch_names = names[picks]</div></div></div><div><div><div>tmin, tmax = -0.5, 0.5</div></div></div><div><div><div>epochs = mne.Epochs(raw, eog_events, event_id, tmin, tmax, baseline=(-0.5,-0.2), picks=picks, proj=False)</div>
</div></div><div><div><div>data = epochs.get_data()</div></div></div><div><div><div>EOGprojs = fiff.proj.compute_spatial_vectors(epochs, n_grad=1, n_mag=1, n_eeg=0)</div></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><div><div>EOGprojfile = raw_fname[:-4] + '_EOG_auto-proj.fif'</div></div></div><div><div><div>fid = fiff.write.start_file(EOGprojfile)</div></div></div><div><div><div>fiff.proj.write_proj(fid, EOGprojs)</div>
</div></div><div><div><div>fiff.write.end_file(fid)</div></div></div></blockquote><div><div><br></div><div>Am I skipping a step somewhere along the way, or does this seem reasonable? I've attached the complete script, in case it's helpful.<br>
<div>
<br></div><div>Thanks,</div><div><br></div><div>Jon Houck</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div>
<br></div><div><br>
<br><div style="margin-left:40px"><br></div><br><br><div style="margin-left:40px"><br></div>
</div>
</div>
</div></div>