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

Function _write_fs_xfm

mne/transforms.py:1643–1651  ·  view source on GitHub ↗

Write a Freesurfer transform to a .xfm file.

(fname, xfm, kind)

Source from the content-addressed store, hash-verified

1641
1642
1643def _write_fs_xfm(fname, xfm, kind):
1644 """Write a Freesurfer transform to a .xfm file."""
1645 with open(fname, "wb") as fid:
1646 fid.write((kind + "\n\nTtransform_Type = Linear;\n").encode("ascii"))
1647 fid.write("Linear_Transform =\n".encode("ascii"))
1648 for li, line in enumerate(xfm[:-1]):
1649 line = " ".join([f"{part:0.6f}" for part in line])
1650 line += "\n" if li < 2 else ";\n"
1651 fid.write(line.encode("ascii"))
1652
1653
1654def _quat_to_euler(quat):

Callers 2

test_fs_xfmFunction · 0.90
_scale_xfmFunction · 0.85

Calls 1

writeMethod · 0.80

Tested by 1

test_fs_xfmFunction · 0.72