Skip to content

genfile'ed output name "is not remembered" to be used later (in self.aggregate_outputs)? #2733

Closed
@yarikoptic

Description

@yarikoptic

I am trying on ANTs' LaplacianThickness interface to not specify output_image (if I do - another issue, will report separately):

from nipype.interfaces.ants import LaplacianThickness
cort_thick = LaplacianThickness()
d = 'antsCorticalThicknessExample/ResultsT1Only/'
cort_thick.inputs.input_wm = d + 'exampleBrainSegmentationPosteriors3.nii.gz'
cort_thick.inputs.input_gm = d + 'exampleBrainSegmentationPosteriors2.nii.gz'
# cort_thick.inputs.output_image = 'output_thickness.nii.gz'
print(cort_thick.cmdline)
print("Running")
print(cort_thick.run())
$> python nipype-undefined-output.py
LaplacianThickness antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz exampleBrainSegmentationPosteriors3_thickness.nii.gz
Running
181012-13:50:48,584 nipype.interface INFO:
	 stdout 2018-10-12T13:50:48.584522: using tolerance 0.001
...
181012-13:50:48,833 nipype.interface INFO:
	 stdout 2018-10-12T13:50:48.833009: writing exampleBrainSegmentationPosteriors3_thickness.nii.gz
Traceback (most recent call last):
  File "nipype-undefined-output.py", line 9, in <module>
    print(cort_thick.run())
  File "/home/yoh/deb/gits/pkg-exppsy/nipype/nipype/interfaces/base/core.py", line 524, in run
    outputs = self.aggregate_outputs(runtime)
  File "/home/yoh/deb/gits/pkg-exppsy/nipype/nipype/interfaces/base/core.py", line 602, in aggregate_outputs
    predicted_outputs = self._list_outputs()
  File "/home/yoh/deb/gits/pkg-exppsy/nipype/nipype/interfaces/ants/segmentation.py", line 254, in _list_outputs
    (name, self.inputs.output_image, ext)))
TypeError: sequence item 1: expected string or Unicode, _Undefined found

System

$> python -c "import nipype; from pprint import pprint; pprint(nipype.get_info())"
{'commit_hash': '3ec80655f',
 'commit_source': 'repository',
 'networkx_version': '2.1',
 'nibabel_version': '2.3.1',
 'nipype_version': '1.1.4-dev+g3ec80655f',
 'numpy_version': '1.14.5',
 'pkg_path': '/home/yoh/deb/gits/pkg-exppsy/nipype/nipype',
 'scipy_version': '0.19.1',
 'sys_executable': '/home/yoh/proj/flywheel/gearificator/venvs/dev/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.14 (default, Sep 17 2017, 18:50:44) \n[GCC 7.2.0]',
 'traits_version': '4.6.0'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions