@@ -204,14 +204,10 @@ class FieldMapOutputSpec(TraitedSpec):
204
204
205
205
class FieldMap (SPMCommand ):
206
206
"""Use the fieldmap toolbox from spm to calculate the voxel displacement map (VDM).
207
-
208
207
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=173
209
-
210
208
.. important::
211
-
212
209
This interface does not deal with real/imag magnitude images nor
213
210
with the two phase files case.
214
-
215
211
Examples
216
212
--------
217
213
>>> from nipype.interfaces.spm import FieldMap
@@ -223,7 +219,6 @@ class FieldMap(SPMCommand):
223
219
>>> fm.inputs.total_readout_time = 15.6
224
220
>>> fm.inputs.epi_file = 'epi.nii'
225
221
>>> fm.run() # doctest: +SKIP
226
-
227
222
"""
228
223
229
224
input_spec = FieldMapInputSpec
@@ -258,13 +253,11 @@ def _list_outputs(self):
258
253
class ApplyVDMInputSpec (SPMCommandInputSpec ):
259
254
260
255
in_files = InputMultiObject (
261
- traits .Either (
262
- ImageFileSPM (exists = True ), traits .List (ImageFileSPM (exists = True ))
263
- ),
264
- field = 'data.scans' ,
256
+ ImageFileSPM (exists = True ),
257
+ field = "data.scans" ,
265
258
mandatory = True ,
266
259
copyfile = True ,
267
- desc = ' list of filenames to apply the vdm to' ,
260
+ desc = " list of filenames to apply the vdm to" ,
268
261
)
269
262
vdmfile = File (
270
263
field = "data.vdmfile" ,
@@ -321,14 +314,10 @@ class ApplyVDMOutputSpec(TraitedSpec):
321
314
322
315
class ApplyVDM (SPMCommand ):
323
316
"""Use the fieldmap toolbox from spm to apply the voxel displacement map (VDM) to some epi files.
324
-
325
317
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=173
326
-
327
318
.. important::
328
-
329
319
This interface does not deal with real/imag magnitude images nor
330
320
with the two phase files case.
331
-
332
321
"""
333
322
334
323
input_spec = ApplyVDMInputSpec
@@ -339,11 +328,7 @@ class ApplyVDM(SPMCommand):
339
328
def _format_arg (self , opt , spec , val ):
340
329
"""Convert input to appropriate format for spm"""
341
330
342
- if opt == 'in_files' :
343
- return scans_for_fnames (
344
- ensure_list (val ), keep4d = False , separate_sessions = False
345
- )
346
- if opt == 'vdmfile' :
331
+ if opt in ["in_files" , "vdmfile" ]:
347
332
return scans_for_fname (ensure_list (val ))
348
333
return super (ApplyVDM , self )._format_arg (opt , spec , val )
349
334
@@ -435,12 +420,9 @@ class SliceTimingOutputSpec(TraitedSpec):
435
420
436
421
class SliceTiming (SPMCommand ):
437
422
"""Use spm to perform slice timing correction.
438
-
439
423
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=19
440
-
441
424
Examples
442
425
--------
443
-
444
426
>>> from nipype.interfaces.spm import SliceTiming
445
427
>>> st = SliceTiming()
446
428
>>> st.inputs.in_files = 'functional.nii'
@@ -450,7 +432,6 @@ class SliceTiming(SPMCommand):
450
432
>>> st.inputs.slice_order = list(range(32,0,-1))
451
433
>>> st.inputs.ref_slice = 1
452
434
>>> st.run() # doctest: +SKIP
453
-
454
435
"""
455
436
456
437
input_spec = SliceTimingInputSpec
@@ -587,18 +568,14 @@ class RealignOutputSpec(TraitedSpec):
587
568
588
569
class Realign (SPMCommand ):
589
570
"""Use spm_realign for estimating within modality rigid body alignment
590
-
591
571
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=25
592
-
593
572
Examples
594
573
--------
595
-
596
574
>>> import nipype.interfaces.spm as spm
597
575
>>> realign = spm.Realign()
598
576
>>> realign.inputs.in_files = 'functional.nii'
599
577
>>> realign.inputs.register_to_mean = True
600
578
>>> realign.run() # doctest: +SKIP
601
-
602
579
"""
603
580
604
581
input_spec = RealignInputSpec
@@ -851,19 +828,15 @@ class RealignUnwarp(SPMCommand):
851
828
of time series. Function accepts only one single field map. If in_files is a
852
829
list of files they will be treated as separate sessions but associated to the
853
830
same fieldmap.
854
-
855
831
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=31
856
-
857
832
Examples
858
833
--------
859
-
860
834
>>> import nipype.interfaces.spm as spm
861
835
>>> realignUnwarp = spm.RealignUnwarp()
862
836
>>> realignUnwarp.inputs.in_files = ['functional.nii', 'functional2.nii']
863
837
>>> realignUnwarp.inputs.phase_map = 'voxeldisplacemap.vdm'
864
838
>>> realignUnwarp.inputs.register_to_mean = True
865
839
>>> realignUnwarp.run() # doctest: +SKIP
866
-
867
840
"""
868
841
869
842
input_spec = RealignUnwarpInputSpec
@@ -1028,18 +1001,14 @@ class CoregisterOutputSpec(TraitedSpec):
1028
1001
1029
1002
class Coregister (SPMCommand ):
1030
1003
"""Use spm_coreg for estimating cross-modality rigid body alignment
1031
-
1032
1004
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=39
1033
-
1034
1005
Examples
1035
1006
--------
1036
-
1037
1007
>>> import nipype.interfaces.spm as spm
1038
1008
>>> coreg = spm.Coregister()
1039
1009
>>> coreg.inputs.target = 'functional.nii'
1040
1010
>>> coreg.inputs.source = 'structural.nii'
1041
1011
>>> coreg.run() # doctest: +SKIP
1042
-
1043
1012
"""
1044
1013
1045
1014
input_spec = CoregisterInputSpec
@@ -1205,16 +1174,13 @@ class NormalizeOutputSpec(TraitedSpec):
1205
1174
1206
1175
class Normalize (SPMCommand ):
1207
1176
"""use spm_normalise for warping an image to a template
1208
-
1209
1177
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=203
1210
-
1211
1178
Examples
1212
1179
--------
1213
1180
>>> import nipype.interfaces.spm as spm
1214
1181
>>> norm = spm.Normalize()
1215
1182
>>> norm.inputs.source = 'functional.nii'
1216
1183
>>> norm.run() # doctest: +SKIP
1217
-
1218
1184
"""
1219
1185
1220
1186
input_spec = NormalizeInputSpec
@@ -1437,17 +1403,14 @@ class Normalize12(SPMCommand):
1437
1403
known as ``New Segment`` in SPM8). Note that the normalisation in SPM12
1438
1404
is done towards a file containing multiple tissue probability maps, which
1439
1405
was not the case in SPM8.
1440
-
1441
1406
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=49
1442
-
1443
1407
Examples
1444
1408
--------
1445
1409
>>> import nipype.interfaces.spm as spm
1446
1410
>>> norm12 = spm.Normalize12()
1447
1411
>>> norm12.inputs.image_to_align = 'structural.nii'
1448
1412
>>> norm12.inputs.apply_to_files = 'functional.nii'
1449
1413
>>> norm12.run() # doctest: +SKIP
1450
-
1451
1414
"""
1452
1415
1453
1416
input_spec = Normalize12InputSpec
@@ -1679,16 +1642,13 @@ class SegmentOutputSpec(TraitedSpec):
1679
1642
class Segment (SPMCommand ):
1680
1643
"""use spm_segment to separate structural images into different
1681
1644
tissue classes.
1682
-
1683
1645
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=209
1684
-
1685
1646
Examples
1686
1647
--------
1687
1648
>>> import nipype.interfaces.spm as spm
1688
1649
>>> seg = spm.Segment()
1689
1650
>>> seg.inputs.data = 'structural.nii'
1690
1651
>>> seg.run() # doctest: +SKIP
1691
-
1692
1652
"""
1693
1653
1694
1654
input_spec = SegmentInputSpec
@@ -1840,22 +1800,17 @@ class NewSegmentOutputSpec(TraitedSpec):
1840
1800
class NewSegment (SPMCommand ):
1841
1801
"""Use spm_preproc8 (New Segment) to separate structural images into
1842
1802
different tissue classes. Supports multiple modalities.
1843
-
1844
1803
NOTE: This interface currently supports single channel input only
1845
-
1846
1804
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=43
1847
-
1848
1805
Examples
1849
1806
--------
1850
1807
>>> import nipype.interfaces.spm as spm
1851
1808
>>> seg = spm.NewSegment()
1852
1809
>>> seg.inputs.channel_files = 'structural.nii'
1853
1810
>>> seg.inputs.channel_info = (0.0001, 60, (True, True))
1854
1811
>>> seg.run() # doctest: +SKIP
1855
-
1856
1812
For VBM pre-processing [http://www.fil.ion.ucl.ac.uk/~john/misc/VBMclass10.pdf],
1857
1813
TPM.nii should be replaced by /path/to/spm8/toolbox/Seg/TPM.nii
1858
-
1859
1814
>>> seg = NewSegment()
1860
1815
>>> seg.inputs.channel_files = 'structural.nii'
1861
1816
>>> tissue1 = (('TPM.nii', 1), 2, (True,True), (False, False))
@@ -1865,7 +1820,6 @@ class NewSegment(SPMCommand):
1865
1820
>>> tissue5 = (('TPM.nii', 5), 2, (False,False), (False, False))
1866
1821
>>> seg.inputs.tissues = [tissue1, tissue2, tissue3, tissue4, tissue5]
1867
1822
>>> seg.run() # doctest: +SKIP
1868
-
1869
1823
"""
1870
1824
1871
1825
input_spec = NewSegmentInputSpec
@@ -2088,19 +2042,15 @@ class MultiChannelNewSegmentOutputSpec(TraitedSpec):
2088
2042
class MultiChannelNewSegment (SPMCommand ):
2089
2043
"""Use spm_preproc8 (New Segment) to separate structural images into
2090
2044
different tissue classes. Supports multiple modalities and multichannel inputs.
2091
-
2092
2045
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=45
2093
-
2094
2046
Examples
2095
2047
--------
2096
2048
>>> import nipype.interfaces.spm as spm
2097
2049
>>> seg = spm.MultiChannelNewSegment()
2098
2050
>>> seg.inputs.channels = [('structural.nii',(0.0001, 60, (True, True)))]
2099
2051
>>> seg.run() # doctest: +SKIP
2100
-
2101
2052
For VBM pre-processing [http://www.fil.ion.ucl.ac.uk/~john/misc/VBMclass10.pdf],
2102
2053
TPM.nii should be replaced by /path/to/spm8/toolbox/Seg/TPM.nii
2103
-
2104
2054
>>> seg = MultiChannelNewSegment()
2105
2055
>>> channel1= ('T1.nii',(0.0001, 60, (True, True)))
2106
2056
>>> channel2= ('T2.nii',(0.0001, 60, (True, True)))
@@ -2112,7 +2062,6 @@ class MultiChannelNewSegment(SPMCommand):
2112
2062
>>> tissue5 = (('TPM.nii', 5), 2, (False,False), (False, False))
2113
2063
>>> seg.inputs.tissues = [tissue1, tissue2, tissue3, tissue4, tissue5]
2114
2064
>>> seg.run() # doctest: +SKIP
2115
-
2116
2065
"""
2117
2066
2118
2067
input_spec = MultiChannelNewSegmentInputSpec
@@ -2270,9 +2219,7 @@ class SmoothOutputSpec(TraitedSpec):
2270
2219
2271
2220
class Smooth (SPMCommand ):
2272
2221
"""Use spm_smooth for 3D Gaussian smoothing of image volumes.
2273
-
2274
2222
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=55
2275
-
2276
2223
Examples
2277
2224
--------
2278
2225
>>> import nipype.interfaces.spm as spm
@@ -2345,12 +2292,10 @@ class DARTELInputSpec(SPMCommandInputSpec):
2345
2292
field = "warp.settings.param" ,
2346
2293
desc = """\
2347
2294
List of tuples for each iteration
2348
-
2349
2295
* Inner iterations
2350
2296
* Regularization parameters
2351
2297
* Time points for deformation model
2352
2298
* smoothing parameter
2353
-
2354
2299
""" ,
2355
2300
)
2356
2301
optimization_parameters = traits .Tuple (
@@ -2360,11 +2305,9 @@ class DARTELInputSpec(SPMCommandInputSpec):
2360
2305
field = "warp.settings.optim" ,
2361
2306
desc = """\
2362
2307
Optimization settings a tuple:
2363
-
2364
2308
* LM regularization
2365
2309
* cycles of multigrid solver
2366
2310
* relaxation iterations
2367
-
2368
2311
""" ,
2369
2312
)
2370
2313
@@ -2379,16 +2322,13 @@ class DARTELOutputSpec(TraitedSpec):
2379
2322
2380
2323
class DARTEL (SPMCommand ):
2381
2324
"""Use spm DARTEL to create a template and flow fields
2382
-
2383
2325
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=185
2384
-
2385
2326
Examples
2386
2327
--------
2387
2328
>>> import nipype.interfaces.spm as spm
2388
2329
>>> dartel = spm.DARTEL()
2389
2330
>>> dartel.inputs.image_files = [['rc1s1.nii','rc1s2.nii'],['rc2s1.nii', 'rc2s2.nii']]
2390
2331
>>> dartel.run() # doctest: +SKIP
2391
-
2392
2332
"""
2393
2333
2394
2334
input_spec = DARTELInputSpec
@@ -2503,9 +2443,7 @@ class DARTELNorm2MNIOutputSpec(TraitedSpec):
2503
2443
2504
2444
class DARTELNorm2MNI (SPMCommand ):
2505
2445
"""Use spm DARTEL to normalize data to MNI space
2506
-
2507
2446
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=188
2508
-
2509
2447
Examples
2510
2448
--------
2511
2449
>>> import nipype.interfaces.spm as spm
@@ -2515,7 +2453,6 @@ class DARTELNorm2MNI(SPMCommand):
2515
2453
>>> nm.inputs.apply_to_files = ['c1s1.nii', 'c1s3.nii']
2516
2454
>>> nm.inputs.modulate = True
2517
2455
>>> nm.run() # doctest: +SKIP
2518
-
2519
2456
"""
2520
2457
2521
2458
input_spec = DARTELNorm2MNIInputSpec
@@ -2598,17 +2535,14 @@ class CreateWarpedOutputSpec(TraitedSpec):
2598
2535
2599
2536
class CreateWarped (SPMCommand ):
2600
2537
"""Apply a flow field estimated by DARTEL to create warped images
2601
-
2602
2538
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=190
2603
-
2604
2539
Examples
2605
2540
--------
2606
2541
>>> import nipype.interfaces.spm as spm
2607
2542
>>> create_warped = spm.CreateWarped()
2608
2543
>>> create_warped.inputs.image_files = ['rc1s1.nii', 'rc1s2.nii']
2609
2544
>>> create_warped.inputs.flowfield_files = ['u_rc1s1_Template.nii', 'u_rc1s2_Template.nii']
2610
2545
>>> create_warped.run() # doctest: +SKIP
2611
-
2612
2546
"""
2613
2547
2614
2548
input_spec = CreateWarpedInputSpec
@@ -2890,7 +2824,6 @@ class VBMSegmentOuputSpec(TraitedSpec):
2890
2824
class VBMSegment (SPMCommand ):
2891
2825
"""Use VBM8 toolbox to separate structural images into different
2892
2826
tissue classes.
2893
-
2894
2827
Example
2895
2828
-------
2896
2829
>>> import nipype.interfaces.spm as spm
0 commit comments