diff --git a/neuromaps/images.py b/neuromaps/images.py index a007b6ad..6c858579 100644 --- a/neuromaps/images.py +++ b/neuromaps/images.py @@ -60,6 +60,7 @@ def construct_shape_gii(data, names=None, intent='NIFTI_INTENT_SHAPE', """ intent_dtypes = { 'NIFTI_INTENT_SHAPE': 'float32', + 'NIFTI_INTENT_TIME_SERIES': 'float32', 'NIFTI_INTENT_LABEL': 'int32' } dtype = intent_dtypes.get(intent, 'float32') diff --git a/neuromaps/transforms.py b/neuromaps/transforms.py index cddd03f2..c1eb8e90 100644 --- a/neuromaps/transforms.py +++ b/neuromaps/transforms.py @@ -360,7 +360,18 @@ def _surf_to_surf(data, srcparams, trgparams, method='linear', hemi=None): ) for fn in (func, MASKSURF): run(fn.format(**params), quiet=True) - resampled += (construct_shape_gii(load_data(params['out'])),) + + if img.read_text().find("NIFTI_INTENT_TIME_SERIES") != -1: + params["out"].write_text( + params["out"].read_text().replace( + "NIFTI_INTENT_NORMAL", "NIFTI_INTENT_TIME_SERIES" + ) + ) + intent = "NIFTI_INTENT_TIME_SERIES" + else: + intent = "NIFTI_INTENT_SHAPE" + + resampled += (construct_shape_gii(load_data(params["out"]), intent=intent),) params['out'].unlink() if tmpimg is not None: tmpimg.unlink()