Skip to content

Commit 737587e

Browse files
committed
fixed up argstr of out_file
1 parent ba6f859 commit 737587e

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

pydra/tasks/mrtrix3/utils.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
(
2626
"out_file",
2727
attr.ib(
28-
type=File,
28+
type=ty.Union[Path, str],
2929
metadata={
30+
"position": -1,
31+
"argstr": "",
3032
"help_string": "output image",
3133
"output_file_template": "{in_file}_converted",
3234
},
@@ -132,13 +134,36 @@ class MRConvert(ShellCommandTask):
132134
"""
133135
Example
134136
------
137+
138+
Convert NIfTI file with FSL-style gradient encoding files to
139+
MRtrix Image Format with MRtrix-style gradient encoding files
140+
135141
>>> task = MRConvert()
136142
>>> task.inputs.in_file = "test_dwi.nii.gz"
137143
>>> task.inputs.grad_fsl = ["test.bvec", "test.bval"]
138144
>>> task.inputs.export_grad = "test.b"
139145
>>> task.inputs.out_file = "test.mif"
140146
>>> task.cmdline
141147
'mrconvert test_dwi.nii.gz -fslgrad test.bvec test.bval -export_grad_mrtrix test.b test.mif'
148+
149+
Select the first volume from a diffusion-weighted dataset
150+
151+
>>> task = MRConvert()
152+
>>> task.inputs.in_file = "test_dwi.nii.gz"
153+
>>> task.inputs.out_file = "test_vol.nii.gz"
154+
>>> task.inputs.coord = [3, 0]
155+
>>> task.cmdline
156+
'mrconvert test_dwi.nii.gz -coord 3 0 test_vol.nii.gz'
157+
158+
Extend a 3D image to 4D by adding a singular dimension
159+
160+
>>> task = MRConvert()
161+
>>> task.inputs.in_file = "test.nii.gz"
162+
>>> task.inputs.out_file = "test_set.nii.gz"
163+
>>> task.inputs.axes = [0, 1, 2, -1]
164+
>>> task.cmdline
165+
'mrconvert test.nii.gz -axes 0,1,2,-1 test_set.nii.gz'
166+
142167
"""
143168

144169
input_spec = MRConvertInputSpec

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,8 @@ versionfile_source = pydra/tasks/mrtrix3/_version.py
6262
versionfile_build = pydra/tasks/mrtrix3/_version.py
6363
tag_prefix =
6464
parentdir_prefix =
65+
66+
67+
[tool:pytest]
68+
addopts = --doctest-modules --doctest-report ndiff
69+
doctest_optionflags= NORMALIZE_WHITESPACE ELLIPSIS

0 commit comments

Comments
 (0)