5
5
Change directory to provide relative paths for doctests
6
6
>>> import os
7
7
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
8
- >>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
8
+ >>> datadir = os.path.realpath(os.path.join(filepath, '../../ testing/data'))
9
9
>>> os.chdir(datadir)
10
10
"""
11
11
import warnings
@@ -148,9 +148,8 @@ class TShift(AFNICommand):
148
148
========
149
149
150
150
>>> from nipype.interfaces import afni as afni
151
- >>> from nipype.testing import example_data
152
151
>>> tshift = afni.TShift()
153
- >>> tshift.inputs.in_file = example_data( 'functional.nii')
152
+ >>> tshift.inputs.in_file = 'functional.nii'
154
153
>>> tshift.inputs.out_file = 'functional_tshift.nii'
155
154
>>> tshift.inputs.tpattern = 'alt+z'
156
155
>>> tshift.inputs.tzero = 0.0
@@ -201,7 +200,7 @@ class RefitInputSpec(AFNITraitedSpec):
201
200
202
201
203
202
class RefitOutputSpec (TraitedSpec ):
204
- out_file = File (desc = 'Same file as original infile with modified matrix' ,
203
+ out_file = File (desc = 'Same file as original in_file with modified matrix' ,
205
204
exists = True )
206
205
207
206
@@ -215,9 +214,8 @@ class Refit(AFNICommand):
215
214
========
216
215
217
216
>>> from nipype.interfaces import afni as afni
218
- >>> from nipype.testing import example_data
219
217
>>> refit = afni.Refit()
220
- >>> refit.inputs.in_file = example_data( 'structural.nii')
218
+ >>> refit.inputs.in_file = 'structural.nii'
221
219
>>> refit.inputs.deoblique=True
222
220
>>> res = refit.run() # doctest: +SKIP
223
221
@@ -294,9 +292,8 @@ class Warp(AFNICommand):
294
292
========
295
293
296
294
>>> from nipype.interfaces import afni as afni
297
- >>> from nipype.testing import example_data
298
295
>>> warp = afni.Warp()
299
- >>> warp.inputs.in_file = example_data( 'structural.nii')
296
+ >>> warp.inputs.in_file = 'structural.nii'
300
297
>>> warp.inputs.deoblique = True
301
298
>>> res = warp.run() # doctest: +SKIP
302
299
@@ -356,9 +353,8 @@ class Resample(AFNICommand):
356
353
========
357
354
358
355
>>> from nipype.interfaces import afni as afni
359
- >>> from nipype.testing import example_data
360
356
>>> resample = afni.Resample()
361
- >>> resample.inputs.in_file = example_data( 'functional.nii')
357
+ >>> resample.inputs.in_file = 'functional.nii'
362
358
>>> resample.inputs.orientation= 'RPI'
363
359
>>> res = resample.run() # doctest: +SKIP
364
360
@@ -414,9 +410,8 @@ class TStat(AFNICommand):
414
410
========
415
411
416
412
>>> from nipype.interfaces import afni as afni
417
- >>> from nipype.testing import example_data
418
413
>>> tstat = afni.TStat()
419
- >>> tstat.inputs.in_file = example_data( 'functional.nii')
414
+ >>> tstat.inputs.in_file = 'functional.nii'
420
415
>>> tstat.inputs.args= '-mean'
421
416
>>> res = tstat.run() # doctest: +SKIP
422
417
@@ -471,9 +466,8 @@ class Detrend(AFNICommand):
471
466
========
472
467
473
468
>>> from nipype.interfaces import afni as afni
474
- >>> from nipype.testing import example_data
475
469
>>> detrend = afni.Detrend()
476
- >>> detrend.inputs.in_file = example_data( 'functional.nii')
470
+ >>> detrend.inputs.in_file = 'functional.nii'
477
471
>>> detrend.inputs.args = '-polort 2'
478
472
>>> res = detrend.run() # doctest: +SKIP
479
473
@@ -529,9 +523,8 @@ class Despike(AFNICommand):
529
523
========
530
524
531
525
>>> from nipype.interfaces import afni as afni
532
- >>> from nipype.testing import example_data
533
526
>>> despike = afni.Despike()
534
- >>> despike.inputs.in_file = example_data( 'functional.nii')
527
+ >>> despike.inputs.in_file = 'functional.nii'
535
528
>>> res = despike.run() # doctest: +SKIP
536
529
537
530
"""
@@ -605,9 +598,8 @@ class Automask(AFNICommand):
605
598
========
606
599
607
600
>>> from nipype.interfaces import afni as afni
608
- >>> from nipype.testing import example_data
609
601
>>> automask = afni.Automask()
610
- >>> automask.inputs.in_file = example_data( 'functional.nii')
602
+ >>> automask.inputs.in_file = 'functional.nii'
611
603
>>> automask.inputs.dilate = 1
612
604
>>> res = automask.run() # doctest: +SKIP
613
605
@@ -691,11 +683,10 @@ class Volreg(AFNICommand):
691
683
========
692
684
693
685
>>> from nipype.interfaces import afni as afni
694
- >>> from nipype.testing import example_data
695
686
>>> volreg = afni.Volreg()
696
- >>> volreg.inputs.in_file = example_data( 'functional.nii')
697
- >>> volreg.inputs.other = '-Fourier -twopass'
698
- >>> volreg.inputs.zpad = '4'
687
+ >>> volreg.inputs.in_file = 'functional.nii'
688
+ >>> volreg.inputs.args = '-Fourier -twopass'
689
+ >>> volreg.inputs.zpad = 4
699
690
>>> res = volreg.run() # doctest: +SKIP
700
691
701
692
"""
@@ -759,12 +750,11 @@ class Merge(AFNICommand):
759
750
========
760
751
761
752
>>> from nipype.interfaces import afni as afni
762
- >>> from nipype.testing import example_data
763
753
>>> merge = afni.Merge()
764
- >>> merge.inputs.infile = example_data( 'functional.nii')
765
- >>> merge.inputs.blurfwhm = 4.0
754
+ >>> merge.inputs.in_files = [ 'functional.nii', 'functional2.nii']
755
+ >>> merge.inputs.blurfwhm = 4
766
756
>>> merge.inputs.doall = True
767
- >>> merge.inputs.outfile = 'e7.nii'
757
+ >>> merge.inputs.out_file = 'e7.nii'
768
758
>>> res = merge.run() # doctest: +SKIP
769
759
770
760
"""
@@ -816,9 +806,8 @@ class Copy(AFNICommand):
816
806
========
817
807
818
808
>>> from nipype.interfaces import afni as afni
819
- >>> from nipype.testing import example_data
820
809
>>> copy = afni.Copy()
821
- >>> copy.inputs.in_file = example_data( 'functional.nii')
810
+ >>> copy.inputs.in_file = 'functional.nii'
822
811
>>> copy.inputs.out_file = 'new_func.nii'
823
812
>>> res = copy.run() # doctest: +SKIP
824
813
@@ -879,9 +868,8 @@ class Fourier(AFNICommand):
879
868
========
880
869
881
870
>>> from nipype.interfaces import afni as afni
882
- >>> from nipype.testing import example_data
883
871
>>> fourier = afni.Fourier()
884
- >>> fourier.inputs.in_file = example_data( 'functional.nii')
872
+ >>> fourier.inputs.in_file = 'functional.nii'
885
873
>>> fourier.inputs.args = '-retrend'
886
874
>>> fourier.inputs.highpass = 0.005
887
875
>>> fourier.inputs.lowpass = 0.1
@@ -937,10 +925,9 @@ class ZCutUp(AFNICommand):
937
925
========
938
926
939
927
>>> from nipype.interfaces import afni as afni
940
- >>> from nipype.testing import example_data
941
- >>> zcutup = afni.Zcutup()
942
- >>> zcutup.inputs.infile = example_data('functional.nii')
943
- >>> zcutup.inputs.outfile= 'functional_zcutup.nii'
928
+ >>> zcutup = afni.ZCutUp()
929
+ >>> zcutup.inputs.in_file = 'functional.nii'
930
+ >>> zcutup.inputs.out_file = 'functional_zcutup.nii'
944
931
>>> zcutup.inputs.keep= '0 10'
945
932
>>> res = zcutup.run() # doctest: +SKIP
946
933
@@ -996,11 +983,10 @@ class Allineate(AFNICommand):
996
983
========
997
984
998
985
>>> from nipype.interfaces import afni as afni
999
- >>> from nipype.testing import example_data
1000
986
>>> allineate = afni.Allineate()
1001
- >>> allineate.inputs.infile = example_data( 'functional.nii')
1002
- >>> allineate.inputs.outfile = 'functional_allineate.nii'
1003
- >>> allineate.inputs.matrix= example_data( 'cmatrix.mat')
987
+ >>> allineate.inputs.in_file = 'functional.nii'
988
+ >>> allineate.inputs.out_file = 'functional_allineate.nii'
989
+ >>> allineate.inputs.matrix= 'cmatrix.mat'
1004
990
>>> res = allineate.run() # doctest: +SKIP
1005
991
1006
992
"""
@@ -1061,10 +1047,9 @@ class Maskave(AFNICommand):
1061
1047
========
1062
1048
1063
1049
>>> from nipype.interfaces import afni as afni
1064
- >>> from nipype.testing import example_data
1065
1050
>>> maskave = afni.Maskave()
1066
- >>> maskave.inputs.in_file = example_data( 'functional.nii')
1067
- >>> maskave.inputs.mask= example_data( 'seed_mask.nii')
1051
+ >>> maskave.inputs.in_file = 'functional.nii'
1052
+ >>> maskave.inputs.mask= 'seed_mask.nii'
1068
1053
>>> maskave.inputs.quiet= True
1069
1054
>>> maskave.inputs.out_file= 'maskave.1D'
1070
1055
>>> res = maskave.run() # doctest: +SKIP
@@ -1119,9 +1104,8 @@ class SkullStrip(AFNICommand):
1119
1104
========
1120
1105
1121
1106
>>> from nipype.interfaces import afni as afni
1122
- >>> from nipype.testing import example_data
1123
- >>> skullstrip = afni.Skullstrip()
1124
- >>> skullstrip.inputs.in_file = example_data('functional.nii')
1107
+ >>> skullstrip = afni.SkullStrip()
1108
+ >>> skullstrip.inputs.in_file = 'functional.nii'
1125
1109
>>> skullstrip.inputs.args = '-o_ply'
1126
1110
>>> res = skullstrip.run() # doctest: +SKIP
1127
1111
@@ -1177,9 +1161,8 @@ class TCat(AFNICommand):
1177
1161
========
1178
1162
1179
1163
>>> from nipype.interfaces import afni as afni
1180
- >>> from nipype.testing import example_data
1181
1164
>>> tcat = afni.TCat()
1182
- >>> tcat.inputs.in_file = example_data( 'functional.nii')
1165
+ >>> tcat.inputs.in_files = [ 'functional.nii', 'functional2.nii']
1183
1166
>>> tcat.inputs.out_file= 'functional_tcat.nii'
1184
1167
>>> tcat.inputs.rlt = '+'
1185
1168
>>> res = tcat.run() # doctest: +SKIP
@@ -1243,10 +1226,9 @@ class Fim(AFNICommand):
1243
1226
========
1244
1227
1245
1228
>>> from nipype.interfaces import afni as afni
1246
- >>> from nipype.testing import example_data
1247
1229
>>> fim = afni.Fim()
1248
- >>> fim.inputs.in_file = example_data( 'functional.nii')
1249
- >>> fim.inputs.ideal_file= example_data( 'seed.1D')
1230
+ >>> fim.inputs.in_file = 'functional.nii'
1231
+ >>> fim.inputs.ideal_file= 'seed.1D'
1250
1232
>>> fim.inputs.out_file = 'functional_corr.nii'
1251
1233
>>> fim.inputs.out = 'Correlation'
1252
1234
>>> fim.inputs.fim_thr = 0.0009
@@ -1313,11 +1295,9 @@ class TCorrelate(AFNICommand):
1313
1295
========
1314
1296
1315
1297
>>> from nipype.interfaces import afni as afni
1316
- >>> from nipype.testing import example_data
1317
1298
>>> tcorrelate = afni.TCorrelate()
1318
- >>> tcorrelate.inputs.in_file = example_data('functional.nii')
1319
- >>> tcorrelate.inputs.xset= example_data('u_rc1s1_Template.nii')
1320
- >>> tcorrelate.inputs.yset = example_data('u_rc1s2_Template.nii')
1299
+ >>> tcorrelate.inputs.xset= 'u_rc1s1_Template.nii'
1300
+ >>> tcorrelate.inputs.yset = 'u_rc1s2_Template.nii'
1321
1301
>>> tcorrelate.inputs.out_file = 'functional_tcorrelate.nii.gz'
1322
1302
>>> tcorrelate.inputs.polort = -1
1323
1303
>>> tcorrelate.inputs.pearson = True
@@ -1375,10 +1355,9 @@ class BrickStat(AFNICommand):
1375
1355
========
1376
1356
1377
1357
>>> from nipype.interfaces import afni as afni
1378
- >>> from nipype.testing import example_data
1379
1358
>>> brickstat = afni.BrickStat()
1380
- >>> brickstat.inputs.in_file = example_data( 'functional.nii')
1381
- >>> brickstat.inputs.mask = example_data( 'skeleton_mask.nii.gz')
1359
+ >>> brickstat.inputs.in_file = 'functional.nii'
1360
+ >>> brickstat.inputs.mask = 'skeleton_mask.nii.gz'
1382
1361
>>> brickstat.inputs.min = True
1383
1362
>>> res = brickstat.run() # doctest: +SKIP
1384
1363
@@ -1453,10 +1432,9 @@ class ROIStats(AFNICommand):
1453
1432
========
1454
1433
1455
1434
>>> from nipype.interfaces import afni as afni
1456
- >>> from nipype.testing import example_data
1457
1435
>>> roistats = afni.ROIStats()
1458
- >>> roistats.inputs.in_file = example_data( 'functional.nii')
1459
- >>> roistats.inputs.mask = example_data( 'skeleton_mask.nii.gz')
1436
+ >>> roistats.inputs.in_file = 'functional.nii'
1437
+ >>> roistats.inputs.mask = 'skeleton_mask.nii.gz'
1460
1438
>>> roistats.inputs.quiet=True
1461
1439
>>> res = roistats.run() # doctest: +SKIP
1462
1440
@@ -1514,15 +1492,15 @@ class CalcInputSpec(AFNITraitedSpec):
1514
1492
argstr = '-a %s' , position = 0 , mandatory = True , exists = True )
1515
1493
in_file_b = File (desc = 'operand file to 3dcalc' ,
1516
1494
argstr = ' -b %s' , position = 1 , exists = True )
1517
- expr = traits .Str (desc = 'expr' , argstr = '-expr %s ' , position = 2 ,
1495
+ expr = traits .Str (desc = 'expr' , argstr = '-expr "%s" ' , position = 2 ,
1518
1496
mandatory = True )
1519
1497
out_file = File (desc = 'output file from 3dFourier' , argstr = '-prefix %s' ,
1520
1498
position = - 1 , genfile = True )
1521
- start_idx = traits .Int (desc = 'start index for infile_a ' ,
1499
+ start_idx = traits .Int (desc = 'start index for in_file_a ' ,
1522
1500
requires = ['stop_idx' ])
1523
- stop_idx = traits .Int (desc = 'stop index for infile_a ' ,
1501
+ stop_idx = traits .Int (desc = 'stop index for in_file_a ' ,
1524
1502
requires = ['start_idx' ])
1525
- single_idx = traits .Int (desc = 'volume index for infile_a ' )
1503
+ single_idx = traits .Int (desc = 'volume index for in_file_a ' )
1526
1504
suffix = traits .Str ('_calc' , desc = "out_file suffix" , usedefault = True )
1527
1505
1528
1506
@@ -1540,13 +1518,13 @@ class Calc(AFNICommand):
1540
1518
========
1541
1519
1542
1520
>>> from nipype.interfaces import afni as afni
1543
- >>> from nipype.testing import example_data
1544
1521
>>> calc = afni.Calc()
1545
- >>> calc.inputs.infile_a = example_data( 'functional.nii')
1546
- >>> calc.inputs.Infile_b = example_data( 'functional2.nii.gz')
1522
+ >>> calc.inputs.in_file_a = 'functional.nii'
1523
+ >>> calc.inputs.in_file_b = 'functional2.nii'
1547
1524
>>> calc.inputs.expr='a*b'
1548
1525
>>> calc.inputs.out_file = 'functional_calc.nii.gz'
1549
- >>> res = calc.run() # doctest: +SKIP
1526
+ >>> calc.cmdline
1527
+ '3dcalc -a functional.nii -b functional2.nii -expr "a*b" -prefix functional_calc.nii.gz'
1550
1528
1551
1529
"""
1552
1530
@@ -1568,7 +1546,7 @@ def _gen_filename(self, name):
1568
1546
return self ._list_outputs ()[name ]
1569
1547
1570
1548
def _format_arg (self , name , trait_spec , value ):
1571
- if name == 'infile_a ' :
1549
+ if name == 'in_file_a ' :
1572
1550
arg = trait_spec .argstr % value
1573
1551
if isdefined (self .inputs .start_idx ):
1574
1552
arg += '[%d..%d]' % (self .inputs .start_idx ,
0 commit comments