@@ -191,6 +191,26 @@ class BrickStatInputSpec(CommandLineInputSpec):
191
191
desc = 'print the minimum value in dataset' ,
192
192
argstr = '-min' ,
193
193
position = 1 )
194
+ slow = traits .Bool (
195
+ desc = 'read the whole dataset to find the min and max values' ,
196
+ argstr = '-slow' )
197
+ max = traits .Bool (
198
+ desc = 'print the maximum value in the dataset' ,
199
+ argstr = '-max' )
200
+ mean = traits .Bool (
201
+ desc = 'print the mean value in the dataset' ,
202
+ argstr = '-mean' )
203
+ sum = traits .Bool (
204
+ desc = 'print the sum of values in the dataset' ,
205
+ argstr = '-sum' )
206
+ var = traits .Bool (
207
+ desc = 'print the variance in the dataset' ,
208
+ argstr = '-var' )
209
+ percentile = traits .Tuple (traits .Float , traits .Float , traits .Float ,
210
+ desc = 'p0 ps p1 write the percentile values starting '
211
+ 'at p0% and ending at p1% at a step of ps%. '
212
+ 'only one sub-brick is accepted.' ,
213
+ argstr = '-percentile %.3f %.3f %.3f' )
194
214
195
215
196
216
class BrickStatOutputSpec (TraitedSpec ):
@@ -335,6 +355,84 @@ def _parse_inputs(self, skip=None):
335
355
skip = ('start_idx' , 'stop_idx' , 'other' ))
336
356
337
357
358
+ class CatInputSpec (AFNICommandInputSpec ):
359
+ in_files = traits .List (File (exists = True ), argstr = "%s" ,
360
+ mandatory = True , position = - 2 )
361
+ out_file = File (
362
+ argstr = '> %s' ,
363
+ default = 'catout.1d' ,
364
+ desc = 'output (concatenated) file name' ,
365
+ position = - 1 ,
366
+ mandatory = True )
367
+ omitconst = traits .Bool (
368
+ desc = 'Omit columns that are identically constant from output.' ,
369
+ argstr = '-nonconst' )
370
+ keepfree = traits .Bool (
371
+ desc = 'Keep only columns that are marked as \' free\' in the '
372
+ '3dAllineate header from \' -1Dparam_save\' . '
373
+ 'If there is no such header, all columns are kept.' ,
374
+ argst = '-nonfixed' )
375
+ out_format = traits .Enum (
376
+ 'int' ,'nice' ,'double' ,'fint' ,'cint' ,
377
+ argstr = '-form %s' ,
378
+ desc = 'specify data type for output. Valid types are \' int\' , '
379
+ '\' nice\' , \' double\' , \' fint\' , and \' cint\' .' ,
380
+ xor = ['out_int' ,'out_nice' ,'out_double' ,'out_fint' ,'out_cint' ])
381
+ stack = traits .Bool (
382
+ desc = 'Stack the columns of the resultant matrix in the output.' ,
383
+ argstr = '-stack' )
384
+ sel = traits .Str (
385
+ desc = 'Apply the same column/row selection string to all filenames '
386
+ 'on the command line.' ,
387
+ argstr = '-sel %s' )
388
+ out_int = traits .Bool (
389
+ desc = 'specifiy int data type for output' ,
390
+ argstr = '-i' ,
391
+ xor = ['out_format' ,'out_nice' ,'out_double' ,'out_fint' ,'out_cint' ])
392
+ out_nice = traits .Bool (
393
+ desc = 'specifiy nice data type for output' ,
394
+ argstr = '-n' ,
395
+ xor = ['out_format' ,'out_int' ,'out_double' ,'out_fint' ,'out_cint' ])
396
+ out_double = traits .Bool (
397
+ desc = 'specifiy double data type for output' ,
398
+ argstr = '-d' ,
399
+ xor = ['out_format' ,'out_nice' ,'out_int' ,'out_fint' ,'out_cint' ])
400
+ out_fint = traits .Bool (
401
+ desc = 'specifiy int, rounded down, data type for output' ,
402
+ argstr = '-f' ,
403
+ xor = ['out_format' ,'out_nice' ,'out_double' ,'out_int' ,'out_cint' ])
404
+ out_cint = traits .Bool (
405
+ desc = 'specifiy int, rounded up, data type for output' ,
406
+ xor = ['out_format' ,'out_nice' ,'out_double' ,'out_fint' ,'out_int' ])
407
+
408
+
409
+ class Cat (AFNICommand ):
410
+ """1dcat takes as input one or more 1D files, and writes out a 1D file
411
+ containing the side-by-side concatenation of all or a subset of the
412
+ columns from the input files.
413
+
414
+ For complete details, see the `1dcat Documentation.
415
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/1dcat.html>`_
416
+
417
+ Examples
418
+ ========
419
+
420
+ >>> from nipype.interfaces import afni
421
+ >>> cat1d = afni.Cat()
422
+ >>> cat1d.inputs.sel = "'[0,2]'"
423
+ >>> cat1d.inputs.in_files = ['f1.1D', 'f2.1D']
424
+ >>> cat1d.inputs.out_file = 'catout.1d'
425
+ >>> cat1d.cmdline # doctest: +ALLOW_UNICODE
426
+ "1dcat -sel '[0,2]' f1.1D f2.1D > catout.1d"
427
+ >>> res = cat1d.run() # doctest: +SKIP
428
+
429
+ """
430
+
431
+ _cmd = '1dcat'
432
+ input_spec = CatInputSpec
433
+ output_spec = AFNICommandOutputSpec
434
+
435
+
338
436
class CopyInputSpec (AFNICommandInputSpec ):
339
437
in_file = File (
340
438
desc = 'input file to 3dcopy' ,
@@ -1044,6 +1142,79 @@ def _list_outputs(self):
1044
1142
return outputs
1045
1143
1046
1144
1145
+ class NwarpApplyInputSpec (CommandLineInputSpec ):
1146
+ in_file = traits .Either (File (exists = True ), traits .List (File (exists = True )),
1147
+ mandatory = True ,
1148
+ argstr = '-source %s' ,
1149
+ desc = 'the name of the dataset to be warped '
1150
+ 'can be multiple datasets' )
1151
+ warp = traits .String (
1152
+ desc = 'the name of the warp dataset. '
1153
+ 'multiple warps can be concatenated (make sure they exist)' ,
1154
+ argstr = '-nwarp %s' ,
1155
+ mandatory = True )
1156
+ inv_warp = traits .Bool (
1157
+ desc = 'After the warp specified in \' -nwarp\' is computed, invert it' ,
1158
+ argstr = '-iwarp' )
1159
+ master = traits .File (exists = True ,
1160
+ desc = 'the name of the master dataset, which defines the output grid' ,
1161
+ argstr = '-master %s' )
1162
+ interp = traits .Enum ('NN' ,'nearestneighbour' ,'nearestneighbor' ,'linear' ,
1163
+ 'trilinear' ,'cubic' ,'tricubic' ,'quintic' ,'triquintic' ,'wsinc5' ,
1164
+ desc = 'defines interpolation method to use during warp' ,
1165
+ argstr = '-interp %s' ,
1166
+ default = 'wsinc5' )
1167
+ ainterp = traits .Enum ('NN' ,'nearestneighbour' ,'nearestneighbor' ,'linear' ,
1168
+ 'trilinear' ,'cubic' ,'tricubic' ,'quintic' ,'triquintic' ,'wsinc5' ,
1169
+ desc = 'specify a different interpolation method than might '
1170
+ 'be used for the warp' ,
1171
+ argstr = '-ainterp %s' ,
1172
+ default = 'wsinc5' )
1173
+ out_file = File (
1174
+ name_template = '%s_Nwarp' ,
1175
+ desc = 'output image file name' ,
1176
+ argstr = '-prefix %s' ,
1177
+ name_source = 'in_file' )
1178
+ short = traits .Bool (
1179
+ desc = 'Write output dataset using 16-bit short integers, rather than '
1180
+ 'the usual 32-bit floats.' ,
1181
+ argstr = '-short' )
1182
+ quiet = traits .Bool (
1183
+ desc = 'don\' t be verbose :(' ,
1184
+ argstr = '-quiet' ,
1185
+ xor = ['verb' ])
1186
+ verb = traits .Bool (
1187
+ desc = 'be extra verbose :)' ,
1188
+ argstr = '-verb' ,
1189
+ xor = ['quiet' ])
1190
+
1191
+
1192
+ class NwarpApply (AFNICommandBase ):
1193
+ """Program to apply a nonlinear 3D warp saved from 3dQwarp
1194
+ (or 3dNwarpCat, etc.) to a 3D dataset, to produce a warped
1195
+ version of the source dataset.
1196
+
1197
+ For complete details, see the `3dNwarpApply Documentation.
1198
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dNwarpApply.html>`_
1199
+
1200
+ Examples
1201
+ ========
1202
+
1203
+ >>> from nipype.interfaces import afni
1204
+ >>> nwarp = afni.NwarpApply()
1205
+ >>> nwarp.inputs.in_file = 'Fred+orig'
1206
+ >>> nwarp.inputs.master = 'NWARP'
1207
+ >>> nwarp.inputs.warp = "'Fred_WARP+tlrc Fred.Xaff12.1D'"
1208
+ >>> nwarp.cmdline # doctest: +ALLOW_UNICODE
1209
+ "3dNwarpApply -source Fred+orig -master NWARP -prefix Fred+orig_Nwarp -nwarp \' Fred_WARP+tlrc Fred.Xaff12.1D\' "
1210
+ >>> res = nwarp.run() # doctest: +SKIP
1211
+
1212
+ """
1213
+ _cmd = '3dNwarpApply'
1214
+ input_spec = NwarpApplyInputSpec
1215
+ output_spec = AFNICommandOutputSpec
1216
+
1217
+
1047
1218
class RefitInputSpec (CommandLineInputSpec ):
1048
1219
in_file = File (
1049
1220
desc = 'input file to 3drefit' ,
@@ -1571,7 +1742,7 @@ class AxializeInputSpec(AFNICommandInputSpec):
1571
1742
orientation = Str (
1572
1743
desc = 'new orientation code' ,
1573
1744
argstr = '-orient %s' )
1574
-
1745
+
1575
1746
1576
1747
class Axialize (AFNICommand ):
1577
1748
"""Read in a dataset and write it out as a new dataset
@@ -1595,7 +1766,7 @@ class Axialize(AFNICommand):
1595
1766
_cmd = '3daxialize'
1596
1767
input_spec = AxializeInputSpec
1597
1768
output_spec = AFNICommandOutputSpec
1598
-
1769
+
1599
1770
1600
1771
class ZcatInputSpec (AFNICommandInputSpec ):
1601
1772
in_files = InputMultiPath (
0 commit comments