13
13
... method="jac",
14
14
... )
15
15
>>> 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 ...'
18
18
19
19
>>> task = ApplyTopup(
20
20
... input_image=["blipup.nii", "blipdown.nii"],
25
25
... output_image="corrected.nii",
26
26
... )
27
27
>>> 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 ...'
30
30
"""
31
31
32
32
__all__ = ["ApplyTopup" ]
@@ -46,7 +46,7 @@ def _to_input_image(field: Union[PathLike, Sequence[PathLike]]) -> str:
46
46
except TypeError :
47
47
paths = [PurePath (path ) for path in field ]
48
48
49
- return f"--imain { ',' .join (str (path ) for path in paths )} "
49
+ return f"--imain= { ',' .join (str (path ) for path in paths )} "
50
50
51
51
52
52
def _to_input_index (field : Union [int , Sequence [int ]]) -> str :
@@ -55,7 +55,7 @@ def _to_input_index(field: Union[int, Sequence[int]]) -> str:
55
55
except TypeError :
56
56
indexes = [field ]
57
57
58
- return f"--inindex { ',' .join (str (index ) for index in indexes )} "
58
+ return f"--inindex= { ',' .join (str (index ) for index in indexes )} "
59
59
60
60
61
61
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
66
66
path = PurePath (fieldmap_image )
67
67
basename = path .parent / path .name .split ("." , 1 )[0 ]
68
68
69
- return f"--topup { str (basename )} "
69
+ return f"--topup= { str (basename )} "
70
70
71
71
72
72
def _to_output_image (
@@ -83,7 +83,7 @@ def _to_output_image(
83
83
name , ext = path .name .split ("." , 1 )
84
84
path = path .with_name (f"{ name } _topup.{ ext } " )
85
85
86
- return f"--out { path } "
86
+ return f"--out= { path } "
87
87
88
88
89
89
@define (slots = False , kw_only = True )
@@ -102,7 +102,7 @@ class ApplyTopupSpec(ShellSpec):
102
102
metadata = {
103
103
"help_string" : "text file containing phase encoding directions and timings" ,
104
104
"mandatory" : True ,
105
- "argstr" : "--datain" ,
105
+ "argstr" : "--datain={encoding_file} " ,
106
106
}
107
107
)
108
108
@@ -135,9 +135,7 @@ class ApplyTopupSpec(ShellSpec):
135
135
}
136
136
)
137
137
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" })
141
139
142
140
output_image : PathLike = field (
143
141
metadata = {"help_string" : "output image" , "argstr" : "--out" , "formatter" : _to_output_image }
@@ -147,7 +145,7 @@ class ApplyTopupSpec(ShellSpec):
147
145
default = "lsr" ,
148
146
metadata = {
149
147
"help_string" : "resampling method" ,
150
- "argstr" : "--method" ,
148
+ "argstr" : "--method={method} " ,
151
149
"allowed_values" : {"jac" , "lsr" , "vb2D" , "vb3D" , "vb4D" },
152
150
},
153
151
)
@@ -156,7 +154,7 @@ class ApplyTopupSpec(ShellSpec):
156
154
default = "spline" ,
157
155
metadata = {
158
156
"help_string" : "interpolation model" ,
159
- "argstr" : "--interp" ,
157
+ "argstr" : "--interp={interpolation} " ,
160
158
"allowed_values" : {"spline" , "trilinear" },
161
159
},
162
160
)
@@ -165,7 +163,7 @@ class ApplyTopupSpec(ShellSpec):
165
163
default = "preserve" ,
166
164
metadata = {
167
165
"help_string" : "force output datatype" ,
168
- "argstr" : "--datatype" ,
166
+ "argstr" : "--datatype={datatype} " ,
169
167
"allowed_values" : {"preserve" , "char" , "short" , "int" , "float" , "double" },
170
168
},
171
169
)
0 commit comments