@@ -1441,3 +1441,165 @@ def _run_interface(self, runtime):
14411441
14421442 def _list_outputs (self ):
14431443 return {'out' : getattr (self , '_gcor' )}
1444+
1445+ class ZcatInputSpec (AFNICommandInputSpec ):
1446+ in_files = InputMultiPath (
1447+ File (
1448+ desc = 'input files to 3dZcat' ,
1449+ exists = True ),
1450+ argstr = '%s' ,
1451+ position = - 1 ,
1452+ mandatory = True ,
1453+ copyfile = False )
1454+ out_file = File (
1455+ name_template = 'zcat' ,
1456+ desc = 'output dataset prefix name (default \' zcat\' )' ,
1457+ argstr = '-prefix %s' )
1458+ datum = traits .Enum (
1459+ 'byte' ,'short' ,'float' ,
1460+ argstr = '-datum %s' ,
1461+ desc = 'specify data type for output. Valid types are \' byte\' , '
1462+ '\' short\' and \' float\' .' )
1463+ verb = traits .Bool (
1464+ desc = 'print out some verbositiness as the program proceeds.' ,
1465+ argstr = '-verb' )
1466+ fscale = traits .Bool (
1467+ desc = 'Force scaling of the output to the maximum integer '
1468+ 'range. This only has effect if the output datum is '
1469+ 'byte or short (either forced or defaulted). This '
1470+ 'option is sometimes necessary to eliminate '
1471+ 'unpleasant truncation artifacts.' ,
1472+ argstr = '-fscale' ,
1473+ xor = ['nscale' ])
1474+ nscale = traits .Bool (
1475+ desc = 'Don\' t do any scaling on output to byte or short '
1476+ 'datasets. This may be especially useful when '
1477+ 'operating on mask datasets whose output values '
1478+ 'are only 0\' s and 1\' s.' ,
1479+ argstr = '-nscale' ,
1480+ xor = ['fscale' ])
1481+
1482+ class Zcat (AFNICommand ):
1483+ """Copies an image of one type to an image of the same
1484+ or different type using 3dZcat command
1485+
1486+ For complete details, see the `3dZcat Documentation.
1487+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dZcat.html>`_
1488+
1489+ Examples
1490+ ========
1491+
1492+ >>> from nipype.interfaces import afni
1493+ >>> zcat = afni.Zcat()
1494+ >>> zcat.inputs.in_files = ['functional2.nii', 'functional3.nii']
1495+ >>> zcat.inputs.out_file = 'cat_functional.nii'
1496+ >>> zcat.cmdline # doctest: +ALLOW_UNICODE
1497+ '3dZcat -prefix cat_functional.nii functional2.nii functional3.nii'
1498+ >>> res = zcat.run() # doctest: +SKIP
1499+ """
1500+
1501+ _cmd = '3dZcat'
1502+ input_spec = ZcatInputSpec
1503+ output_spec = AFNICommandOutputSpec
1504+
1505+ class ZeropadInputSpec (AFNICommandInputSpec ):
1506+ in_files = File (
1507+ desc = 'input dataset' ,
1508+ argstr = '%s' ,
1509+ position = - 1 ,
1510+ mandatory = True ,
1511+ exists = True ,
1512+ copyfile = False )
1513+ out_file = File (
1514+ name_template = 'zeropad' ,
1515+ desc = 'output dataset prefix name (default \' zeropad\' )' ,
1516+ argstr = '-prefix %s' )
1517+ I = traits .Int (
1518+ desc = 'adds \' n\' planes of zero at the Inferior edge' ,
1519+ argstr = '-I %i' ,
1520+ xor = ['master' ])
1521+ S = traits .Int (
1522+ desc = 'adds \' n\' planes of zero at the Superior edge' ,
1523+ argstr = '-S %i' ,
1524+ xor = ['master' ])
1525+ A = traits .Int (
1526+ desc = 'adds \' n\' planes of zero at the Anterior edge' ,
1527+ argstr = '-A %i' ,
1528+ xor = ['master' ])
1529+ P = traits .Int (
1530+ desc = 'adds \' n\' planes of zero at the Posterior edge' ,
1531+ argstr = '-P %i' ,
1532+ xor = ['master' ])
1533+ L = traits .Int (
1534+ desc = 'adds \' n\' planes of zero at the Left edge' ,
1535+ argstr = '-L %i' ,
1536+ xor = ['master' ])
1537+ R = traits .Int (
1538+ desc = 'adds \' n\' planes of zero at the Right edge' ,
1539+ argstr = '-R %i' ,
1540+ xor = ['master' ])
1541+ z = traits .Int (
1542+ desc = 'adds \' n\' planes of zero on EACH of the '
1543+ 'dataset z-axis (slice-direction) faces' ,
1544+ argstr = '-z %i' ,
1545+ xor = ['master' ])
1546+ RL = traits .Int (desc = 'specify that planes should be added or cut '
1547+ 'symmetrically to make the resulting volume have'
1548+ 'N slices in the right-left direction' ,
1549+ argstr = '-RL %i' ,
1550+ xor = ['master' ])
1551+ AP = traits .Int (desc = 'specify that planes should be added or cut '
1552+ 'symmetrically to make the resulting volume have'
1553+ 'N slices in the anterior-posterior direction' ,
1554+ argstr = '-AP %i' ,
1555+ xor = ['master' ])
1556+ IS = traits .Int (desc = 'specify that planes should be added or cut '
1557+ 'symmetrically to make the resulting volume have'
1558+ 'N slices in the inferior-superior direction' ,
1559+ argstr = '-IS %i' ,
1560+ xor = ['master' ])
1561+ mm = traits .Bool (desc = 'pad counts \' n\' are in mm instead of slices, '
1562+ 'where each \' n\' is an integer and at least \' n\' '
1563+ 'mm of slices will be added/removed; e.g., n = 3 '
1564+ 'and slice thickness = 2.5 mm ==> 2 slices added' ,
1565+ argstr = '-mm' ,
1566+ xor = ['master' ])
1567+ master = traits .File (desc = 'match the volume described in dataset '
1568+ '\' mset\' , where mset must have the same '
1569+ 'orientation and grid spacing as dataset to be '
1570+ 'padded. the goal of -master is to make the '
1571+ 'output dataset from 3dZeropad match the '
1572+ 'spatial \' extents\' of mset by adding or '
1573+ 'subtracting slices as needed. You can\' t use '
1574+ '-I,-S,..., or -mm with -master' ,
1575+ argstr = '-master %s' ,
1576+ xor = ['I' , 'S' , 'A' , 'P' , 'L' , 'R' , 'z' ,
1577+ 'RL' , 'AP' , 'IS' , 'mm' ])
1578+
1579+ class Zeropad (AFNICommand ):
1580+ """Adds planes of zeros to a dataset (i.e., pads it out).
1581+
1582+ For complete details, see the `3dZeropad Documentation.
1583+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dZeropad.html>`_
1584+
1585+ Examples
1586+ ========
1587+
1588+ >>> from nipype.interfaces import afni
1589+ >>> zeropad = afni.Zeropad()
1590+ >>> zeropad.inputs.in_files = 'functional.nii'
1591+ >>> zeropad.inputs.out_file = 'pad_functional.nii'
1592+ >>> zeropad.inputs.I = 10
1593+ >>> zeropad.inputs.S = 10
1594+ >>> zeropad.inputs.A = 10
1595+ >>> zeropad.inputs.P = 10
1596+ >>> zeropad.inputs.R = 10
1597+ >>> zeropad.inputs.L = 10
1598+ >>> zeropad.cmdline # doctest: +ALLOW_UNICODE
1599+ '3dZeropad -A 10 -I 10 -L 10 -P 10 -R 10 -S 10 -prefix pad_functional.nii functional.nii'
1600+ >>> res = zeropad.run() # doctest: +SKIP
1601+ """
1602+
1603+ _cmd = '3dZeropad'
1604+ input_spec = ZeropadInputSpec
1605+ output_spec = AFNICommandOutputSpec
0 commit comments