diff --git a/mne/source_estimate.py b/mne/source_estimate.py index eb3ae898aa5..b5e5e0b7f73 100644 --- a/mne/source_estimate.py +++ b/mne/source_estimate.py @@ -1619,7 +1619,7 @@ def save_as_surface(self, fname, src, *, scale=1, scale_rr=1e3): darrays = list() darrays.append( nib.gifti.gifti.GiftiDataArray( - data=s["rr"] * scale_rr, + data=(s["rr"] * scale_rr).astype(np.float32), intent="NIFTI_INTENT_POINTSET", datatype="NIFTI_TYPE_FLOAT32", ) @@ -1628,7 +1628,7 @@ def save_as_surface(self, fname, src, *, scale=1, scale_rr=1e3): # Make the topology DataArray darrays.append( nib.gifti.gifti.GiftiDataArray( - data=s["tris"], + data=s["tris"].astype(np.int32), intent="NIFTI_INTENT_TRIANGLE", datatype="NIFTI_TYPE_INT32", )