Ejemplo n.º 1
0
def test_cube(subject_id, subjects_dir, eeg, electrode_names, t_map, affine):
    depth_list = seeg.create_depths(electrode_names,
                                    eeg.baseline['eeg'].ch_names,
                                    eeg.electrodes)
    brain = seeg.create_depths_plot(depth_list, subject_id, subjects_dir)
    seeg.draw_volume(brain.plotter, t_map, affine)
    brain.show()
    brain.plotter.app.exec_()
    
Ejemplo n.º 2
0
def test_create_depth_epi_image_map(subject_id, subjects_dir, eeg,
                                    electrode_names, electrodes, raw, T_x_inv):
    values = seeg.create_depth_epi_image_map(eeg, low_freq=120,
                                             high_freq=200)
    depth_list = seeg.create_depths(electrode_names, raw.info['ch_names'],
                                    electrodes)
    brain = seeg.create_depths_plot(depth_list, subject_id, subjects_dir)
    seeg.show_depth_bipolar_values(depth_list, brain.plotter, values[0],
                                   radius=3, affine=T_x_inv)
    brain.show()
    brain.plotter.app.exec_()
Ejemplo n.º 3
0
def test_show_depth_bipolar_values(subject_id, subjects_dir, electrode_names,
                                   electrodes, raw, T_x_inv):
    depth_list = seeg.create_depths(electrode_names, raw.info['ch_names'],
                                    electrodes)
    brain = seeg.create_depths_plot(depth_list, subject_id, subjects_dir)
    values = 10*np.random.normal(size=len(raw.info['ch_names']))
    radius = 1 + (values - np.min(values))/12
    seeg.show_depth_bipolar_values(depth_list, brain.plotter, values, radius,
                                   affine=T_x_inv)
    brain.show()
    brain.plotter.app.exec_()
Ejemplo n.º 4
0
def test_create_depths_plot(subject_id, subjects_dir, electrode_names,
                            electrodes, raw):
    depth_list = seeg.create_depths(electrode_names, raw.info['ch_names'],
                                    electrodes)
    num_contacts = 0
    for depth in depth_list:
        num_contacts += depth.num_contacts

    values = 10*np.random.normal(size=num_contacts)
    colors = seeg.map_colors(values)[:, :3]
    brain = seeg.create_depths_plot(depth_list, subject_id, subjects_dir,
                                    contact_colors=colors)
    brain.show()
    brain.plotter.app.exec_()
Ejemplo n.º 5
0
def test_show_depth_values(subject_id, subjects_dir, electrode_names,
                           electrodes, raw, T_x_inv):
    depth_list = seeg.create_depths(electrode_names, raw.info['ch_names'],
                                    electrodes)
    brain = seeg.create_depths_plot(depth_list, subject_id, subjects_dir)
    num_contacts = 0
    for depth in depth_list:
        num_contacts += depth.num_contacts

    values = 10*np.random.normal(size=num_contacts)
    radius = 1 + (values - np.min(values))/12
    seeg.show_depth_values(depth_list, brain.plotter, values, radius,
                           affine=T_x_inv)
    brain.show()
    brain.plotter.app.exec_()
Ejemplo n.º 6
0
subjects_dir = op.join(data_path, 'subjects')
subject = 'sample'

misc_path = mne.datasets.misc.data_path()
seeg_path = op.join(misc_path, 'seeg')
eeg_file = op.join(seeg_path, 'sample_seeg.edf')
electrode_file = op.join(seeg_path, 'sample_seeg_electrodes.tsv')

eeg = mne.io.read_raw_edf(eeg_file)
electrodes = pd.read_table(electrode_file)
electrodes.rename(columns={'name': 'contact'}, inplace=True)
# electrodes['x'] = (electrodes['x']-10)/1000
# electrodes['y'] = (electrodes['y']-40)/1000
# electrodes['z'] = (electrodes['z']-20)/1000
electrodes['x'] /= 1000
electrodes['y'] /= 1000
electrodes['z'] /= 1000

ELECTRODE_NAMES = [r"L'", r"N'", r"F'", r"O'", r"G'", r"X'"]
ch_names = [
    electrodes.contact[i] for i in range(len(electrodes))
    if electrodes.contact[i][:2] in ELECTRODE_NAMES
]

depth_list = seeg.create_depths(ELECTRODE_NAMES, ch_names, electrodes)
brain = seeg.create_depths_plot(depth_list, subject, subjects_dir)
mlab.show()

# eeg.plot()
# plt.show()