Skip to content

Commit

Permalink
FIX: Fitting
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Apr 25, 2023
1 parent 6e3aed1 commit f9b54c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mne/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ def _scale_helmet_to_sensors(system, surf, info):
to = np.array(to, float)
interp = _MatchedDisplacementFieldInterpolator(fro, to)
new_rr = interp(surf['rr'])
quat, sc = _fit_matched_points(surf['rr'], new_rr)
try:
quat, sc = _fit_matched_points(surf['rr'], new_rr)
except np.linalg.LinAlgError:
logger.info('Using CAD helmet because fitting failed')
return surf
rot = np.rad2deg(_angle_between_quats(quat[:3]))
tr = 1000 * np.linalg.norm(quat[3:])
logger.info(
Expand Down

0 comments on commit f9b54c0

Please sign in to comment.