diff --git a/pydra/tasks/ants/v2_5/apply_transforms.py b/pydra/tasks/ants/v2_5/apply_transforms.py index 0e9e59c..1ab22fc 100644 --- a/pydra/tasks/ants/v2_5/apply_transforms.py +++ b/pydra/tasks/ants/v2_5/apply_transforms.py @@ -19,9 +19,11 @@ def _format_output( return "-o {}".format( f"Linear[{output_transform},{invert_transform:%d}]" if save_transform - else f"[{output_warp_field},{save_warp_field:%d}]" - if save_warp_field - else f"{output_image}" + else ( + f"[{output_warp_field},{save_warp_field:%d}]" + if save_warp_field + else f"{output_image}" + ) ) @@ -30,11 +32,15 @@ def _format_interpolation( ) -> str: return "-n {}{}".format( interpolator, - f"[{order}]" - if interpolator == "BSpline" - else f"[{sigma},{alpha}]" - if interpolator in ("MultiLabel", "Gaussian") - else "", + ( + f"[{order}]" + if interpolator == "BSpline" + else ( + f"[{sigma},{alpha}]" + if interpolator in ("MultiLabel", "Gaussian") + else "" + ) + ), ) @@ -202,11 +208,13 @@ class InputSpec(ShellSpec): "formatter": lambda input_transforms, invert_transforms: ( "" if not input_transforms - else " ".join(f"-t {f}" for f in input_transforms) - if not invert_transforms - else " ".join( - f"-t [{f},{int(i)}]" - for f, i in zip(input_transforms, invert_transforms) + else ( + " ".join(f"-t {f}" for f in input_transforms) + if not invert_transforms + else " ".join( + f"-t [{f},{int(i)}]" + for f, i in zip(input_transforms, invert_transforms) + ) ) ), } diff --git a/pydra/tasks/ants/v2_5/registration.py b/pydra/tasks/ants/v2_5/registration.py index a93803f..2507c37 100644 --- a/pydra/tasks/ants/v2_5/registration.py +++ b/pydra/tasks/ants/v2_5/registration.py @@ -94,9 +94,11 @@ def _format_syn_transform_type( return ( "-t {}[{}]".format( syn_transform_type, - f"{syn_gradient_step},{syn_spline_distance},0,{syn_spline_order}" - if syn_transform_type == "BSplineSyn" - else f"{syn_gradient_step},{syn_flow_sigma},{syn_total_sigma}", + ( + f"{syn_gradient_step},{syn_spline_distance},0,{syn_spline_order}" + if syn_transform_type == "BSplineSyn" + else f"{syn_gradient_step},{syn_flow_sigma},{syn_total_sigma}" + ), ) if enable_syn_stage else "" @@ -172,11 +174,11 @@ class InputSpec(ShellSpec): "formatter": lambda interpolator, sigma, alpha, order: ( "-n {}{}".format( interpolator, - f"[{sigma},{alpha}]" - if interpolator == "Gaussian" - else f"[{order}]" - if interpolator == "BSpline" - else "", + ( + f"[{sigma},{alpha}]" + if interpolator == "Gaussian" + else f"[{order}]" if interpolator == "BSpline" else "" + ), ) ), } @@ -265,12 +267,14 @@ class InputSpec(ShellSpec): "formatter": lambda initial_fixed_transforms, invert_fixed_transforms: ( "" if not initial_fixed_transforms - else " ".join(f"-q {x}" for x in initial_fixed_transforms) - if not invert_fixed_transforms - else " ".join( - f"-q [{x},{y:d}]" - for x, y in zip( - initial_fixed_transforms, invert_fixed_transforms + else ( + " ".join(f"-q {x}" for x in initial_fixed_transforms) + if not invert_fixed_transforms + else " ".join( + f"-q [{x},{y:d}]" + for x, y in zip( + initial_fixed_transforms, invert_fixed_transforms + ) ) ) ), @@ -290,12 +294,14 @@ class InputSpec(ShellSpec): "formatter": lambda initial_moving_transforms, invert_moving_transforms, fixed_image, moving_image: ( f"-r [{fixed_image},{moving_image},1]" if not initial_moving_transforms - else " ".join(f"-r {x}" for x in initial_moving_transforms) - if not invert_moving_transforms - else " ".join( - f"-r [{x},{y:d}]" - for x, y in zip( - initial_moving_transforms, invert_moving_transforms + else ( + " ".join(f"-r {x}" for x in initial_moving_transforms) + if not invert_moving_transforms + else " ".join( + f"-r [{x},{y:d}]" + for x, y in zip( + initial_moving_transforms, invert_moving_transforms + ) ) ) ),