Skip to content
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

FIX Ants N4BiasFieldCorrection rescale_intensities bug #3139

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion nipype/interfaces/ants/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec):
)
rescale_intensities = traits.Bool(
False,
Copy link
Member

Choose a reason for hiding this comment

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

There was a move a while back to either remove defaults if unused, or set usedefault=True if the default was specified. In this case, if we're removing usedefault, we should also remove the default.

Suggested change
False,

usedefault=True,
argstr="-r",
min_ver="2.1.0",
desc="""\
Expand Down
36 changes: 18 additions & 18 deletions nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@

def test_N4BiasFieldCorrection_inputs():
input_map = dict(
args=dict(argstr="%s",),
bias_image=dict(extensions=None, hash_files=False,),
bspline_fitting_distance=dict(argstr="--bspline-fitting %s",),
bspline_order=dict(requires=["bspline_fitting_distance"],),
convergence_threshold=dict(requires=["n_iterations"],),
copy_header=dict(mandatory=True, usedefault=True,),
dimension=dict(argstr="-d %d", usedefault=True,),
environ=dict(nohash=True, usedefault=True,),
histogram_sharpening=dict(argstr="--histogram-sharpening [%g,%g,%d]",),
input_image=dict(argstr="--input-image %s", extensions=None, mandatory=True,),
mask_image=dict(argstr="--mask-image %s", extensions=None,),
n_iterations=dict(argstr="--convergence %s",),
num_threads=dict(nohash=True, usedefault=True,),
args=dict(argstr="%s"),
bias_image=dict(extensions=None, hash_files=False),
bspline_fitting_distance=dict(argstr="--bspline-fitting %s"),
bspline_order=dict(requires=["bspline_fitting_distance"]),
convergence_threshold=dict(requires=["n_iterations"]),
copy_header=dict(mandatory=True, usedefault=True),
dimension=dict(argstr="-d %d", usedefault=True),
environ=dict(nohash=True, usedefault=True),
histogram_sharpening=dict(argstr="--histogram-sharpening [%g,%g,%d]"),
input_image=dict(argstr="--input-image %s", extensions=None, mandatory=True),
mask_image=dict(argstr="--mask-image %s", extensions=None),
n_iterations=dict(argstr="--convergence %s"),
num_threads=dict(nohash=True, usedefault=True),
output_image=dict(
argstr="--output %s",
hash_files=False,
keep_extension=True,
name_source=["input_image"],
name_template="%s_corrected",
),
rescale_intensities=dict(argstr="-r", min_ver="2.1.0", usedefault=True,),
save_bias=dict(mandatory=True, usedefault=True, xor=["bias_image"],),
shrink_factor=dict(argstr="--shrink-factor %d",),
weight_image=dict(argstr="--weight-image %s", extensions=None,),
rescale_intensities=dict(argstr="-r", min_ver="2.1.0"),
save_bias=dict(mandatory=True, usedefault=True, xor=["bias_image"]),
shrink_factor=dict(argstr="--shrink-factor %d"),
weight_image=dict(argstr="--weight-image %s", extensions=None),
)
inputs = N4BiasFieldCorrection.input_spec()

Expand All @@ -38,7 +38,7 @@ def test_N4BiasFieldCorrection_inputs():

def test_N4BiasFieldCorrection_outputs():
output_map = dict(
bias_image=dict(extensions=None,), output_image=dict(extensions=None,),
bias_image=dict(extensions=None), output_image=dict(extensions=None)
)
outputs = N4BiasFieldCorrection.output_spec()

Expand Down