nipy / nipype

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

Using multitaper for autoregressive model fails in filmgls #2609

Closed eort closed 6 years ago

eort commented 6 years ago

Summary

When running the first-level model estimation with the multitaper_product option to do pre-whitening, the workflow crashes.

Actual behavior

That's the error message:

Error: Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine/utils.py", line 106, in nodelist_runner
    result = node.run(updatehash=updatehash)

  File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 480, in run
    result = self._run_interface(execute=True)

  File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 564, in _run_interface
    return self._run_command(execute)

  File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 644, in _run_command
    result = self._interface.run(cwd=outdir)

  File "/usr/lib/python2.7/dist-packages/nipype/interfaces/base/core.py", line 520, in run
    runtime = self._run_interface(runtime)

  File "/usr/lib/python2.7/dist-packages/nipype/interfaces/base/core.py", line 1020, in _run_interface
    self.raise_exception(runtime)

  File "/usr/lib/python2.7/dist-packages/nipype/interfaces/base/core.py", line 957, in raise_exception
    ).format(**runtime.dictcopy()))

RuntimeError: Command:
film_gls --ms=5 --mt=13 --rn=results --sa --con=/home/data/foraging/scratch/tmp_work/modelling/OnSusFL2MultiTaper13/metaflow/firstlevel/_sub_no_6/l1Feat/mapflow/_l1Feat6/run0.con --in=/home/data/foraging/scratch/tmp_work/modelling/OnSusFL2MultiTaper13/metaflow/susan/_sub_no_6/smooth/mapflow/_smooth6/sub-06_task-choice_run-07_bold_space-MNI152NLin2009cAsym_preproc_smooth.nii.gz --pd=/home/data/foraging/scratch/tmp_work/modelling/OnSusFL2MultiTaper13/metaflow/firstlevel/_sub_no_6/l1Feat/mapflow/_l1Feat6/run0.mat --thr=1000.000000
Standard output:
Log directory is: results
paradigm.getDesignMatrix().Nrows()=210
paradigm.getDesignMatrix().Ncols()=25
sizeTS=210
numTS=129840
Calculating residuals...
Completed
Estimating residual autocorrelation...
Calculating raw AutoCorrs... Completed
Multitapering... 
Standard error:

An exception has been thrown
Multitapering: Slepians file not foundTrace: AutoCorrEstimator::getSlepians; AutoCorrEstimator::multitaper.

Return code: 1

Expected behavior

When using the default (tukey) filmgls works fine and produces the first-level estimates.

How to replicate the behavior

Here's a minimal (untested) example of the workflow I use. The problem should emerge also with different design matrices and data.

import nipype.interfaces.fsl as fsl          # fsl
import nipype.pipeline.engine as pe        # pypeline engine

l1Feat = pe.Node(fsl.FEATModel(), name='l1Feat')
l1Feat.inputs.fsf_file = # add fsf file here
l1Feat.inputs.ev_files = # add ev files here

filmgls= pe.Node(fsl.FILMGLS(multitaper_product = 13,
                mask_size = 5,threshold = 1000,smooth_autocorr=True),
           name='filmgls')
filmgls.inputs.in_file = # add bold file here

# connect flow
firstlevel = pe.Workflow(name='firstlevel')
firstlevel.connect(l1Feat,'con_file',filmgls,'tcon_file')
firstlevel.connect(l1Feat,'design_file',filmgls,'design_file')

Platform details:

{'nibabel_version': '2.2.1', 'sys_executable': '/usr/bin/python', 'networkx_version': '1.11', 'numpy_version': '1.12.1', 'sys_platform': 'linux2', 'sys_version': '2.7.13 (default, Nov 24 2017, 17:33:09) \n[GCC 6.3.0 20170516]', 'commit_source': 'archive substitution', 'commit_hash': '7d3966fc6fc292339364c0224fa22847ded3a041', 'pkg_path': '/usr/lib/python2.7/dist-packages/nipype', 'nipype_version': '1.0.3', 'traits_version': '4.6.0', 'scipy_version': '0.18.1'}
1.0.3

Execution environment

djarecka commented 6 years ago

did you try to run the film_gls command in your terminal? looks like this is FSL error, some arguments might be missing ("slepian file" ?).

eort commented 6 years ago

Yes, I did run film_gls directly and the output is the same. I just wonder whether this is a general issue with FSL or one with my installation.

some arguments might be missing ("slepian file" ?).

I don't think it is a missing argument. I had a look on google (as I can't look into FSL files on the machine that I use) and found this file. I don't know whether this is the file that is being called by filmgls (at least the print statements before the crash match), but in this file the location of the slepian file seems to be hardcoded: `string fname("/usr/people/woolrich/parads/mt" + osc.str());`, which would explain why I couldn't find it.

Can someone confirm, or should I directly email the FSL developers?

satra commented 6 years ago

it may be useful to email the FSL folks. that looks like mark woolrich's own special directory on some system! you may also want to check if this has been resolved in a more recent version.

eort commented 6 years ago

All right. I'l give this a go then. Thanks.

mgxd commented 6 years ago

@eort closing this for now, feel free to open if needed