Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any FreeSurfer output space is required when using --project-goodvoxels #3035

Closed
demidenm opened this issue Jun 13, 2023 · 4 comments
Closed
Labels

Comments

@demidenm
Copy link

demidenm commented Jun 13, 2023

What happened?

While running fMRIPrep v23.1.0 on three separate subjects from three separate datasets, preprocessing failed at the node name *.func_derivatives_wf.ds_goodvoxels_mask which did not occur for same subject using v23.0.0rc0

One specific example of the error is below:

Traceback:
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/bids.py", line 758, in _run_interface
sidecar.write_text(dumps(self._metadata, sort_keys=True, indent=2))
File "/opt/conda/envs/fmriprep/lib/python3.10/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type _Undefined is not JSON serializable

What command did you use?

fMRIPrep command: /opt/conda/envs/fmriprep/bin/fmriprep /data /out participant --participant-label sub-01 -t mid --ignore slicetiming --fs-license-file /home/users/demidenm/fs/license.txt --fd-spike-threshold .9 --output-space MNI152NLin2009cAsym:res-2 --project-goodvoxels --cifti-output 91k --resource-monitor -vv -w /scratch/groups/russpold/AHRB

What version of fMRIPrep are you running?

21.1.0

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

Node: fmriprep_23_1_wf.single_subject_01_wf.func_preproc_ses_1_task_mid_run_01_wf.func_derivatives_wf.ds_goodvoxels_mask
Working directory: /scratch/groups/russpold/AHRB/fmriprep_23_1_wf/single_subject_01_wf/func_preproc_ses_1_task_mid_run_01_wf/func_derivatives_wf/ds_goodvoxels_mask

Node inputs:

acquisition = <undefined>
atlas = <undefined>
base_directory = /out
ceagent = <undefined>
check_hdr = True
cohort = <undefined>
compress = [True]
data_dtype = <undefined>
datatype = <undefined>
density = <undefined>
desc = goodvoxels
direction = <undefined>
dismiss_entities = ['echo']
echo = <undefined>
extension = <undefined>
flip = <undefined>
fmap = <undefined>
fmapid = <undefined>
from = <undefined>
hemi = <undefined>
in_file = ['/scratch/groups/russpold/AHRB/fmriprep_23_1_wf/single_subject_01_wf/func_preproc_ses_1_task_mid_run_01_wf/bold_fsLR_resampling_wf/goodvoxels_bold_mask_wf/goodvoxels_mask/vol0000_xform-00000_clipped_merged_std_maths_maths_maths_thresh_maths.nii.gz']
inv = <undefined>
keys = <undefined>
label = <undefined>
meta_dict = <undefined>
modality = <undefined>
mode = <undefined>
model = <undefined>
mt = <undefined>
part = <undefined>
proc = <undefined>
reconstruction = <undefined>
recording = <undefined>
resolution = <undefined>
roi = <undefined>
run = <undefined>
scans = <undefined>
session = <undefined>
source_file = ['/data/sub-01/ses-1/func/sub-01_ses-1_task-mid_run-01_bold.nii.gz']
space = T1w
subject = <undefined>
subset = <undefined>
suffix = mask
task = <undefined>
to = <undefined>

Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
    self.procs[jobid].run(updatehash=updatehash)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ds_goodvoxels_mask.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/bids.py", line 758, in _run_interface
	    sidecar.write_text(dumps(self._metadata, sort_keys=True, indent=2))
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/__init__.py", line 238, in dumps
	    **kw).encode(obj)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 201, in encode
	    chunks = list(chunks)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 431, in _iterencode
	    yield from _iterencode_dict(o, _current_indent_level)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
	    yield from chunks
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 438, in _iterencode
	    o = _default(o)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/json/encoder.py", line 179, in default
	    raise TypeError(f'Object of type {o.__class__.__name__} '
	TypeError: Object of type _Undefined is not JSON serializable

Additional information / screenshots

This error occurs on two different systems with comparable resource requirements.

@demidenm demidenm added the bug label Jun 13, 2023
@mgxd
Copy link
Collaborator

mgxd commented Jun 13, 2023

Thanks for the report - I think the problem is that we are no longer adding a default freesurfer space. To see if you can get around this for now, could you try adding fsnative as an additional --output-spaces?

@demidenm
Copy link
Author

demidenm commented Jun 13, 2023

@mgxd - Sounds good, thanks! Retrying now!

@demidenm
Copy link
Author

adding fsnative to the --out-space resolved this error. Thanks again!

@mgxd mgxd reopened this Jun 13, 2023
@mgxd
Copy link
Collaborator

mgxd commented Jun 13, 2023

Leaving this open since we should handle this internally, but glad to hear the workaround resolved it!

@mgxd mgxd changed the title goodvoxels JSON TypeError Any FreeSurfer output space is required when using --project-goodvoxels Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants