Skip to content

Commit

Permalink
coregister_fiducials(): remove scale argument
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Aug 23, 2016
1 parent e29fa2d commit 10a90cc
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions mne/coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _fiducial_coords(points, coord_frame):
return np.array([points_[i]['r'] for i in FIDUCIAL_ORDER])


def coregister_fiducials(info, fiducials, scale=False, tol=0.01):
def coregister_fiducials(info, fiducials, tol=0.01):
"""Create a head-MRI transform by aligning 3 fiducial points
Parameters
Expand All @@ -92,8 +92,6 @@ def coregister_fiducials(info, fiducials, scale=False, tol=0.01):
-------
trans : Transform
The device-MRI transform.
mri_scale : float (only if scale=True)
The scale factor by which to scale the MRI.
"""
if isinstance(info, string_types):
info = read_info(info)
Expand All @@ -107,23 +105,8 @@ def coregister_fiducials(info, fiducials, scale=False, tol=0.01):
"frames")
coord_frame_from = frames_from[0]
coords_to = _fiducial_coords(fiducials, coord_frame_to)
if scale:
params = fit_matched_points(coords_from, coords_to, scale=True,
tol=tol, out='params')
rx, ry, rz, tx, ty, tz, scale = params
trans = translation(tx, ty, tz).dot(rotation(rx, ry, rz))
mri_scale = 1. / scale
if mri_scale < 0.1:
raise RuntimeError("Unrealistic MRI scale parameter: %s" %
mri_scale)
else:
trans = fit_matched_points(coords_from, coords_to, tol=tol)
mri_scale = None
trans = Transform(coord_frame_from, coord_frame_to, trans)
if mri_scale is None:
return trans
else:
return trans, mri_scale
trans = fit_matched_points(coords_from, coords_to, tol=tol)
return Transform(coord_frame_from, coord_frame_to, trans)


def create_default_subject(mne_root=None, fs_home=None, update=False,
Expand Down

0 comments on commit 10a90cc

Please sign in to comment.