Skip to content

Commit

Permalink
FIX: Maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Mar 3, 2024
1 parent 69ce5ff commit ae19772
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mne/_freesurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _get_mri_info_data(mri, data):
if data:
assert mgz is not None
out["mri_vox_t"] = invert_transform(out["vox_mri_t"])
out["data"] = np.asarray(mgz.dataobj)
out["data"] = np.array(mgz.dataobj)
return out


Expand Down
8 changes: 5 additions & 3 deletions mne/source_space/_source_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ def _write_one_source_space(fid, this, verbose=None):
mri_width, mri_height, mri_depth, nvox = _src_vol_dims(this)
interpolator = this.get("interpolator")
if interpolator is None:
interpolator = csr_matrix((nvox, this["np"]))
interpolator = csr_matrix((nvox, this["np"]), copy=True)
write_float_sparse_rcs(
fid, FIFF.FIFF_MNE_SOURCE_SPACE_INTERPOLATOR, interpolator
)
Expand Down Expand Up @@ -2390,7 +2390,9 @@ def _add_interpolator(sp):
indices = interp.indices[mask]
data = interp.data[mask]
assert data.shape == indices.shape == (indptr[-1],)
this_interp = csr_matrix((data, indices, indptr), shape=interp.shape)
this_interp = csr_matrix(
(data, indices, indptr), shape=interp.shape, copy=True
)
s["interpolator"] = this_interp
logger.info(
" %d/%d nonzero values for %s"
Expand All @@ -2415,7 +2417,7 @@ def _grid_interp(from_shape, to_shape, trans, order=1, inuse=None):
data = np.concatenate(data)
indices = np.concatenate(indices)
indptr = np.cumsum(indptr)
interp = csr_matrix((data, indices, indptr), shape=shape)
interp = csr_matrix((data, indices, indptr), shape=shape, copy=True)
return interp


Expand Down

0 comments on commit ae19772

Please sign in to comment.