Guest User

Untitled

a guest
Nov 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. import os.path as op
  2. import matplotlib.pyplot as plt
  3.  
  4. import mne
  5.  
  6. data_path = mne.datasets.sample.data_path()
  7. fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
  8. evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True)
  9.  
  10. evoked_l_aud = evoked[0]
  11.  
  12. # restrict to magnetometers
  13. evoked_l_aud.pick_types(meg='mag')
  14.  
  15. # pick the right channels
  16. rt_chans = [k['ch_name'] for k in evoked_l_aud.info['chs']
  17. if k['loc'][0] >= 0]
  18. rt_picks = mne.pick_channels(evoked_l_aud.info['ch_names'], rt_chans)
  19.  
  20. # make a dataset just of right channels.
  21. evoked_l_aud_rt_chans = evoked_l_aud.copy()
  22. evoked_l_aud_rt_chans.pick_channels(rt_chans)
  23.  
  24. # test plot_joint
  25. evoked_l_aud.plot_joint(times=[0.089], show=False)
  26. evoked_l_aud.plot_joint(times=[0.089], picks=rt_picks, show=False)
  27. evoked_l_aud_rt_chans.plot_joint(times=[0.089], show=False)
  28. plt.show()
  29.  
  30. # what about topo plot
  31. evoked_l_aud.plot_topomap(times=[0.089], show=False)
  32. evoked_l_aud_rt_chans.plot_topomap(times=[0.089], show=False)
  33. plt.show()
Add Comment
Please, Sign In to add comment