Skip to content

AFNI Allineate not generating prefix argument #2216

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

Closed
ostanley opened this issue Oct 6, 2017 · 7 comments
Closed

AFNI Allineate not generating prefix argument #2216

ostanley opened this issue Oct 6, 2017 · 7 comments
Milestone

Comments

@ostanley
Copy link
Contributor

ostanley commented Oct 6, 2017

Summary

When in a pipeline allineate does not generate filenames. This is using a version after the allineate fix.

Actual behaviour

The allineate call now fails with a runtime error.

Expected behaviour

Allineate to generate an output file name

How to replicate the behaviour

Run a script with an input 1D file and an input file to motion correct

Script/Workflow details

moco = pe.MapNode(interface=afni.Allineate(), name='moco', iterfield=['in_file', 'in_matrix'])
moco.inputs.outputtype = 'NIFTI_GZ'
preprocphase.connect([(inputspec, img2float, [('input_phase', 'in_file')]),
                      (img2float, prepphase, [('out_file', 'phase')]),
                      (inputspec, moco, [('motion_par', 'in_matrix')]),
                      (prepphase, moco, [('detrended_phase', 'in_file')]),
                      (inputspec, applyalign, [('run_txfm','in_matrix_file')]),
                      (moco, applyalign, [('out_file', 'in_file')]),
                      (applyalign, maskfunc, [('out_file', 'in_file')]),
                      (inputspec, maskfunc, [('mask_file', 'in_file2')]),
                      (maskfunc, outputspec,[('out_file', 'proc_phase')])
                      ])

Please put URL to code or code here (if not too long).

Platform details:

{'nibabel_version': '2.1.0', 'sys_executable': '/cfmm/home/ostanle2/.virtualenvs/nipype2/bin/python', 'networkx_version': '1.9.1', 'numpy_version': '1.12.0', 'sys_platform': 'linux2', 'sys_version': '2.7.10 (default, Oct 28 2015, 11:22:11) \n[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]', 'commit_source': u'installation', 'commit_hash': u'4d08138', 'pkg_path': '/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype', 'nipype_version': u'1.0.0-dev', 'traits_version': '4.6.0', 'scipy_version': '0.18.1'}
1.0.0-dev
171005-22:46:15,712 interface INFO:
Closing display (if virtual)

Execution environment

  • My python environment outside container
@effigies
Copy link
Member

effigies commented Oct 6, 2017

Can you share the text of the error?

@ostanley
Copy link
Contributor Author

ostanley commented Oct 6, 2017

Yes sorry, I don't know how I missed that. Here you go:

	 Saving crash info to /cfmm/data/ostanle2/code/nipype_phase_regression/pipelines/crash-20171005-225337-ostanle2-_moco2-26ac07fa-84d4-4694-8aeb-54d2973a3fad.pklz
Traceback (most recent call last):
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/pipeline/plugins/multiproc.py", line 51, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/pipeline/engine/nodes.py", line 407, in run
    self._run_interface()
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/pipeline/engine/nodes.py", line 517, in _run_interface
    self._result = self._run_command(execute)
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/pipeline/engine/nodes.py", line 649, in _run_command
    result = self._interface.run()
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/interfaces/base.py", line 1086, in run
    runtime = self._run_interface(runtime)
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/interfaces/afni/base.py", line 129, in _run_interface
    return super(AFNICommandBase, self)._run_interface(runtime)
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/interfaces/base.py", line 1587, in _run_interface
    self.raise_exception(runtime)
  File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype-1.0.0.dev0+g4d08138-py2.7.egg/nipype/interfaces/base.py", line 1526, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
3dAllineate -source /workspace/ostanle2/SEvsGE2/metaflow/preprocphase/_subject_id_20171004/moco/mapflow/_moco2/20171004GERun3Phase_dtype_detrendphase.nii.gz -1Dmatrix_apply /workspace/ostanle2/SEvsGE2/metaflow/preprocmag/_subject_id_20171004/volreg/mapflow/_volreg2/20171004GERun3Mag_dtype.aff12.1D
Standard output:

Standard error:
++ 3dAllineate: AFNI version=AFNI_2011_12_21_1014 (Sep 13 2012) [64-bit]
++ Authored by: Zhark the Registrator
*+ WARNING:   If you are performing spatial transformations on an oblique dset, 
  such as /workspace/ostanle2/SEvsGE2/metaflow/preprocphase/_subject_id_20171004/moco/mapflow/_moco2/20171004GERun3Phase_dtype_detrendphase.nii.gz,
  or viewing/combining it with volumes of differing obliquity,
  you should consider running: 
     3dWarp -deoblique 
  on this and  other oblique datasets in the same session.
 See 3dWarp -help for details.
++ Oblique dataset:/workspace/ostanle2/SEvsGE2/metaflow/preprocphase/_subject_id_20171004/moco/mapflow/_moco2/20171004GERun3Phase_dtype_detrendphase.nii.gz is 39.500000 degrees from plumb.
++ Source dataset: /workspace/ostanle2/SEvsGE2/metaflow/preprocphase/_subject_id_20171004/moco/mapflow/_moco2/20171004GERun3Phase_dtype_detrendphase.nii.gz
++ Base dataset:   (not given)
** FATAL ERROR: -1D*_apply also needs -prefix :-(
** Program compile date = Sep 13 2012

Return code: 1

@ostanley
Copy link
Contributor Author

Just an update. After reinstall of version 0.14.0 the issue appears different with no output files although the interface runs correctly with prefix working. This results in the interface which uses these files crashing because the interface did not provide any output.

@effigies
Copy link
Member

Oh, I'm sorry. I either didn't see this or forgot to reply. Could you post the new error text? If you resolved the -prefix issue, my suggestions based on this output are going to be out-of-date. If you have the _report/report.rst from your moco working directory, that might be useful, as well.

@ostanley
Copy link
Contributor Author

The new error only appears for the node subsequent to the moco node and is below. I have also attached a report from the moco node. Thanks for the help!
report.rst.txt

 Node applyalign.a0 failed to run on host hubel2.imaging.robarts.ca.

180123-16:19:53,404 workflow ERROR:
Saving crash info to /cfmm/data/ostanle2/code/nipype_phase_regression/pipelines/crash-20180123-161953-ostanle2-applyalign.a0-217fc979-6d13-41ab-87e5-83694347d616.pklz
Traceback (most recent call last):
File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 238, in _send_procs_to_workers
num_subnodes = self.procs[jobid].num_subnodes()
File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1271, in num_subnodes
self._check_iterfield()
File "/cfmm/home/ostanle2/.virtualenvs/nipype2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1296, in _check_iterfield
"in iterfields.") % iterfield)
ValueError: Input in_file was not set but it is listed in iterfields.

@effigies
Copy link
Member

It looks like that interface could use some care, but in the short term, if you define out_file in Allineate with some default file name, that should resolve it.

if self.inputs.out_file:
outputs['out_file'] = op.abspath(self.inputs.out_file)

@ostanley
Copy link
Contributor Author

Thanks! That plus rename is a working work around for now. I was poking around trying to solve this so I could PR it but had no luck. I'll keep an eye on the issues incase it gets solved or I could help in some way.

Thanks again,

Olivia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants