nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
748 stars 530 forks source link

nipype.algorithms.modelgen.SpecifySPMModel: unclear input format for realignment_parameters #3584

Open JohannesWiesner opened 1 year ago

JohannesWiesner commented 1 year ago

Summary

I want to pass a .tsv file to as input to the realignment_parameters argument from SpecifySPMModel, but I think I pass it in the wrong format? It's not clear from the docs what the file should look like (in contrast to e.g. bids_event_file or event_files)

Actual behavior

Node: first_level_analysis.model_specifier
Working directory: /home/johannes.wiesner/work/projects/project_indicate/cache/first_level_analysis/_session_01_subject_INDI1W934_task_faces/model_specifier

Node inputs:

bids_amplitude_column = <undefined>
bids_condition_column = trial_type
bids_event_file = <undefined>
concatenate_runs = False
event_files = <undefined>
functional_runs = <undefined>
high_pass_filter_cutoff = 128.0
input_units = secs
outlier_files = <undefined>
output_units = secs
parameter_source = SPM
realignment_parameters = <undefined>
subject_info = <undefined>
time_repetition = 0.8

Traceback (most recent call last):
  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/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 model_specifier.

Traceback:
    Traceback (most recent call last):
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 397, in run
        runtime = self._run_interface(runtime)
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/algorithms/modelgen.py", line 521, in _run_interface
        self._generate_design()
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/algorithms/modelgen.py", line 654, in _generate_design
        super(SpecifySPMModel, self)._generate_design(infolist=infolist)
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/nipype/algorithms/modelgen.py", line 482, in _generate_design
        arr=np.loadtxt(parfile),
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1148, in loadtxt
        for x in read_data(_loadtxt_chunksize):
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/numpy/lib/npyio.py", line 999, in read_data
        items = [conv(val) for (conv, val) in zip(converters, vals)]
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/numpy/lib/npyio.py", line 999, in <listcomp>
        items = [conv(val) for (conv, val) in zip(converters, vals)]
      File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes_new/lib/python3.8/site-packages/numpy/lib/npyio.py", line 736, in floatconv
        return float(x)
    ValueError: could not convert string to float: 'trans_x'

If I read it correctly, the file is parsed using np.loadtxt() and therefore should only be a plain .txt file? What would be the separator there?

effigies commented 1 year ago

It should be any whitespace. A TSV file without a column header row should work fine.