Skip to content

Commit 2087111

Browse files
committed
Update auto-generated files after make specs
1 parent 9da6ebb commit 2087111

File tree

11 files changed

+212
-35
lines changed

11 files changed

+212
-35
lines changed

examples/fmri_ants_openfmri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def analyze_openfmri_dataset(data_dir, subject=None, model_id=None,
378378
name='datasource')
379379
datasource.inputs.base_directory = data_dir
380380
datasource.inputs.template = '*'
381-
381+
382382
if has_contrast:
383383
datasource.inputs.field_template = {'anat': '%s/anatomy/highres001.nii.gz',
384384
'bold': '%s/BOLD/task%03d_r*/bold.nii.gz',

examples/rsfmri_vol_surface_preprocessing_nipy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ def create_resting_workflow(args, name=None):
945945
if args.dicom_file:
946946
TR, slice_times, slice_thickness = get_info(args.dicom_file)
947947
slice_times = (np.array(slice_times)/1000.).tolist()
948-
948+
949949
if name is None:
950950
name = 'resting_' + args.subject_id
951951
kwargs = dict(files=[os.path.abspath(filename) for filename in args.files],
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.algorithms.misc import Overlap
4+
5+
def test_Overlap_inputs():
6+
input_map = dict(bg_overlap=dict(mandatory=True,
7+
usedefault=True,
8+
),
9+
ignore_exception=dict(nohash=True,
10+
usedefault=True,
11+
),
12+
mask_volume=dict(),
13+
out_file=dict(usedefault=True,
14+
),
15+
vol_units=dict(mandatory=True,
16+
usedefault=True,
17+
),
18+
volume1=dict(mandatory=True,
19+
),
20+
volume2=dict(mandatory=True,
21+
),
22+
weighting=dict(usedefault=True,
23+
),
24+
)
25+
inputs = Overlap.input_spec()
26+
27+
for key, metadata in input_map.items():
28+
for metakey, value in metadata.items():
29+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
30+
31+
def test_Overlap_outputs():
32+
output_map = dict(dice=dict(),
33+
diff_file=dict(),
34+
jaccard=dict(),
35+
labels=dict(),
36+
roi_di=dict(),
37+
roi_ji=dict(),
38+
roi_voldiff=dict(),
39+
volume_difference=dict(),
40+
)
41+
outputs = Overlap.output_spec()
42+
43+
for key, metadata in output_map.items():
44+
for metakey, value in metadata.items():
45+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
46+

nipype/interfaces/ants/segmentation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class N4BiasFieldCorrection(ANTSCommand):
268268
269269
Examples
270270
--------
271-
271+
272272
>>> import copy
273273
>>> from nipype.interfaces.ants import N4BiasFieldCorrection
274274
>>> n4 = N4BiasFieldCorrection()
@@ -327,14 +327,14 @@ def _format_arg(self, name, trait_spec, value):
327327
output = self._gen_filename('output_image')
328328
newval = '[ %s, %s ]' % (output, bias_image)
329329
return trait_spec.argstr % newval
330-
330+
331331
if name == 'bspline_fitting_distance':
332332
if isdefined(self.inputs.bspline_order):
333333
newval = '[ %g, %d ]' % (value, self.inputs.bspline_order)
334334
else:
335335
newval = '[ %g ]' % value
336336
return trait_spec.argstr % newval
337-
337+
338338
if ((name == 'n_iterations') and
339339
(isdefined(self.inputs.convergence_threshold))):
340340
newval = '[ %s, %g ]' % ('x'.join([str(elt) for elt in value]),
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.ants.visualization import ConvertScalarImageToRGB
4+
5+
def test_ConvertScalarImageToRGB_inputs():
6+
input_map = dict(args=dict(argstr='%s',
7+
),
8+
colormap=dict(argstr='%s',
9+
mandatory=True,
10+
position=4,
11+
usedefault=True,
12+
),
13+
custom_color_map_file=dict(argstr='%s',
14+
position=5,
15+
usedefault=True,
16+
),
17+
dimension=dict(argstr='%d',
18+
mandatory=True,
19+
position=0,
20+
usedefault=True,
21+
),
22+
environ=dict(nohash=True,
23+
usedefault=True,
24+
),
25+
ignore_exception=dict(nohash=True,
26+
usedefault=True,
27+
),
28+
input_image=dict(argstr='%s',
29+
mandatory=True,
30+
position=1,
31+
),
32+
mask_image=dict(argstr='%s',
33+
position=3,
34+
usedefault=True,
35+
),
36+
maximum_RGB_output=dict(argstr='%d',
37+
position=9,
38+
usedefault=True,
39+
),
40+
maximum_input=dict(argstr='%d',
41+
mandatory=True,
42+
position=7,
43+
),
44+
minimum_RGB_output=dict(argstr='%d',
45+
position=8,
46+
usedefault=True,
47+
),
48+
minimum_input=dict(argstr='%d',
49+
mandatory=True,
50+
position=6,
51+
),
52+
num_threads=dict(nohash=True,
53+
usedefault=True,
54+
),
55+
output_image=dict(argstr='%s',
56+
position=2,
57+
usedefault=True,
58+
),
59+
terminal_output=dict(mandatory=True,
60+
nohash=True,
61+
),
62+
)
63+
inputs = ConvertScalarImageToRGB.input_spec()
64+
65+
for key, metadata in input_map.items():
66+
for metakey, value in metadata.items():
67+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
68+
69+
def test_ConvertScalarImageToRGB_outputs():
70+
output_map = dict(output_image=dict(),
71+
)
72+
outputs = ConvertScalarImageToRGB.output_spec()
73+
74+
for key, metadata in output_map.items():
75+
for metakey, value in metadata.items():
76+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
77+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.ants.visualization import CreateTiledMosaic
4+
5+
def test_CreateTiledMosaic_inputs():
6+
input_map = dict(alpha_value=dict(argstr='-a %.2f',
7+
),
8+
args=dict(argstr='%s',
9+
),
10+
direction=dict(argstr='-d %d',
11+
),
12+
environ=dict(nohash=True,
13+
usedefault=True,
14+
),
15+
flip_slice=dict(argstr='-f %s',
16+
),
17+
ignore_exception=dict(nohash=True,
18+
usedefault=True,
19+
),
20+
input_image=dict(argstr='-i %s',
21+
mandatory=True,
22+
),
23+
mask_image=dict(argstr='-x %s',
24+
),
25+
num_threads=dict(nohash=True,
26+
usedefault=True,
27+
),
28+
output_image=dict(argstr='-o %s',
29+
usedefault=True,
30+
),
31+
pad_or_crop=dict(argstr='-p %s',
32+
),
33+
permute_axes=dict(argstr='-g',
34+
),
35+
rgb_image=dict(argstr='-r %s',
36+
mandatory=True,
37+
),
38+
slices=dict(argstr='-s %s',
39+
),
40+
terminal_output=dict(mandatory=True,
41+
nohash=True,
42+
),
43+
tile_geometry=dict(argstr='-t %s',
44+
),
45+
)
46+
inputs = CreateTiledMosaic.input_spec()
47+
48+
for key, metadata in input_map.items():
49+
for metakey, value in metadata.items():
50+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
51+
52+
def test_CreateTiledMosaic_outputs():
53+
output_map = dict(output_image=dict(),
54+
)
55+
outputs = CreateTiledMosaic.output_spec()
56+
57+
for key, metadata in output_map.items():
58+
for metakey, value in metadata.items():
59+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
60+

nipype/interfaces/ants/visualization.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ConvertScalarImageToRGBInputSpec(ANTSCommandInputSpec):
3030
'blue, copper, jet, hsv, spring, summer, '
3131
'autumn, winter, hot, cool, overunder, custom '
3232
), mandatory = True, position = 4)
33-
custom_color_map_file=traits.Str('none', argstr='%s', usedefault=True,
33+
custom_color_map_file=traits.Str('none', argstr='%s', usedefault=True,
3434
desc = 'custom color map file', position = 5)
3535
minimum_input = traits.Int(argstr='%d', desc='minimum input',
3636
mandatory = True, position = 6)
@@ -54,7 +54,7 @@ class ConvertScalarImageToRGB(ANTSCommand):
5454
>>> converter.inputs.input_image = 'T1.nii.gz'
5555
>>> converter.inputs.colormap = 'jet'
5656
>>> converter.inputs.minimum_input = 0
57-
>>> converter.inputs.maximum_input = 6
57+
>>> converter.inputs.maximum_input = 6
5858
>>> converter.cmdline
5959
'ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255'
6060
"""
@@ -67,9 +67,9 @@ def _format_arg(self, opt, spec, val):
6767

6868
def _list_outputs(self):
6969
outputs = self._outputs().get()
70-
outputs['output_image'] = os.path.join(os.getcwd(),
70+
outputs['output_image'] = os.path.join(os.getcwd(),
7171
self.inputs.output_image)
72-
return outputs
72+
return outputs
7373

7474

7575
class CreateTiledMosaicInputSpec(ANTSCommandInputSpec):
@@ -78,7 +78,7 @@ class CreateTiledMosaicInputSpec(ANTSCommandInputSpec):
7878
mandatory = True)
7979
rgb_image= File(argstr='-r %s', exists = True,
8080
desc = ('An optional Rgb image can be added as an overlay.'
81-
'It must have the same image'
81+
'It must have the same image'
8282
'geometry as the input grayscale image.'),
8383
mandatory = True)
8484
mask_image = File(argstr = '-x %s', exists = True,
@@ -88,24 +88,24 @@ class CreateTiledMosaicInputSpec(ANTSCommandInputSpec):
8888
'using the specified alpha parameter.'))
8989
output_image = traits.Str('output.png', argstr = '-o %s',
9090
desc = 'The output consists of the tiled mosaic image.',
91-
usedefault = True)
91+
usedefault = True)
9292
tile_geometry = traits.Str(argstr = '-t %s',desc = (
9393
'The tile geometry specifies the number of rows and columns'
94-
'in the output image. For example, if the user specifies "5x10", '
94+
'in the output image. For example, if the user specifies "5x10", '
9595
'then 5 rows by 10 columns of slices are rendered. If R < 0 and C > '
9696
'0 (or vice versa), the negative value is selected'
97-
'based on direction.'))
97+
'based on direction.'))
9898
direction = traits.Int(argstr = '-d %d', desc = ('Specifies the direction of '
9999
'the slices. If no direction is specified, the '
100-
'direction with the coarsest spacing is chosen.'))
101-
pad_or_crop = traits.Str(argstr='-p %s',
100+
'direction with the coarsest spacing is chosen.'))
101+
pad_or_crop = traits.Str(argstr='-p %s',
102102
desc = 'argument passed to -p flag:'
103103
'[padVoxelWidth,<constantValue=0>]'
104104
'[lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],'
105105
'constantValue]'
106106
'The user can specify whether to pad or crop a specified '
107107
'voxel-width boundary of each individual slice. For this '
108-
'program, cropping is simply padding with negative voxel-widths.'
108+
'program, cropping is simply padding with negative voxel-widths.'
109109
'If one pads (+), the user can also specify a constant pad '
110110
'value (default = 0). If a mask is specified, the user can use '
111111
'the mask to define the region, by using the keyword "mask"'
@@ -118,21 +118,21 @@ class CreateTiledMosaicInputSpec(ANTSCommandInputSpec):
118118
desc = ('flipXxflipY'))
119119
permute_axes = traits.Bool(argstr = '-g', desc = 'doPermute'
120120
)
121-
121+
122122

123123
class CreateTiledMosaicOutputSpec(TraitedSpec):
124124
output_image= File(exists=True, desc='image file')
125125

126126
class CreateTiledMosaic(ANTSCommand):
127127
"""The program CreateTiledMosaic in conjunction with ConvertScalarImageToRGB
128-
provides useful functionality for common image analysis tasks. The basic
129-
usage of CreateTiledMosaic is to tile a 3-D image volume slice-wise into
128+
provides useful functionality for common image analysis tasks. The basic
129+
usage of CreateTiledMosaic is to tile a 3-D image volume slice-wise into
130130
a 2-D image.
131131
132132
Examples
133133
--------
134134
135-
>>> from nipype.interfaces.ants.visualization import CreateTiledMosaic
135+
>>> from nipype.interfaces.ants.visualization import CreateTiledMosaic
136136
>>> mosaic_slicer = CreateTiledMosaic()
137137
>>> mosaic_slicer.inputs.input_image = 'T1.nii.gz'
138138
>>> mosaic_slicer.inputs.rgb_image = 'rgb.nii.gz'
@@ -141,17 +141,17 @@ class CreateTiledMosaic(ANTSCommand):
141141
>>> mosaic_slicer.inputs.alpha_value = 0.5
142142
>>> mosaic_slicer.inputs.direction = 2
143143
>>> mosaic_slicer.inputs.pad_or_crop = '[ -15x -50 , -15x -30 ,0]'
144-
>>> mosaic_slicer.inputs.slices = '[2 ,100 ,160]'
144+
>>> mosaic_slicer.inputs.slices = '[2 ,100 ,160]'
145145
>>> mosaic_slicer.cmdline
146146
'CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160]'
147147
"""
148148

149149
_cmd = 'CreateTiledMosaic'
150150
input_spec = CreateTiledMosaicInputSpec
151151
output_spec = CreateTiledMosaicOutputSpec
152-
152+
153153
def _list_outputs(self):
154154
outputs = self._outputs().get()
155-
outputs['output_image'] = os.path.join(os.getcwd(),
155+
outputs['output_image'] = os.path.join(os.getcwd(),
156156
self.inputs.output_image)
157157
return outputs

nipype/interfaces/spm/tests/test_auto_Normalize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def test_Normalize_inputs():
1313
ignore_exception=dict(nohash=True,
1414
usedefault=True,
1515
),
16-
jobtype=dict(),
16+
jobtype=dict(usedefault=True,
17+
),
1718
matlab_cmd=dict(),
1819
mfile=dict(usedefault=True,
1920
),

nipype/interfaces/spm/tests/test_auto_Normalize12.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def test_Normalize12_inputs():
2525
mandatory=True,
2626
xor=['deformation_file'],
2727
),
28-
jobtype=dict(),
28+
jobtype=dict(usedefault=True,
29+
),
2930
matlab_cmd=dict(),
3031
mfile=dict(usedefault=True,
3132
),

nipype/testing/data/pyscript.m

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
fprintf(1,'Executing %s at %s:\n',mfilename,datestr(now));
22
ver,
3-
try,
4-
if isempty(which('spm')),
5-
throw(MException('SPMCheck:NotFound','SPM not in matlab path'));
6-
end;
7-
spm_path = spm('dir');
8-
[name, version] = spm('ver');
9-
fprintf(1, 'NIPYPE path:%s|name:%s|release:%s', spm_path, name, version);
10-
exit;
11-
3+
try,a=1;
124
,catch ME,
135
fprintf(2,'MATLAB code threw an exception:\n');
146
fprintf(2,'%s\n',ME.message);

0 commit comments

Comments
 (0)