MCPcopy
hub / github.com/mne-tools/mne-python / scaling

Function scaling

mne/transforms.py:409–423  ·  view source on GitHub ↗

Create an array with a scaling matrix. Parameters ---------- x, y, z : scalar Scaling factors. Returns ------- s : array, shape = (4, 4) The scaling matrix.

(x=1, y=1, z=1)

Source from the content-addressed store, hash-verified

407
408
409def scaling(x=1, y=1, z=1):
410 """Create an array with a scaling matrix.
411
412 Parameters
413 ----------
414 x, y, z : scalar
415 Scaling factors.
416
417 Returns
418 -------
419 s : array, shape = (4, 4)
420 The scaling matrix.
421 """
422 s = np.array([[x, 0, 0, 0], [0, y, 0, 0], [0, 0, z, 0], [0, 0, 0, 1]], dtype=float)
423 return s
424
425
426def translation(x=0, y=0, z=0):

Callers 4

test_fit_matched_pointsFunction · 0.90
_trans_from_paramsFunction · 0.85
errorFunction · 0.85
_scale_xfmFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_fit_matched_pointsFunction · 0.72