Skip to content

afni.preprocess.TCorrMap is failing. #1681

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

Open
tsalo opened this issue Oct 13, 2016 · 7 comments
Open

afni.preprocess.TCorrMap is failing. #1681

tsalo opened this issue Oct 13, 2016 · 7 comments
Labels

Comments

@tsalo
Copy link
Member

tsalo commented Oct 13, 2016

Running the cmdline doctest raises an error.

OS: OS X El Capitan 10.11.6
Nipype version: Up-to-date with master
No tools are installed, but this should just be an issue with the argument parsing in _format_arg().

from nipype.interfaces import afni
tcm = afni.TCorrMap()
tcm.inputs.in_file = 'functional.nii'
tcm.inputs.mask = 'mask.nii'
tcm.mean_file = 'functional_meancorr.nii'
tcm.cmdline

Traceback (most recent call last):

  File "<ipython-input-4-76b6d542a4b3>", line 6, in <module>
    tcm.cmdline

  File "/Users/salo/Desktop/tsalo/nipype/nipype/interfaces/base.py", line 1678, in cmdline
    allargs = self._parse_inputs()

  File "/Users/salo/Desktop/tsalo/nipype/nipype/interfaces/base.py", line 1915, in _parse_inputs
    arg = self._format_arg(name, spec, value)

  File "/Users/salo/Desktop/tsalo/nipype/nipype/interfaces/afni/preprocess.py", line 2049, in _format_arg
    return trait_spec.argstr % self.inputs.thresholds + [value]

TypeError: a float is required
@mgxd mgxd added the bug label Nov 29, 2016
@mgxd
Copy link
Member

mgxd commented Feb 14, 2017

@tsalo does #1745 fix this?

@tsalo
Copy link
Member Author

tsalo commented Feb 23, 2017

Sorry for the delay. I just updated my fork and tested it, but I'm still getting the same error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tsalo/Documents/tsalo/nipype/nipype/interfaces/base.py", line 1678, in cmdline
    allargs = self._parse_inputs()
  File "/Users/tsalo/Documents/tsalo/nipype/nipype/interfaces/base.py", line 1915, in _parse_inputs
    arg = self._format_arg(name, spec, value)
  File "/Users/tsalo/Documents/tsalo/nipype/nipype/interfaces/afni/preprocess.py", line 2049, in _format_arg
    return trait_spec.argstr % self.inputs.thresholds + [value]
TypeError: a float is required

@satra
Copy link
Member

satra commented Feb 23, 2017

@tsalo - looks like this interface needs to be fixed.

there is nothing that allows the user to choose what threshold method should be used.

_thresh_opts = ('absolute_threshold',

do you have some practical command lines for this interface from afni?

@tsalo
Copy link
Member Author

tsalo commented Feb 23, 2017

@satra - I don't actually have any experience with 3dTCorrMap. I came across the error when I was just trying to clean up the doctests and understand why some were being skipped in the AFNI interface. I can look into it though.

@tsalo
Copy link
Member Author

tsalo commented May 12, 2017

@adamkimbler and I have been trying to figure out why this is breaking, but so far we've been unable to do so.

It looks like _format_arg is trying to combine a list of values (self.inputs.thresholds) with the threshold option (absolute_threshold, var_absolute_threshold, var_absolute_threshold_normalize) in the threshold option's argstr. However, it doesn't seem to be putting them together correctly- instead of using the value of the threshold option's input, which should be a File, it's using the value fed into _format_arg, which is just functional_generated.

Since the different threshold options require different numbers of floats, we considered dropping self.inputs.thresholds and making the threshold options just traits.Tuples (e.g., absolute_threshold = traits.Tuple((traits.Float(), File()))) to avoid mixing separate arguments, but that's still causing problems with _format_arg for some reason.

Neither of us has any working 3dTCorrMap command lines at the moment.

@effigies
Copy link
Member

Is this still an issue? @tsalo

@tsalo
Copy link
Member Author

tsalo commented Jan 21, 2018

@effigies I pulled the most recent nipype/nipype docker image and tried out the doctest, but it still failed (although with a new error).

The doctest:

from nipype.interfaces import afni
tcm = afni.TCorrMap()
tcm.inputs.in_file = 'functional.nii'
tcm.inputs.mask = 'mask.nii'
tcm.inputs.mean_file = 'functional_meancorr.nii'
tcm.cmdline

The error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/src/nipype/nipype/interfaces/base/core.py", line 929, in cmdline
    allargs = [self.cmd] + self._parse_inputs()
  File "/src/nipype/nipype/interfaces/base/core.py", line 1166, in _parse_inputs
    arg = self._format_arg(name, spec, value)
  File "/src/nipype/nipype/interfaces/afni/preprocess.py", line 2284, in _format_arg
    return trait_spec.argstr % self.inputs.thresholds + [value]
TypeError: must be real number, not _Undefined

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

No branches or pull requests

4 participants