diff --git a/fmriprep/interfaces/gifti.py b/fmriprep/interfaces/gifti.py index d26f07455..b759b15ca 100644 --- a/fmriprep/interfaces/gifti.py +++ b/fmriprep/interfaces/gifti.py @@ -46,10 +46,12 @@ def _run_interface(self, runtime): # wb_command -metric-math "abs(var * -1) > 0" roi = np.abs(darray.data) > 0 + # Divergence: Set datatype to uint8, since the values are boolean + # wb_command sets datatype to float32 darray = nb.gifti.GiftiDataArray( roi, intent=darray.intent, - datatype=darray.datatype, + datatype='uint8', encoding=darray.encoding, endian=darray.endian, coordsys=darray.coordsys, @@ -57,6 +59,8 @@ def _run_interface(self, runtime): meta=meta, ) + img.darrays[0] = darray + out_filename = os.path.join(runtime.cwd, f"{subject}.{hemi}.roi.native.shape.gii") img.to_filename(out_filename) self._results["roi_file"] = out_filename