Original file line numberDiff line numberDiff line change
Expand Up@@ -208,25 +208,29 @@ class LaplacianThicknessInputSpec(ANTSCommandInputSpec):
keep_extension=True,
hash_files=False)
smooth_param = traits.Float(
argstr='%f',
argstr='%s',
desc='Sigma of the Laplacian Recursive Image Filter (defaults to 1)',
position=4)
prior_thickness = traits.Float(
argstr='%f',
argstr='%s',
desc='Prior thickness (defaults to 500)',
requires=['smooth_param'],
position=5)
dT = traits.Float(
argstr='%f',
argstr='%s',
desc='Time delta used during integration (defaults to 0.01)',
requires=['prior_thickness'],
position=6)
sulcus_prior = traits.Float(
argstr='%f',
argstr='%s',
desc='Positive floating point number for sulcus prior. '
'Authors said that 0.15 might be a reasonable value',
requires=['dT'],
position=7)
tolerance = traits.Float(
argstr='%f',
argstr='%s',
desc='Tolerance to reach during optimization (defaults to 0.001)',
requires=['sulcus_prior'],
position=8)


Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,8 +7,9 @@ def test_LaplacianThickness_inputs():
input_map = dict(
args=dict(argstr='%s', ),
dT=dict(
argstr='%f',
argstr='%s',
position=6,
requires=['prior_thickness'],
),
environ=dict(
nohash=True,
Expand DownExpand Up@@ -39,20 +40,23 @@ def test_LaplacianThickness_inputs():
position=3,
),
prior_thickness=dict(
argstr='%f',
argstr='%s',
position=5,
requires=['smooth_param'],
),
smooth_param=dict(
argstr='%f',
argstr='%s',
position=4,
),
sulcus_prior=dict(
argstr='%f',
argstr='%s',
position=7,
requires=['dT'],
),
tolerance=dict(
argstr='%f',
argstr='%s',
position=8,
requires=['sulcus_prior'],
),
)
inputs = LaplacianThickness.input_spec()
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -202,10 +202,16 @@ def _check_requires(self, spec, name, value):
for field in spec.requires
]
if any(values) and isdefined(value):
msg = ("%s requires a value for input '%s' because one of %s "
"is set. For a list of required inputs, see %s.help()" %
(self.__class__.__name__, name,
', '.join(spec.requires), self.__class__.__name__))
if len(values) > 1:
fmt = ("%s requires values for inputs %s because '%s' is set. "
"For a list of required inputs, see %s.help()")
else:
fmt = ("%s requires a value for input %s because '%s' is set. "
"For a list of required inputs, see %s.help()")
msg = fmt % (self.__class__.__name__,
', '.join("'%s'" % req for req in spec.requires),
name,
self.__class__.__name__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this logic was backwards. Does anybody want to double-check me?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eyeballed it -- seems to produce logically correct statement at this moment, so all is good ;)

raise ValueError(msg)

def _check_xor(self, spec, name, value):
Expand Down