FIX: coerce to dtype after rounding
@@ -602,8 +602,8 @@ space-MNI152NLin6Asym_desc-preproc_bold.json'
f"Changing {out_file} dtype from {orig_dtype} to {data_dtype}"
)
# coerce dataobj to new data dtype
- if issubclass(data_dtype, np.integer):
- new_data = np.rint(nii.dataobj, dtype=data_dtype)
+ if np.issubdtype(data_dtype, np.integer):
+ new_data = np.rint(nii.dataobj).astype(data_dtype)
else:
new_data = data_dtype(nii.dataobj)
# and set header to match
