Skip to content

Commit

Permalink
Merge pull request #253 from OHBA-analysis/remove_headshape_points
Browse files Browse the repository at this point in the history
Update polhemus.py
  • Loading branch information
matsvanes authored Jan 9, 2024
2 parents 16619b6 + c2842a4 commit bde4813
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit bde4813

Please sign in to comment.