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

If all subjects don't have all tasks and sub is set, an error arises #38

Open
wiheto opened this issue Oct 21, 2019 · 3 comments
Open
Labels
bug Something isn't working

Comments

@wiheto
Copy link
Collaborator

wiheto commented Oct 21, 2019

So perhaps a niched case, but the following raises an error

sub-1_task-a.nii
sub-1_task-b.nii
sub-2_task-b.nii

If you run: fmridenoise ... sub-2 an error will be raised because it tries to find the data for task-a.

Problem seems to be occurring around lines 206-220 in BIDSGrab in bids.py. But couldn't think of a quick fix for what to do (to solve the issue I'm adding a task flag to all my jobs)

@wiheto wiheto added the bug Something isn't working label Oct 21, 2019
@wiheto wiheto changed the title If not all subjects have all tasks and sub is set, an error arises If all subjects don't have all tasks and sub is set, an error arises Oct 21, 2019
@kfinc
Copy link
Member

kfinc commented Oct 21, 2019

@kbonna, any ideas on how to fix this in BIDSGrabber interface?

@SiegfriedWagner
Copy link
Collaborator

I can try fixing this as part of my current messing up with BIDSGrabber.
Do I understand this problem correctly? - @wiheto, you wanted to run your example dataset with only sub-2 as arg and without any task arg and then error rises, right?

@wiheto
Copy link
Collaborator Author

wiheto commented Oct 21, 2019

Correct.

Here is the crash file:

File: /home/users/wiltho/code/es-fmri/fmriprep/fmridenoise/crash-20191021-112817-wiltho-BidsGrabber-ed9416f3-4cbb-410b-bd3b-d1d4a6a9834b.pklz
Node: fmridenoise_wf.BidsGrabber
Working directory: /tmp/fmridenoise/fmridenoise_wf/BidsGrabber
Node inputs:
bids_dir = /scratch/users/wiltho/data/esfmri
derivatives = ['/scratch/users/wiltho/data/esfmri/derivatives/fmriprep-1.5.1/fmriprep']
ica_aroma = False
session = <undefined>
subject = ['357']
task = <undefined>
Traceback: 
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/fmridenoise/interfaces/bids.py", line 290, in _run_interface
    example_file = layout_for_tr.get(**filter_fmri_tr)[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 479, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 569, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 662, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/opt/conda/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 382, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/lib/python3.6/site-packages/fmridenoise/interfaces/bids.py", line 292, in _run_interface
    raise MissingFile(f"no imaging file found for task {t}")
fmridenoise.interfaces.bids.MissingFile: no imaging file found for task rest

Subject 357 does not have the task rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants