Skip to content

Please make error message more informative #2245

Closed
@yarikoptic

Description

@yarikoptic

Summary

hard to figure out what went wrong/what I forgot to specify

Actual behavior

(Pdb) p interface
<nipype.interfaces.ants.registration.ANTS object at 0x7f178f8d0810>
(Pdb) p interface.inputs

affine_gradient_descent_option = <undefined>
args = <undefined>
delta_time = <undefined>
dimension = 3
environ = {'NSLOTS': '1'}
fixed_image = [u'/input/fixed_image/1.nii.gz']
gradient_step_length = <undefined>
ignore_exception = False
metric = [u'MI']
metric_weight = <undefined>
mi_option = <undefined>
moving_image = [u'/input/moving_image/moving_image.nii.gz']
num_threads = 1
number_of_affine_iterations = <undefined>
number_of_iterations = <undefined>
number_of_time_steps = <undefined>
output_transform_prefix = out
radius = <undefined>
regularization = DMFFD
regularization_deformation_field_sigma = <undefined>
regularization_gradient_field_sigma = <undefined>
smoothing_sigmas = <undefined>
subsampling_factors = <undefined>
symmetry_type = <undefined>
terminal_output = stream
transformation_model = SyN
use_histogram_matching = False

(Pdb) p interface.run()
*** TypeError: TypeError("'_Undefined' object does not support indexing\nInterface ANTS failed to run. ",)

Expected behavior

Something like

(Pdb) p interface.run()
*** TypeError: TypeError("Ain't it a lovely Friday.  I am sorry to report that you forgot to specify the damn field metric_weight, which lead to ANTS interface fail to run and us throw some nasty exception which we swallowed just in time but spitting out into your face just in case:  '_Undefined' object does not support indexing. ",)

?

Platform details:

Please paste the output of: python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"

(Pdb) import nipype; print(nipype.get_info()); print(nipype.__version__)
{'nibabel_version': '2.2.0', 'networkx_version': '1.11', 'numpy_version': '1.12.1', 'sys_platform': 'linux2', 'sys_version': '2.7.13 (default, Jan 19 2017, 14:48:08) \n[GCC 6.3.0 20170118]', 'commit_source': '(none found)', 'commit_hash': '<not found>', 'pkg_path': '/usr/lib/python2.7/dist-packages/nipype', 'sys_executable': '/usr/bin/python', 'traits_version': '4.6.0', 'scipy_version': '0.18.1'}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions