@@ -2632,31 +2632,58 @@ class TShift(AFNICommand):
26322632 Examples
26332633 ========
26342634
2635+ Slice timing details may be specified explicitly via the ``slice_timing``
2636+ input:
2637+
26352638 >>> from nipype.interfaces import afni
2639+ >>> TR = 2.5
26362640 >>> tshift = afni.TShift()
26372641 >>> tshift.inputs.in_file = 'functional.nii'
2638- >>> tshift.inputs.tpattern = 'alt+z'
26392642 >>> tshift.inputs.tzero = 0.0
2643+ >>> tshift.inputs.tr = '%.1fs' % TR
2644+ >>> tshift.inputs.slice_timing = list(np.arange(40) / TR)
26402645 >>> tshift.cmdline
2641- '3dTshift -prefix functional_tshift -tpattern alt+z -tzero 0.0 functional.nii'
2642- >>> res = tshift.run() # doctest: +SKIP
2646+ '3dTshift -prefix functional_tshift -tpattern @slice_timing.1D -TR 2.5s -tzero 0.0 functional.nii'
26432647
2644- Slice timings may be explicitly specified:
2648+ This method creates a ``slice_timing.1D`` file to be passed to ``3dTshift``.
2649+ A pre-existing slice-timing file may be used in the same way:
26452650
2646- >>> TR = 2.5
26472651 >>> tshift = afni.TShift()
26482652 >>> tshift.inputs.in_file = 'functional.nii'
26492653 >>> tshift.inputs.tzero = 0.0
26502654 >>> tshift.inputs.tr = '%.1fs' % TR
2651- >>> tshift.inputs.slice_timing = list(np.arange(40) / TR)
2655+ >>> tshift.inputs.slice_timing = 'slice_timing.1D'
26522656 >>> tshift.cmdline
26532657 '3dTshift -prefix functional_tshift -tpattern @slice_timing.1D -TR 2.5s -tzero 0.0 functional.nii'
26542658
2655- This will create the ``slice_timing.1D`` file in the working directory.
2656- You may wish to remove this after running:
2659+ Alternatively, pre-specified slice timing patterns may be specified with the
2660+ ``tpattern`` input.
2661+ For example, to specify an alternating, ascending slice timing pattern:
26572662
2658- >>> os.unlink('slice_timing.1D')
2663+ >>> tshift = afni.TShift()
2664+ >>> tshift.inputs.in_file = 'functional.nii'
2665+ >>> tshift.inputs.tzero = 0.0
2666+ >>> tshift.inputs.tr = '%.1fs' % TR
2667+ >>> tshift.inputs.tpattern = 'alt+z'
2668+ >>> tshift.cmdline
2669+ '3dTshift -prefix functional_tshift -tpattern alt+z -TR 2.5s -tzero 0.0 functional.nii'
2670+
2671+ For backwards compatibility, ``tpattern`` may also take filenames prefixed
2672+ with ``@``.
2673+ However, in this case, filenames are not validated, so this usage will be
2674+ deprecated in future versions of Nipype.
2675+
2676+ >>> tshift = afni.TShift()
2677+ >>> tshift.inputs.in_file = 'functional.nii'
2678+ >>> tshift.inputs.tzero = 0.0
2679+ >>> tshift.inputs.tr = '%.1fs' % TR
2680+ >>> tshift.inputs.tpattern = '@slice_timing.1D'
2681+ >>> tshift.cmdline
2682+ '3dTshift -prefix functional_tshift -tpattern @slice_timing.1D -TR 2.5s -tzero 0.0 functional.nii'
2683+
2684+ In any configuration, the interface may be run as usual:
26592685
2686+ >>> res = tshift.run() # doctest: +SKIP
26602687 """
26612688 _cmd = '3dTshift'
26622689 input_spec = TShiftInputSpec
0 commit comments