Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update polhemus.py #253

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions osl/source_recon/rhino/polhemus.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Authors: Mark Woolrich <mark.woolrich@ohba.ox.ac.uk>
# Chetan Gohil <chetan.gohil@psych.ox.ac.uk>
# Mats van Es <mats.vanes@psych.ox.ac.uk>

import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -165,6 +166,7 @@ def delete_headshape_points(recon_dir=None, subject=None, polhemus_headshape_fil
print("Num headshape points={}".format(polhemus_headshape_polhemus.shape[1]))
print('Click on points to delete them.')
print('Press "w" to write changes to the file')
print('Press "q" to close the figure')
sys.stdout.flush()

def scatter_headshapes(ax, x, y, z):
Expand Down Expand Up @@ -205,6 +207,9 @@ def on_press(event):
print("Num headshape points remaining={}".format(polhemus_headshape_polhemus_new.shape[1]))
np.savetxt(coreg_filenames["polhemus_headshape_file"], polhemus_headshape_polhemus_new)
print('Changes saved to file {}'.format(coreg_filenames["polhemus_headshape_file"]))
elif event.key == 'q':
print('Closing figure')
plt.close(fig)

# Connect click event to function
fig.canvas.mpl_connect('pick_event', on_click)
Expand Down
Loading