Skip to content

Commit 0269041

Browse files
ghisvailtclose
authored andcommitted
FIX: Use equal-separated option value pairs in applytopup
1 parent 22ff22b commit 0269041

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/pydra/tasks/fsl/eddy/applytopup.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
... method="jac",
1414
... )
1515
>>> task.cmdline # doctest: +ELLIPSIS
16-
'applytopup --imain blipup.nii --datain parameters.txt --inindex 1 \
17-
--topup fieldmap --out blipup_topup.nii --method jac ...'
16+
'applytopup --imain=blipup.nii --datain=parameters.txt --inindex=1 \
17+
--topup=fieldmap --out=blipup_topup.nii --method=jac ...'
1818
1919
>>> task = ApplyTopup(
2020
... input_image=["blipup.nii", "blipdown.nii"],
@@ -25,8 +25,8 @@
2525
... output_image="corrected.nii",
2626
... )
2727
>>> task.cmdline # doctest: +ELLIPSIS
28-
'applytopup --imain blipup.nii,blipdown.nii --datain parameters.txt \
29-
--inindex 1,2,3 --topup topup --out corrected.nii ...'
28+
'applytopup --imain=blipup.nii,blipdown.nii --datain=parameters.txt \
29+
--inindex=1,2,3 --topup=topup --out=corrected.nii ...'
3030
"""
3131

3232
__all__ = ["ApplyTopup"]
@@ -46,7 +46,7 @@ def _to_input_image(field: Union[PathLike, Sequence[PathLike]]) -> str:
4646
except TypeError:
4747
paths = [PurePath(path) for path in field]
4848

49-
return f"--imain {','.join(str(path) for path in paths)}"
49+
return f"--imain={','.join(str(path) for path in paths)}"
5050

5151

5252
def _to_input_index(field: Union[int, Sequence[int]]) -> str:
@@ -55,7 +55,7 @@ def _to_input_index(field: Union[int, Sequence[int]]) -> str:
5555
except TypeError:
5656
indexes = [field]
5757

58-
return f"--inindex {','.join(str(index) for index in indexes)}"
58+
return f"--inindex={','.join(str(index) for index in indexes)}"
5959

6060

6161
def _to_topup_basename(fieldmap_image: PathLike, field_coefficients_image: PathLike) -> str:
@@ -66,7 +66,7 @@ def _to_topup_basename(fieldmap_image: PathLike, field_coefficients_image: PathL
6666
path = PurePath(fieldmap_image)
6767
basename = path.parent / path.name.split(".", 1)[0]
6868

69-
return f"--topup {str(basename)}"
69+
return f"--topup={str(basename)}"
7070

7171

7272
def _to_output_image(
@@ -83,7 +83,7 @@ def _to_output_image(
8383
name, ext = path.name.split(".", 1)
8484
path = path.with_name(f"{name}_topup.{ext}")
8585

86-
return f"--out {path}"
86+
return f"--out={path}"
8787

8888

8989
@define(slots=False, kw_only=True)
@@ -102,7 +102,7 @@ class ApplyTopupSpec(ShellSpec):
102102
metadata={
103103
"help_string": "text file containing phase encoding directions and timings",
104104
"mandatory": True,
105-
"argstr": "--datain",
105+
"argstr": "--datain={encoding_file}",
106106
}
107107
)
108108

@@ -135,9 +135,7 @@ class ApplyTopupSpec(ShellSpec):
135135
}
136136
)
137137

138-
movement_parameters_file: PathLike = field(
139-
metadata={"help_string": "movement parameters file computed by topup", "argstr": None}
140-
)
138+
movement_parameters_file: PathLike = field(metadata={"help_string": "movement parameters file computed by topup"})
141139

142140
output_image: PathLike = field(
143141
metadata={"help_string": "output image", "argstr": "--out", "formatter": _to_output_image}
@@ -147,7 +145,7 @@ class ApplyTopupSpec(ShellSpec):
147145
default="lsr",
148146
metadata={
149147
"help_string": "resampling method",
150-
"argstr": "--method",
148+
"argstr": "--method={method}",
151149
"allowed_values": {"jac", "lsr", "vb2D", "vb3D", "vb4D"},
152150
},
153151
)
@@ -156,7 +154,7 @@ class ApplyTopupSpec(ShellSpec):
156154
default="spline",
157155
metadata={
158156
"help_string": "interpolation model",
159-
"argstr": "--interp",
157+
"argstr": "--interp={interpolation}",
160158
"allowed_values": {"spline", "trilinear"},
161159
},
162160
)
@@ -165,7 +163,7 @@ class ApplyTopupSpec(ShellSpec):
165163
default="preserve",
166164
metadata={
167165
"help_string": "force output datatype",
168-
"argstr": "--datatype",
166+
"argstr": "--datatype={datatype}",
169167
"allowed_values": {"preserve", "char", "short", "int", "float", "double"},
170168
},
171169
)

0 commit comments

Comments
 (0)