|
43 | 43 | from .cov import compute_whitener, make_ad_hoc_cov |
44 | 44 | from .dipole import _make_guesses |
45 | 45 | from .event import find_events |
46 | | -from .fixes import jit |
| 46 | +from .fixes import _reshape_view, jit |
47 | 47 | from .forward import _concatenate_coils, _create_meg_coils, _magnetic_dipole_field_vec |
48 | 48 | from .io import BaseRaw, RawArray |
49 | 49 | from .io.ctf.trans import _make_ctf_coord_trans_set |
@@ -117,7 +117,7 @@ def read_head_pos(fname): |
117 | 117 | """ |
118 | 118 | _check_fname(fname, must_exist=True, overwrite="read") |
119 | 119 | data = np.loadtxt(fname, skiprows=1) # first line is header, skip it |
120 | | - data.shape = (-1, 10) # ensure it's the right size even if empty |
| 120 | + data = _reshape_view(data, (-1, 10)) # ensure it's the right size even if empty |
121 | 121 | if np.isnan(data).any(): # make sure we didn't do something dumb |
122 | 122 | raise RuntimeError(f"positions could not be read properly from {fname}") |
123 | 123 | return data |
@@ -1390,7 +1390,7 @@ def compute_chpi_locs( |
1390 | 1390 | ) |
1391 | 1391 | fwd = _magnetic_dipole_field_vec(guesses, meg_coils, too_close) |
1392 | 1392 | fwd = np.dot(fwd, whitener.T) |
1393 | | - fwd.shape = (guesses.shape[0], 3, -1) |
| 1393 | + fwd = _reshape_view(fwd, (guesses.shape[0], 3, -1)) |
1394 | 1394 | fwd = np.linalg.svd(fwd, full_matrices=False)[2] |
1395 | 1395 | guesses = dict(rr=guesses, whitened_fwd_svd=fwd) |
1396 | 1396 | del fwd, R |
|
0 commit comments