Skip to content

Commit 6f36cf2

Browse files
authored
Merge pull request #24 from nipype/new-syntax
Updated interface conversions for new-syntax
2 parents 3d0e218 + f0b03f2 commit 6f36cf2

File tree

328 files changed

+7721
-9713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+7721
-9713
lines changed

example-specs/interface/nipype/afni/a_boverlap.yaml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
# Docs
77
# ----
88
# Output (to screen) is a count of various things about how
9-
# the automasks of datasets A and B overlap or don't overlap.
9+
# the automasks of datasets A and B overlap or don't overlap.
1010
#
11-
# For complete details, see the `3dABoverlap Documentation.
12-
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dABoverlap.html>`_
11+
# For complete details, see the `3dABoverlap Documentation.
12+
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dABoverlap.html>`_
13+
#
14+
# Examples
15+
# --------
16+
# >>> from nipype.interfaces import afni
17+
# >>> aboverlap = afni.ABoverlap()
18+
# >>> aboverlap.inputs.in_file_a = 'functional.nii'
19+
# >>> aboverlap.inputs.in_file_b = 'structural.nii'
20+
# >>> aboverlap.inputs.out_file = 'out.mask_ae_overlap.txt'
21+
# >>> aboverlap.cmdline
22+
# '3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt'
23+
# >>> res = aboverlap.run() # doctest: +SKIP
1324
#
14-
# Examples
15-
# --------
16-
# >>> from nipype.interfaces import afni
17-
# >>> aboverlap = afni.ABoverlap()
18-
# >>> aboverlap.inputs.in_file_a = 'functional.nii'
19-
# >>> aboverlap.inputs.in_file_b = 'structural.nii'
20-
# >>> aboverlap.inputs.out_file = 'out.mask_ae_overlap.txt'
21-
# >>> aboverlap.cmdline
22-
# '3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt'
23-
# >>> res = aboverlap.run() # doctest: +SKIP
2425
#
25-
#
2626
task_name: ABoverlap
2727
nipype_name: ABoverlap
2828
nipype_module: nipype.interfaces.afni.utils
@@ -39,11 +39,8 @@ inputs:
3939
# passed to the field in the automatically generated unittests.
4040
in_file_a: medimage/nifti1
4141
# type=file|default=<undefined>: input file A
42-
in_file_b: medimage/nifti1
42+
in_file_b: generic/file
4343
# type=file|default=<undefined>: input file B
44-
out_file: Path
45-
# type=file: output file
46-
# type=file|default=<undefined>: collect output to a file
4744
callable_defaults:
4845
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
4946
# to set as the `default` method of input fields
@@ -67,7 +64,7 @@ outputs:
6764
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
6865
# to set to the `callable` attribute of output fields
6966
templates:
70-
# dict[str, str] - `output_file_template` values to be provided to output fields
67+
# dict[str, str] - `path_template` values to be provided to output fields
7168
requirements:
7269
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
7370
tests:
@@ -96,7 +93,7 @@ tests:
9693
environ:
9794
# type=dict|default={}: Environment variables
9895
imports:
99-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
96+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
10097
# consisting of 'module', 'name', and optionally 'alias' keys
10198
expected_outputs:
10299
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -115,13 +112,11 @@ tests:
115112
# (if not specified, will try to choose a sensible value)
116113
in_file_a:
117114
# type=file|default=<undefined>: input file A
118-
in_file_b:
119-
# type=file|default=<undefined>: input file B
120115
out_file: ' "out.mask_ae_overlap.txt"'
121116
# type=file: output file
122117
# type=file|default=<undefined>: collect output to a file
123118
imports:
124-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
119+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
125120
# consisting of 'module', 'name', and optionally 'alias' keys
126121
expected_outputs:
127122
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -136,21 +131,19 @@ tests:
136131
# bool - whether the unittest is expected to fail or not. Set to false
137132
# when you are satisfied with the edits you have made to this file
138133
doctests:
139-
- cmdline: 3dABoverlap functional.nii structural.nii |& tee out.mask_ae_overlap.txt
134+
- cmdline:
140135
# str - the expected cmdline output
141136
inputs:
142137
# dict[str, str] - name-value pairs for inputs to be provided to the doctest.
143138
# If the field is of file-format type and the value is None, then the
144139
# '.mock()' method of the corresponding class is used instead.
145140
in_file_a: '"functional.nii"'
146141
# type=file|default=<undefined>: input file A
147-
in_file_b: '"structural.nii"'
148-
# type=file|default=<undefined>: input file B
149142
out_file: ' "out.mask_ae_overlap.txt"'
150143
# type=file: output file
151144
# type=file|default=<undefined>: collect output to a file
152145
imports:
153-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
146+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
154147
# consisting of 'module', 'name', and optionally 'alias' keys
155148
directive:
156149
# str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS

example-specs/interface/nipype/afni/afn_ito_nifti.yaml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
# Docs
77
# ----
88
# Converts AFNI format files to NIFTI format. This can also convert 2D or
9-
# 1D data, which you can numpy.squeeze() to remove extra dimensions.
9+
# 1D data, which you can numpy.squeeze() to remove extra dimensions.
1010
#
11-
# For complete details, see the `3dAFNItoNIFTI Documentation.
12-
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html>`_
11+
# For complete details, see the `3dAFNItoNIFTI Documentation.
12+
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html>`_
13+
#
14+
# Examples
15+
# --------
16+
# >>> from nipype.interfaces import afni
17+
# >>> a2n = afni.AFNItoNIFTI()
18+
# >>> a2n.inputs.in_file = 'afni_output.3D'
19+
# >>> a2n.inputs.out_file = 'afni_output.nii'
20+
# >>> a2n.cmdline
21+
# '3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D'
22+
# >>> res = a2n.run() # doctest: +SKIP
1323
#
14-
# Examples
15-
# --------
16-
# >>> from nipype.interfaces import afni
17-
# >>> a2n = afni.AFNItoNIFTI()
18-
# >>> a2n.inputs.in_file = 'afni_output.3D'
19-
# >>> a2n.inputs.out_file = 'afni_output.nii'
20-
# >>> a2n.cmdline
21-
# '3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D'
22-
# >>> res = a2n.run() # doctest: +SKIP
2324
#
24-
#
2525
task_name: AFNItoNIFTI
2626
nipype_name: AFNItoNIFTI
2727
nipype_module: nipype.interfaces.afni.utils
@@ -36,11 +36,8 @@ inputs:
3636
# from the nipype interface, but you may want to be more specific, particularly
3737
# for file types, where specifying the format also specifies the file that will be
3838
# passed to the field in the automatically generated unittests.
39-
in_file: medimage-afni/three-d
39+
in_file: fileformats.medimage_afni.ThreeD
4040
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
41-
out_file: Path
42-
# type=file: output file
43-
# type=file|default=<undefined>: output image file name
4441
callable_defaults:
4542
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
4643
# to set as the `default` method of input fields
@@ -57,14 +54,14 @@ outputs:
5754
# from the nipype interface, but you may want to be more specific, particularly
5855
# for file types, where specifying the format also specifies the file that will be
5956
# passed to the field in the automatically generated unittests.
60-
out_file: medimage/nifti1
57+
out_file: generic/file
6158
# type=file: output file
6259
# type=file|default=<undefined>: output image file name
6360
callables:
6461
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
6562
# to set to the `callable` attribute of output fields
6663
templates:
67-
# dict[str, str] - `output_file_template` values to be provided to output fields
64+
# dict[str, str] - `path_template` values to be provided to output fields
6865
requirements:
6966
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
7067
tests:
@@ -93,7 +90,7 @@ tests:
9390
environ:
9491
# type=dict|default={}: Environment variables
9592
imports:
96-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
93+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
9794
# consisting of 'module', 'name', and optionally 'alias' keys
9895
expected_outputs:
9996
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -112,11 +109,8 @@ tests:
112109
# (if not specified, will try to choose a sensible value)
113110
in_file:
114111
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
115-
out_file: ' "afni_output.nii"'
116-
# type=file: output file
117-
# type=file|default=<undefined>: output image file name
118112
imports:
119-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
113+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
120114
# consisting of 'module', 'name', and optionally 'alias' keys
121115
expected_outputs:
122116
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -131,19 +125,16 @@ tests:
131125
# bool - whether the unittest is expected to fail or not. Set to false
132126
# when you are satisfied with the edits you have made to this file
133127
doctests:
134-
- cmdline: 3dAFNItoNIFTI -prefix afni_output.nii afni_output.3D
128+
- cmdline:
135129
# str - the expected cmdline output
136130
inputs:
137131
# dict[str, str] - name-value pairs for inputs to be provided to the doctest.
138132
# If the field is of file-format type and the value is None, then the
139133
# '.mock()' method of the corresponding class is used instead.
140134
in_file: '"afni_output.3D"'
141135
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
142-
out_file: ' "afni_output.nii"'
143-
# type=file: output file
144-
# type=file|default=<undefined>: output image file name
145136
imports:
146-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
137+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
147138
# consisting of 'module', 'name', and optionally 'alias' keys
148139
directive:
149140
# str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS

example-specs/interface/nipype/afni/align_epi_anat_py.yaml

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,55 @@
77
# ----
88
# Align EPI to anatomical datasets or vice versa.
99
#
10-
# This Python script computes the alignment between two datasets, typically
11-
# an EPI and an anatomical structural dataset, and applies the resulting
12-
# transformation to one or the other to bring them into alignment.
10+
# This Python script computes the alignment between two datasets, typically
11+
# an EPI and an anatomical structural dataset, and applies the resulting
12+
# transformation to one or the other to bring them into alignment.
1313
#
14-
# This script computes the transforms needed to align EPI and
15-
# anatomical datasets using a cost function designed for this purpose. The
16-
# script combines multiple transformations, thereby minimizing the amount of
17-
# interpolation applied to the data.
14+
# This script computes the transforms needed to align EPI and
15+
# anatomical datasets using a cost function designed for this purpose. The
16+
# script combines multiple transformations, thereby minimizing the amount of
17+
# interpolation applied to the data.
1818
#
19-
# Basic Usage::
19+
# Basic Usage::
2020
#
21-
# align_epi_anat.py -anat anat+orig -epi epi+orig -epi_base 5
21+
# align_epi_anat.py -anat anat+orig -epi epi+orig -epi_base 5
2222
#
23-
# The user must provide :abbr:`EPI (echo-planar imaging)` and anatomical datasets
24-
# and specify the EPI sub-brick to use as a base in the alignment.
23+
# The user must provide :abbr:`EPI (echo-planar imaging)` and anatomical datasets
24+
# and specify the EPI sub-brick to use as a base in the alignment.
2525
#
26-
# Internally, the script always aligns the anatomical to the EPI dataset,
27-
# and the resulting transformation is saved to a 1D file.
28-
# As a user option, the inverse of this transformation may be applied to the
29-
# EPI dataset in order to align it to the anatomical data instead.
26+
# Internally, the script always aligns the anatomical to the EPI dataset,
27+
# and the resulting transformation is saved to a 1D file.
28+
# As a user option, the inverse of this transformation may be applied to the
29+
# EPI dataset in order to align it to the anatomical data instead.
3030
#
31-
# This program generates several kinds of output in the form of datasets
32-
# and transformation matrices which can be applied to other datasets if
33-
# needed. Time-series volume registration, oblique data transformations and
34-
# Talairach (standard template) transformations will be combined as needed
35-
# and requested (with options to turn on and off each of the steps) in
36-
# order to create the aligned datasets.
31+
# This program generates several kinds of output in the form of datasets
32+
# and transformation matrices which can be applied to other datasets if
33+
# needed. Time-series volume registration, oblique data transformations and
34+
# Talairach (standard template) transformations will be combined as needed
35+
# and requested (with options to turn on and off each of the steps) in
36+
# order to create the aligned datasets.
3737
#
38-
# Examples
39-
# --------
40-
# >>> from nipype.interfaces import afni
41-
# >>> al_ea = afni.AlignEpiAnatPy()
42-
# >>> al_ea.inputs.anat = "structural.nii"
43-
# >>> al_ea.inputs.in_file = "functional.nii"
44-
# >>> al_ea.inputs.epi_base = 0
45-
# >>> al_ea.inputs.epi_strip = '3dAutomask'
46-
# >>> al_ea.inputs.volreg = 'off'
47-
# >>> al_ea.inputs.tshift = 'off'
48-
# >>> al_ea.inputs.save_skullstrip = True
49-
# >>> al_ea.cmdline # doctest: +ELLIPSIS
50-
# 'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
51-
# >>> res = allineate.run() # doctest: +SKIP
38+
# Examples
39+
# --------
40+
# >>> from nipype.interfaces import afni
41+
# >>> al_ea = afni.AlignEpiAnatPy()
42+
# >>> al_ea.inputs.anat = "structural.nii"
43+
# >>> al_ea.inputs.in_file = "functional.nii"
44+
# >>> al_ea.inputs.epi_base = 0
45+
# >>> al_ea.inputs.epi_strip = '3dAutomask'
46+
# >>> al_ea.inputs.volreg = 'off'
47+
# >>> al_ea.inputs.tshift = 'off'
48+
# >>> al_ea.inputs.save_skullstrip = True
49+
# >>> al_ea.cmdline # doctest: +ELLIPSIS
50+
# 'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
51+
# >>> res = al_ea.run() # doctest: +SKIP
52+
#
53+
# See Also
54+
# --------
55+
# For complete details, see the `align_epi_anat.py documentation.
56+
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/align_epi_anat.py.html>`__.
5257
#
53-
# See Also
54-
# --------
55-
# For complete details, see the `align_epi_anat.py documentation.
56-
# <https://afni.nimh.nih.gov/pub/dist/doc/program_help/align_epi_anat.py.html>`__.
5758
#
58-
#
5959
task_name: AlignEpiAnatPy
6060
nipype_name: AlignEpiAnatPy
6161
nipype_module: nipype.interfaces.afni.preprocess
@@ -72,7 +72,7 @@ inputs:
7272
# passed to the field in the automatically generated unittests.
7373
anat: medimage/nifti1
7474
# type=file|default=<undefined>: name of structural dataset
75-
in_file: medimage/nifti1
75+
in_file: generic/file
7676
# type=file|default=<undefined>: EPI dataset to align
7777
callable_defaults:
7878
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
@@ -114,7 +114,7 @@ outputs:
114114
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
115115
# to set to the `callable` attribute of output fields
116116
templates:
117-
# dict[str, str] - `output_file_template` values to be provided to output fields
117+
# dict[str, str] - `path_template` values to be provided to output fields
118118
requirements:
119119
# dict[str, list[str]] - input fields that are required to be provided for the output field to be present
120120
tests:
@@ -150,7 +150,7 @@ tests:
150150
environ:
151151
# type=dict|default={}: Environment variables
152152
imports:
153-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
153+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
154154
# consisting of 'module', 'name', and optionally 'alias' keys
155155
expected_outputs:
156156
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -169,20 +169,14 @@ tests:
169169
# (if not specified, will try to choose a sensible value)
170170
anat:
171171
# type=file|default=<undefined>: name of structural dataset
172-
in_file:
173-
# type=file|default=<undefined>: EPI dataset to align
174172
epi_base: '0'
175173
# type=traitcompound|default=None: the epi base used in alignmentshould be one of (0/mean/median/max/subbrick#)
176-
epi_strip: '"3dAutomask"'
177-
# type=enum|default='3dSkullStrip'|allowed['3dAutomask','3dSkullStrip','None']: method to mask brain in EPI datashould be one of[3dSkullStrip]/3dAutomask/None)
178174
volreg: '"off"'
179175
# type=enum|default='on'|allowed['off','on']: do volume registration on EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
180-
tshift: '"off"'
181-
# type=enum|default='on'|allowed['off','on']: do time shifting of EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
182176
save_skullstrip: 'True'
183177
# type=bool|default=False: save skull-stripped (not aligned)
184178
imports:
185-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
179+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
186180
# consisting of 'module', 'name', and optionally 'alias' keys
187181
expected_outputs:
188182
# dict[str, str] - expected values for selected outputs, noting that tests will typically
@@ -197,28 +191,22 @@ tests:
197191
# bool - whether the unittest is expected to fail or not. Set to false
198192
# when you are satisfied with the edits you have made to this file
199193
doctests:
200-
- cmdline: python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off
194+
- cmdline:
201195
# str - the expected cmdline output
202196
inputs:
203197
# dict[str, str] - name-value pairs for inputs to be provided to the doctest.
204198
# If the field is of file-format type and the value is None, then the
205199
# '.mock()' method of the corresponding class is used instead.
206200
anat: '"structural.nii"'
207201
# type=file|default=<undefined>: name of structural dataset
208-
in_file: '"functional.nii"'
209-
# type=file|default=<undefined>: EPI dataset to align
210202
epi_base: '0'
211203
# type=traitcompound|default=None: the epi base used in alignmentshould be one of (0/mean/median/max/subbrick#)
212-
epi_strip: '"3dAutomask"'
213-
# type=enum|default='3dSkullStrip'|allowed['3dAutomask','3dSkullStrip','None']: method to mask brain in EPI datashould be one of[3dSkullStrip]/3dAutomask/None)
214204
volreg: '"off"'
215205
# type=enum|default='on'|allowed['off','on']: do volume registration on EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
216-
tshift: '"off"'
217-
# type=enum|default='on'|allowed['off','on']: do time shifting of EPI dataset before alignmentshould be 'on' or 'off', defaults to 'on'
218206
save_skullstrip: 'True'
219207
# type=bool|default=False: save skull-stripped (not aligned)
220208
imports:
221-
# list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item
209+
# list[nipype2pydra.statements.imports.explicitimport] - list import statements required by the test, with each list item
222210
# consisting of 'module', 'name', and optionally 'alias' keys
223211
directive:
224212
# str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS

0 commit comments

Comments
 (0)