@@ -1748,6 +1748,60 @@ class TCat(AFNICommand):
1748
1748
input_spec = TCatInputSpec
1749
1749
output_spec = AFNICommandOutputSpec
1750
1750
1751
+ class TCatSBInputSpec (AFNICommandInputSpec ):
1752
+ in_files = traits .List (
1753
+ traits .Tuple (File (exists = True ),Str ()),
1754
+ desc = 'List of tuples of file names and subbrick selectors as strings.'
1755
+ 'Don\' t forget to protect the single quotes in the subbrick selector'
1756
+ 'so the contents are protected from the command line interpreter.' ,
1757
+ argstr = '%s%s ...' ,
1758
+ position = - 1 ,
1759
+ mandatory = True ,
1760
+ copyfile = False )
1761
+ out_file = File (
1762
+ desc = 'output image file name' ,
1763
+ argstr = '-prefix %s' ,
1764
+ genfile = True )
1765
+ rlt = traits .Enum (
1766
+ '' , '+' , '++' ,
1767
+ argstr = '-rlt%s' ,
1768
+ desc = 'Remove linear trends in each voxel time series loaded from each '
1769
+ 'input dataset, SEPARATELY. Option -rlt removes the least squares '
1770
+ 'fit of \' a+b*t\' to each voxel time series. Option -rlt+ adds '
1771
+ 'dataset mean back in. Option -rlt++ adds overall mean of all '
1772
+ 'dataset timeseries back in.' ,
1773
+ position = 1 )
1774
+
1775
+
1776
+ class TCatSubBrick (AFNICommand ):
1777
+ """Hopefully a temporary function to allow sub-brick selection until
1778
+ afni file managment is improved.
1779
+
1780
+ For complete details, see the `3dTcat Documentation.
1781
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dTcat.html>`_
1782
+
1783
+ Examples
1784
+ ========
1785
+
1786
+ >>> from nipype.interfaces import afni
1787
+ >>> tcsb = afni.TCatSubBrick()
1788
+ >>> tcsb.inputs.in_files = [('functional.nii', "'{2..$}'"), ('functional2.nii', "'{2..$}'")]
1789
+ >>> tcsb.inputs.out_file= 'functional_tcat.nii'
1790
+ >>> tcsb.inputs.rlt = '+'
1791
+ >>> tcsb.cmdline # doctest: +ALLOW_UNICODE +NORMALIZE_WHITESPACE
1792
+ "3dTcat -rlt+ -prefix functional_tcat.nii functional.nii'{2..$}' functional2.nii'{2..$}' "
1793
+ >>> res = tcsb.run() # doctest: +SKIP
1794
+
1795
+ """
1796
+
1797
+ _cmd = '3dTcat'
1798
+ input_spec = TCatSBInputSpec
1799
+ output_spec = AFNICommandOutputSpec
1800
+
1801
+ def _gen_filename (self , name ):
1802
+ if name == 'out_file' :
1803
+ return self ._gen_fname (self .inputs .in_files [0 ][0 ], suffix = '_tcat' )
1804
+
1751
1805
1752
1806
class TStatInputSpec (AFNICommandInputSpec ):
1753
1807
in_file = File (
0 commit comments