interfaces.c3¶
C3d¶
Wraps the executable command c3d
.
Convert3d is a command-line tool for converting 3D (or 4D) images between common file formats. The tool also includes a growing list of commands for image manipulation, such as thresholding and resampling. The tool can also be used to obtain information about image files. More information on Convert3d can be found at: https://sourceforge.net/p/c3d/git/ci/master/tree/doc/c3d.md
Example¶
>>> from nipype.interfaces.c3 import C3d
>>> c3 = C3d()
>>> c3.inputs.in_file = "T1.nii"
>>> c3.inputs.pix_type = "short"
>>> c3.inputs.out_file = "T1.img"
>>> c3.cmdline
'c3d T1.nii -type short -o T1.img'
>>> c3.inputs.is_4d = True
>>> c3.inputs.in_file = "epi.nii"
>>> c3.inputs.out_file = "epi.img"
>>> c3.cmdline
'c4d epi.nii -type short -o epi.img'
Inputs:
[Mandatory]
in_file: (a list of items which are a file name)
Input file (wildcard and multiple are supported).
argument: ``%s``, position: 1
[Optional]
is_4d: (a boolean, nipype default value: False)
Changes command to support 4D file operations (default is false).
scale: (an integer (int or long) or a float)
Multiplies the intensity of each voxel in the last image on the
stack by the given factor.
argument: ``-scale %s``
out_file: (a file name)
Output file of last image on the stack.
argument: ``-o %s``, position: -1
mutually_exclusive: out_files
shift: (an integer (int or long) or a float)
Adds the given constant to every voxel.
argument: ``-shift %s``
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
interp: (u'Linear' or u'NearestNeighbor' or u'Cubic' or u'Sinc' or
u'Gaussian')
Specifies the interpolation used with -resample and other commands.
Default is Linear.
argument: ``-interpolation %s``
multicomp_split: (a boolean, nipype default value: False)
Enable reading of multi-component images.
argument: ``-mcr``, position: 0
environ: (a dictionary with keys which are a newbytes or None or a
newstr or None and with values which are a newbytes or None or a
newstr or None, nipype default value: {})
Environment variables
smooth: (a unicode string)
Applies Gaussian smoothing to the image. The parameter vector
specifies the standard deviation of the Gaussian kernel.
argument: ``-smooth %s``
resample: (a unicode string)
Resamples the image, keeping the bounding box the same, but changing
the number of voxels in the image. The dimensions can be specified
as a percentage, for example to double the number of voxels in each
direction. The -interpolation flag affects how sampling is
performed.
argument: ``-resample %s``
out_files: (a list of items which are a file name)
Write all images on the convert3d stack as multiple files. Supports
both list of output files or a pattern for the output filenames
(using %d substituion).
argument: ``-oo %s``, position: -1
mutually_exclusive: out_file
pix_type: (u'float' or u'char' or u'uchar' or u'short' or u'ushort'
or u'int' or u'uint' or u'double')
Specifies the pixel type for the output image. By default, images
are written in floating point (float) format
argument: ``-type %s``
Outputs:
out_files: (a list of items which are a file name)
C3dAffineTool¶
Wraps the executable command c3d_affine_tool
.
Converts fsl-style Affine registration into ANTS compatible itk format
Example¶
>>> from nipype.interfaces.c3 import C3dAffineTool
>>> c3 = C3dAffineTool()
>>> c3.inputs.source_file = 'cmatrix.mat'
>>> c3.inputs.itk_transform = 'affine.txt'
>>> c3.inputs.fsl2ras = True
>>> c3.cmdline
'c3d_affine_tool -src cmatrix.mat -fsl2ras -oitk affine.txt'
Inputs:
[Optional]
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
fsl2ras: (a boolean)
argument: ``-fsl2ras``, position: 4
source_file: (an existing file name)
argument: ``-src %s``, position: 2
environ: (a dictionary with keys which are a newbytes or None or a
newstr or None and with values which are a newbytes or None or a
newstr or None, nipype default value: {})
Environment variables
reference_file: (an existing file name)
argument: ``-ref %s``, position: 1
transform_file: (an existing file name)
argument: ``%s``, position: 3
itk_transform: (a boolean or a file name)
Export ITK transform.
argument: ``-oitk %s``, position: 5
Outputs:
itk_transform: (an existing file name)