Nipype - DataGrabber raise_on_empty error

I am trying to pull data that is one of two forms (either nifti + .txt or afni head/brik files) using the datagrabber function. I have two separate datagrabbers - one to attempt a pull the nifti/txt files and one to attempt to pull the brik/head files. I am expecting one of these to fail during the data extraction, so I have set the raise_on_empty=False during the DataGrabber initialization. When I run the code it produces a raise IOError. The code works if the needed file is present. I am using nipype version is 1.3.0-rc1.

As a slightly separate question - is there another way for datagrabber to select between two different datatypes using an OR type search.

Thank you,
Jeff Stout

--------Code and error below ----------

bsight_source = pe.Node(
nio.DataGrabber(infields=[‘subject_id’], outfields=[‘bsight_nii’,‘bsight_txt’]),
name=‘bsight_source’, raise_on_empty=False)
bsight_source.inputs.base_directory = os.path.join(base_mri_folder,‘BrainSightFiles’)
bsight_source.inputs.template = ‘*’
bsight_source.inputs.sort_filelist = False
bsight_source.inputs.template_args = {‘bsight_nii’ : [[‘subject_id’,‘subject_id’]],
‘bsight_txt’ : [[‘subject_id’,‘subject_id’]]}
bsight_source.inputs.field_template = {‘bsight_nii’ : ‘%s/%s.nii’,
‘bsight_txt’ : ‘%s/%s.txt’}

bsight_source.inputs.subject_id=‘KPTHMODE’

bsight_source.run()
200226-11:44:00,43 nipype.workflow INFO:
[Node] Setting-up “bsight_source” in “/tmp/tmpck7incrc/bsight_source”.
200226-11:44:00,51 nipype.workflow INFO:
[Node] Running “bsight_source” (“nipype.interfaces.io.DataGrabber”)
200226-11:44:00,54 nipype.workflow WARNING:
Storing result file without outputs
200226-11:44:00,56 nipype.workflow WARNING:
[Node] Error on “bsight_source” (/tmp/tmpck7incrc/bsight_source)
Traceback (most recent call last):

File “”, line 1, in
bsight_source.run()

File “/home/jstout/nipype/pipeline/engine/nodes.py”, line 479, in run
result = self._run_interface(execute=True)

File “/home/jstout/nipype/pipeline/engine/nodes.py”, line 569, in _run_interface
return self._run_command(execute)

File “/home/jstout/nipype/pipeline/engine/nodes.py”, line 662, in _run_command
result = self._interface.run(cwd=outdir)

File “/home/jstout/nipype/interfaces/base/core.py”, line 384, in run
outputs = self.aggregate_outputs(runtime)

File “/home/jstout/nipype/interfaces/base/core.py”, line 461, in aggregate_outputs
predicted_outputs = self._list_outputs() # Predictions from _list_outputs

File “/home/jstout/nipype/interfaces/io.py”, line 1250, in _list_outputs
raise IOError(msg)

OSError: Output key: bsight_nii Template: /home/jstout/data/hv_mri/BrainSightFiles/KPTHMODE/KPTHMODE.nii returned no files

I found my error - I had the raise_on_empty flag set in the pe.Node parenthesis but not inside the DataGrabber parenthesis.

It is working now.

Thanks