@@ -1534,3 +1534,165 @@ def _run_interface(self, runtime):
1534
1534
1535
1535
def _list_outputs (self ):
1536
1536
return {'out' : getattr (self , '_gcor' )}
1537
+
1538
+ class ZcatInputSpec (AFNICommandInputSpec ):
1539
+ in_files = InputMultiPath (
1540
+ File (
1541
+ desc = 'input files to 3dZcat' ,
1542
+ exists = True ),
1543
+ argstr = '%s' ,
1544
+ position = - 1 ,
1545
+ mandatory = True ,
1546
+ copyfile = False )
1547
+ out_file = File (
1548
+ name_template = 'zcat' ,
1549
+ desc = 'output dataset prefix name (default \' zcat\' )' ,
1550
+ argstr = '-prefix %s' )
1551
+ datum = traits .Enum (
1552
+ 'byte' ,'short' ,'float' ,
1553
+ argstr = '-datum %s' ,
1554
+ desc = 'specify data type for output. Valid types are \' byte\' , '
1555
+ '\' short\' and \' float\' .' )
1556
+ verb = traits .Bool (
1557
+ desc = 'print out some verbositiness as the program proceeds.' ,
1558
+ argstr = '-verb' )
1559
+ fscale = traits .Bool (
1560
+ desc = 'Force scaling of the output to the maximum integer '
1561
+ 'range. This only has effect if the output datum is '
1562
+ 'byte or short (either forced or defaulted). This '
1563
+ 'option is sometimes necessary to eliminate '
1564
+ 'unpleasant truncation artifacts.' ,
1565
+ argstr = '-fscale' ,
1566
+ xor = ['nscale' ])
1567
+ nscale = traits .Bool (
1568
+ desc = 'Don\' t do any scaling on output to byte or short '
1569
+ 'datasets. This may be especially useful when '
1570
+ 'operating on mask datasets whose output values '
1571
+ 'are only 0\' s and 1\' s.' ,
1572
+ argstr = '-nscale' ,
1573
+ xor = ['fscale' ])
1574
+
1575
+ class Zcat (AFNICommand ):
1576
+ """Copies an image of one type to an image of the same
1577
+ or different type using 3dZcat command
1578
+
1579
+ For complete details, see the `3dZcat Documentation.
1580
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dZcat.html>`_
1581
+
1582
+ Examples
1583
+ ========
1584
+
1585
+ >>> from nipype.interfaces import afni
1586
+ >>> zcat = afni.Zcat()
1587
+ >>> zcat.inputs.in_files = ['functional2.nii', 'functional3.nii']
1588
+ >>> zcat.inputs.out_file = 'cat_functional.nii'
1589
+ >>> zcat.cmdline # doctest: +ALLOW_UNICODE
1590
+ '3dZcat -prefix cat_functional.nii functional2.nii functional3.nii'
1591
+ >>> res = zcat.run() # doctest: +SKIP
1592
+ """
1593
+
1594
+ _cmd = '3dZcat'
1595
+ input_spec = ZcatInputSpec
1596
+ output_spec = AFNICommandOutputSpec
1597
+
1598
+ class ZeropadInputSpec (AFNICommandInputSpec ):
1599
+ in_files = File (
1600
+ desc = 'input dataset' ,
1601
+ argstr = '%s' ,
1602
+ position = - 1 ,
1603
+ mandatory = True ,
1604
+ exists = True ,
1605
+ copyfile = False )
1606
+ out_file = File (
1607
+ name_template = 'zeropad' ,
1608
+ desc = 'output dataset prefix name (default \' zeropad\' )' ,
1609
+ argstr = '-prefix %s' )
1610
+ I = traits .Int (
1611
+ desc = 'adds \' n\' planes of zero at the Inferior edge' ,
1612
+ argstr = '-I %i' ,
1613
+ xor = ['master' ])
1614
+ S = traits .Int (
1615
+ desc = 'adds \' n\' planes of zero at the Superior edge' ,
1616
+ argstr = '-S %i' ,
1617
+ xor = ['master' ])
1618
+ A = traits .Int (
1619
+ desc = 'adds \' n\' planes of zero at the Anterior edge' ,
1620
+ argstr = '-A %i' ,
1621
+ xor = ['master' ])
1622
+ P = traits .Int (
1623
+ desc = 'adds \' n\' planes of zero at the Posterior edge' ,
1624
+ argstr = '-P %i' ,
1625
+ xor = ['master' ])
1626
+ L = traits .Int (
1627
+ desc = 'adds \' n\' planes of zero at the Left edge' ,
1628
+ argstr = '-L %i' ,
1629
+ xor = ['master' ])
1630
+ R = traits .Int (
1631
+ desc = 'adds \' n\' planes of zero at the Right edge' ,
1632
+ argstr = '-R %i' ,
1633
+ xor = ['master' ])
1634
+ z = traits .Int (
1635
+ desc = 'adds \' n\' planes of zero on EACH of the '
1636
+ 'dataset z-axis (slice-direction) faces' ,
1637
+ argstr = '-z %i' ,
1638
+ xor = ['master' ])
1639
+ RL = traits .Int (desc = 'specify that planes should be added or cut '
1640
+ 'symmetrically to make the resulting volume have'
1641
+ 'N slices in the right-left direction' ,
1642
+ argstr = '-RL %i' ,
1643
+ xor = ['master' ])
1644
+ AP = traits .Int (desc = 'specify that planes should be added or cut '
1645
+ 'symmetrically to make the resulting volume have'
1646
+ 'N slices in the anterior-posterior direction' ,
1647
+ argstr = '-AP %i' ,
1648
+ xor = ['master' ])
1649
+ IS = traits .Int (desc = 'specify that planes should be added or cut '
1650
+ 'symmetrically to make the resulting volume have'
1651
+ 'N slices in the inferior-superior direction' ,
1652
+ argstr = '-IS %i' ,
1653
+ xor = ['master' ])
1654
+ mm = traits .Bool (desc = 'pad counts \' n\' are in mm instead of slices, '
1655
+ 'where each \' n\' is an integer and at least \' n\' '
1656
+ 'mm of slices will be added/removed; e.g., n = 3 '
1657
+ 'and slice thickness = 2.5 mm ==> 2 slices added' ,
1658
+ argstr = '-mm' ,
1659
+ xor = ['master' ])
1660
+ master = traits .File (desc = 'match the volume described in dataset '
1661
+ '\' mset\' , where mset must have the same '
1662
+ 'orientation and grid spacing as dataset to be '
1663
+ 'padded. the goal of -master is to make the '
1664
+ 'output dataset from 3dZeropad match the '
1665
+ 'spatial \' extents\' of mset by adding or '
1666
+ 'subtracting slices as needed. You can\' t use '
1667
+ '-I,-S,..., or -mm with -master' ,
1668
+ argstr = '-master %s' ,
1669
+ xor = ['I' , 'S' , 'A' , 'P' , 'L' , 'R' , 'z' ,
1670
+ 'RL' , 'AP' , 'IS' , 'mm' ])
1671
+
1672
+ class Zeropad (AFNICommand ):
1673
+ """Adds planes of zeros to a dataset (i.e., pads it out).
1674
+
1675
+ For complete details, see the `3dZeropad Documentation.
1676
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dZeropad.html>`_
1677
+
1678
+ Examples
1679
+ ========
1680
+
1681
+ >>> from nipype.interfaces import afni
1682
+ >>> zeropad = afni.Zeropad()
1683
+ >>> zeropad.inputs.in_files = 'functional.nii'
1684
+ >>> zeropad.inputs.out_file = 'pad_functional.nii'
1685
+ >>> zeropad.inputs.I = 10
1686
+ >>> zeropad.inputs.S = 10
1687
+ >>> zeropad.inputs.A = 10
1688
+ >>> zeropad.inputs.P = 10
1689
+ >>> zeropad.inputs.R = 10
1690
+ >>> zeropad.inputs.L = 10
1691
+ >>> zeropad.cmdline # doctest: +ALLOW_UNICODE
1692
+ '3dZeropad -A 10 -I 10 -L 10 -P 10 -R 10 -S 10 -prefix pad_functional.nii functional.nii'
1693
+ >>> res = zeropad.run() # doctest: +SKIP
1694
+ """
1695
+
1696
+ _cmd = '3dZeropad'
1697
+ input_spec = ZeropadInputSpec
1698
+ output_spec = AFNICommandOutputSpec
0 commit comments