interfaces.fsl.utils

AvScale

Link to code

Wraps the executable command avscale.

Use FSL avscale command to extract info from mat file output of FLIRT

Examples

>>> avscale = AvScale()
>>> avscale.inputs.mat_file = 'flirt.mat'
>>> res = avscale.run()  

Inputs:

[Optional]
all_param: (a boolean)
        argument: ``--allparams``
mat_file: (an existing file name)
        mat file to read
        argument: ``%s``, position: -2
ref_file: (an existing file name)
        reference file to get center of rotation
        argument: ``%s``, position: -1
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

rotation_translation_matrix: (a list of items which are a list of
          items which are a float)
        Rotation and Translation Matrix
scales: (a list of items which are a float)
        Scales (x,y,z)
skews: (a list of items which are a float)
        Skews
average_scaling: (a float)
        Average Scaling
determinant: (a float)
        Determinant
forward_half_transform: (a list of items which are a list of items
          which are a float)
        Forward Half Transform
backward_half_transform: (a list of items which are a list of items
          which are a float)
        Backwards Half Transform
left_right_orientation_preserved: (a boolean)
        True if LR orientation preserved
rot_angles: (a list of items which are a float)
        rotation angles
translations: (a list of items which are a float)
        translations

Complex

Link to code

Wraps the executable command fslcomplex.

fslcomplex is a tool for converting complex data

Examples

>>> cplx = Complex()
>>> cplx.inputs.complex_in_file = "complex.nii"
>>> cplx.real_polar = True
>>> res = cplx.run() 

Inputs:

[Optional]
complex_in_file: (an existing file name)
        argument: ``%s``, position: 2
complex_in_file2: (an existing file name)
        argument: ``%s``, position: 3
real_in_file: (an existing file name)
        argument: ``%s``, position: 2
imaginary_in_file: (an existing file name)
        argument: ``%s``, position: 3
magnitude_in_file: (an existing file name)
        argument: ``%s``, position: 2
phase_in_file: (an existing file name)
        argument: ``%s``, position: 3
complex_out_file: (a file name)
        argument: ``%s``, position: -3
        mutually_exclusive: complex_out_file, magnitude_out_file,
          phase_out_file, real_out_file, imaginary_out_file, real_polar,
          real_cartesian
magnitude_out_file: (a file name)
        argument: ``%s``, position: -4
        mutually_exclusive: complex_out_file, real_out_file,
          imaginary_out_file, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
phase_out_file: (a file name)
        argument: ``%s``, position: -3
        mutually_exclusive: complex_out_file, real_out_file,
          imaginary_out_file, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
real_out_file: (a file name)
        argument: ``%s``, position: -4
        mutually_exclusive: complex_out_file, magnitude_out_file,
          phase_out_file, real_polar, complex_cartesian, complex_polar,
          complex_split, complex_merge
imaginary_out_file: (a file name)
        argument: ``%s``, position: -3
        mutually_exclusive: complex_out_file, magnitude_out_file,
          phase_out_file, real_polar, complex_cartesian, complex_polar,
          complex_split, complex_merge
start_vol: (an integer (int or long))
        argument: ``%d``, position: -2
end_vol: (an integer (int or long))
        argument: ``%d``, position: -1
real_polar: (a boolean)
        argument: ``-realpolar``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
real_cartesian: (a boolean)
        argument: ``-realcartesian``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
complex_cartesian: (a boolean)
        argument: ``-complex``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
complex_polar: (a boolean)
        argument: ``-complexpolar``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
complex_split: (a boolean)
        argument: ``-complexsplit``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge
complex_merge: (a boolean)
        argument: ``-complexmerge``, position: 1
        mutually_exclusive: real_polar, real_cartesian, complex_cartesian,
          complex_polar, complex_split, complex_merge, start_vol, end_vol
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

magnitude_out_file: (a file name)
phase_out_file: (a file name)
real_out_file: (a file name)
imaginary_out_file: (a file name)
complex_out_file: (a file name)

References:

None

ConvertWarp

Link to code

Wraps the executable command convertwarp.

Use FSL convertwarp for combining multiple transforms into one.

Examples

>>> from nipype.interfaces.fsl import ConvertWarp
>>> warputils = ConvertWarp()
>>> warputils.inputs.warp1 = "warpfield.nii"
>>> warputils.inputs.reference = "T1.nii"
>>> warputils.inputs.relwarp = True
>>> warputils.inputs.output_type = "NIFTI_GZ"
>>> warputils.cmdline 
'convertwarp --ref=T1.nii --rel --warp1=warpfield.nii --out=T1_concatwarp.nii.gz'
>>> res = warputils.run() 

Inputs:

[Mandatory]
reference: (an existing file name)
        Name of a file in target space of the full transform.
        argument: ``--ref=%s``, position: 1

[Optional]
out_file: (a file name)
        Name of output file, containing warps that are the combination of
        all those given as arguments. The format of this will be a field-
        file (rather than spline coefficients) with any affine components
        included.
        argument: ``--out=%s``, position: -1
premat: (an existing file name)
        filename for pre-transform (affine matrix)
        argument: ``--premat=%s``
warp1: (an existing file name)
        Name of file containing initial warp-fields/coefficients (follows
        premat). This could e.g. be a fnirt-transform from a subjects
        structural scan to an average of a group of subjects.
        argument: ``--warp1=%s``
midmat: (an existing file name)
        Name of file containing mid-warp-affine transform
        argument: ``--midmat=%s``
warp2: (an existing file name)
        Name of file containing secondary warp-fields/coefficients (after
        warp1/midmat but before postmat). This could e.g. be a fnirt-
        transform from the average of a group of subjects to some standard
        space (e.g. MNI152).
        argument: ``--warp2=%s``
postmat: (an existing file name)
        Name of file containing an affine transform (applied last). It could
        e.g. be an affine transform that maps the MNI152-space into a better
        approximation to the Talairach-space (if indeed there is one).
        argument: ``--postmat=%s``
shift_in_file: (an existing file name)
        Name of file containing a "shiftmap", a non-linear transform with
        displacements only in one direction (applied first, before premat).
        This would typically be a fieldmap that has been pre-processed using
        fugue that maps a subjects functional (EPI) data onto an undistorted
        space (i.e. a space that corresponds to his/her true anatomy).
        argument: ``--shiftmap=%s``
shift_direction: ('y-' or 'y' or 'x' or 'x-' or 'z' or 'z-')
        Indicates the direction that the distortions from --shiftmap goes.
        It depends on the direction and polarity of the phase-encoding in
        the EPI sequence.
        argument: ``--shiftdir=%s``
        requires: shift_in_file
cons_jacobian: (a boolean)
        Constrain the Jacobian of the warpfield to lie within specified
        min/max limits.
        argument: ``--constrainj``
jacobian_min: (a float)
        Minimum acceptable Jacobian value for constraint (default 0.01)
        argument: ``--jmin=%f``
jacobian_max: (a float)
        Maximum acceptable Jacobian value for constraint (default 100.0)
        argument: ``--jmax=%f``
abswarp: (a boolean)
        If set it indicates that the warps in --warp1 and --warp2 should be
        interpreted as absolute. I.e. the values in --warp1/2 are the
        coordinates in the next space, rather than displacements. This flag
        is ignored if --warp1/2 was created by fnirt, which always creates
        relative displacements.
        argument: ``--abs``
        mutually_exclusive: relwarp
relwarp: (a boolean)
        If set it indicates that the warps in --warp1/2 should be
        interpreted as relative. I.e. the values in --warp1/2 are
        displacements from the coordinates in the next space.
        argument: ``--rel``
        mutually_exclusive: abswarp
out_abswarp: (a boolean)
        If set it indicates that the warps in --out should be absolute, i.e.
        the values in --out are displacements from the coordinates in --ref.
        argument: ``--absout``
        mutually_exclusive: out_relwarp
out_relwarp: (a boolean)
        If set it indicates that the warps in --out should be relative, i.e.
        the values in --out are displacements from the coordinates in --ref.
        argument: ``--relout``
        mutually_exclusive: out_abswarp
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        Name of output file, containing the warp as field or coefficients.

References:

None

ConvertXFM

Link to code

Wraps the executable command convert_xfm.

Use the FSL utility convert_xfm to modify FLIRT transformation matrices.

Examples

>>> import nipype.interfaces.fsl as fsl
>>> invt = fsl.ConvertXFM()
>>> invt.inputs.in_file = "flirt.mat"
>>> invt.inputs.invert_xfm = True
>>> invt.inputs.out_file = 'flirt_inv.mat'
>>> invt.cmdline
'convert_xfm -omat flirt_inv.mat -inverse flirt.mat'

Inputs:

[Mandatory]
in_file: (an existing file name)
        input transformation matrix
        argument: ``%s``, position: -1

[Optional]
in_file2: (an existing file name)
        second input matrix (for use with fix_scale_skew or concat_xfm)
        argument: ``%s``, position: -2
invert_xfm: (a boolean)
        invert input transformation
        argument: ``-inverse``, position: -3
        mutually_exclusive: invert_xfm, concat_xfm, fix_scale_skew
concat_xfm: (a boolean)
        write joint transformation of two input matrices
        argument: ``-concat``, position: -3
        mutually_exclusive: invert_xfm, concat_xfm, fix_scale_skew
        requires: in_file2
fix_scale_skew: (a boolean)
        use secondary matrix to fix scale and skew
        argument: ``-fixscaleskew``, position: -3
        mutually_exclusive: invert_xfm, concat_xfm, fix_scale_skew
        requires: in_file2
out_file: (a file name)
        final transformation matrix
        argument: ``-omat %s``, position: 1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        output transformation matrix

References:

None

CopyGeom

Link to code

Wraps the executable command fslcpgeom.

Use fslcpgeom to copy the header geometry information to another image. Copy certain parts of the header information (image dimensions, voxel dimensions, voxel dimensions units string, image orientation/origin or qform/sform info) from one image to another. Note that only copies from Analyze to Analyze or Nifti to Nifti will work properly. Copying from different files will result in loss of information or potentially incorrect settings.

Inputs:

[Mandatory]
in_file: (an existing file name)
        source image
        argument: ``%s``, position: 0
dest_file: (an existing file name)
        destination image
        argument: ``%s``, position: 1

[Optional]
ignore_dims: (a boolean)
        Do not copy image dimensions
        argument: ``-d``, position: -1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        image with new geometry header

References:

None

ExtractROI

Link to code

Wraps the executable command fslroi.

Uses FSL Fslroi command to extract region of interest (ROI) from an image.

You can a) take a 3D ROI from a 3D data set (or if it is 4D, the same ROI is taken from each time point and a new 4D data set is created), b) extract just some time points from a 4D data set, or c) control time and space limits to the ROI. Note that the arguments are minimum index and size (not maximum index). So to extract voxels 10 to 12 inclusive you would specify 10 and 3 (not 10 and 12).

Examples

>>> from nipype.interfaces.fsl import ExtractROI
>>> from nipype.testing import anatfile
>>> fslroi = ExtractROI(in_file=anatfile, roi_file='bar.nii', t_min=0,
...                     t_size=1)
>>> fslroi.cmdline == 'fslroi %s bar.nii 0 1' % anatfile
True

Inputs:

[Mandatory]
in_file: (an existing file name)
        input file
        argument: ``%s``, position: 0

[Optional]
roi_file: (a file name)
        output file
        argument: ``%s``, position: 1
x_min: (an integer (int or long))
        argument: ``%d``, position: 2
x_size: (an integer (int or long))
        argument: ``%d``, position: 3
y_min: (an integer (int or long))
        argument: ``%d``, position: 4
y_size: (an integer (int or long))
        argument: ``%d``, position: 5
z_min: (an integer (int or long))
        argument: ``%d``, position: 6
z_size: (an integer (int or long))
        argument: ``%d``, position: 7
t_min: (an integer (int or long))
        argument: ``%d``, position: 8
t_size: (an integer (int or long))
        argument: ``%d``, position: 9
crop_list: (a list of items which are a tuple of the form: (an
          integer (int or long), an integer (int or long)))
        list of two tuples specifying crop options
        argument: ``%s``, position: 2
        mutually_exclusive: x_min, x_size, y_min, y_size, z_min, z_size,
          t_min, t_size
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

roi_file: (an existing file name)

References:

None

FilterRegressor

Link to code

Wraps the executable command fsl_regfilt.

Data de-noising by regressing out part of a design matrix

Uses simple OLS regression on 4D images

Inputs:

[Mandatory]
in_file: (an existing file name)
        input file name (4D image)
        argument: ``-i %s``, position: 1
design_file: (an existing file name)
        name of the matrix with time courses (e.g. GLM design or MELODIC
        mixing matrix)
        argument: ``-d %s``, position: 3
filter_columns: (a list of items which are an integer (int or long))
        (1-based) column indices to filter out of the data
        argument: ``-f '%s'``, position: 4
        mutually_exclusive: filter_all
filter_all: (a boolean)
        use all columns in the design file in denoising
        argument: ``-f '%s'``, position: 4
        mutually_exclusive: filter_columns

[Optional]
out_file: (a file name)
        output file name for the filtered data
        argument: ``-o %s``, position: 2
mask: (an existing file name)
        mask image file name
        argument: ``-m %s``
var_norm: (a boolean)
        perform variance-normalization on data
        argument: ``--vn``
out_vnscales: (a boolean)
        output scaling factors for variance normalization
        argument: ``--out_vnscales``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        output file name for the filtered data

References:

None

ImageMaths

Link to code

Wraps the executable command fslmaths.

Use FSL fslmaths command to allow mathematical manipulation of images FSL info

Examples

>>> from nipype.interfaces import fsl
>>> from nipype.testing import anatfile
>>> maths = fsl.ImageMaths(in_file=anatfile, op_string= '-add 5',
...                        out_file='foo_maths.nii')
>>> maths.cmdline == 'fslmaths %s -add 5 foo_maths.nii' % anatfile
True

Inputs:

[Mandatory]
in_file: (an existing file name)
        argument: ``%s``, position: 1

[Optional]
in_file2: (an existing file name)
        argument: ``%s``, position: 3
mask_file: (an existing file name)
        use (following image>0) to mask current image
        argument: ``-mas %s``
out_file: (a file name)
        argument: ``%s``, position: -2
op_string: (a unicode string)
        string defining the operation, i. e. -add
        argument: ``%s``, position: 2
suffix: (a unicode string)
        out_file suffix
out_data_type: ('char' or 'short' or 'int' or 'float' or 'double' or
          'input')
        output datatype, one of (char, short, int, float, double, input)
        argument: ``-odt %s``, position: -1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)

References:

None

ImageMeants

Link to code

Wraps the executable command fslmeants.

Use fslmeants for printing the average timeseries (intensities) to the screen (or saves to a file). The average is taken over all voxels in the mask (or all voxels in the image if no mask is specified)

Inputs:

[Mandatory]
in_file: (an existing file name)
        input file for computing the average timeseries
        argument: ``-i %s``, position: 0

[Optional]
out_file: (a file name)
        name of output text matrix
        argument: ``-o %s``
mask: (an existing file name)
        input 3D mask
        argument: ``-m %s``
spatial_coord: (a list of items which are an integer (int or long))
        <x y z> requested spatial coordinate (instead of mask)
        argument: ``-c %s``
use_mm: (a boolean)
        use mm instead of voxel coordinates (for -c option)
        argument: ``--usemm``
show_all: (a boolean)
        show all voxel time series (within mask) instead of averaging
        argument: ``--showall``
eig: (a boolean)
        calculate Eigenvariate(s) instead of mean (output will have 0 mean)
        argument: ``--eig``
order: (an integer (int or long), nipype default value: 1)
        select number of Eigenvariates
        argument: ``--order=%d``
nobin: (a boolean)
        do not binarise the mask for calculation of Eigenvariates
        argument: ``--no_bin``
transpose: (a boolean)
        output results in transpose format (one row per voxel/mean)
        argument: ``--transpose``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        path/name of output text matrix

References:

None

ImageStats

Link to code

Wraps the executable command fslstats.

Use FSL fslstats command to calculate stats from images FSL info

Examples

>>> from nipype.interfaces.fsl import ImageStats
>>> from nipype.testing import funcfile
>>> stats = ImageStats(in_file=funcfile, op_string= '-M')
>>> stats.cmdline == 'fslstats %s -M'%funcfile
True

Inputs:

[Mandatory]
in_file: (an existing file name)
        input file to generate stats of
        argument: ``%s``, position: 2
op_string: (a unicode string)
        string defining the operation, options are applied in order, e.g. -M
        -l 10 -M will report the non-zero mean, apply a threshold and then
        report the new nonzero mean
        argument: ``%s``, position: 3

[Optional]
split_4d: (a boolean)
        give a separate output line for each 3D volume of a 4D timeseries
        argument: ``-t``, position: 1
mask_file: (an existing file name)
        mask file used for option -k %s
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_stat: (any value)
        stats output

References:

None

InvWarp

Link to code

Wraps the executable command invwarp.

Use FSL Invwarp to invert a FNIRT warp

Examples

>>> from nipype.interfaces.fsl import InvWarp
>>> invwarp = InvWarp()
>>> invwarp.inputs.warp = "struct2mni.nii"
>>> invwarp.inputs.reference = "anatomical.nii"
>>> invwarp.inputs.output_type = "NIFTI_GZ"
>>> invwarp.cmdline
'invwarp --out=struct2mni_inverse.nii.gz --ref=anatomical.nii --warp=struct2mni.nii'
>>> res = invwarp.run() 

Inputs:

[Mandatory]
warp: (an existing file name)
        Name of file containing warp-coefficients/fields. This would
        typically be the output from the --cout switch of fnirt (but can
        also use fields, like the output from --fout).
        argument: ``--warp=%s``
reference: (an existing file name)
        Name of a file in target space. Note that the target space is now
        different from the target space that was used to create the --warp
        file. It would typically be the file that was specified with the
        --in argument when running fnirt.
        argument: ``--ref=%s``

[Optional]
inverse_warp: (a file name)
        Name of output file, containing warps that are the "reverse" of
        those in --warp. This will be a field-file (rather than a file of
        spline coefficients), and it will have any affine component included
        as part of the displacements.
        argument: ``--out=%s``
absolute: (a boolean)
        If set it indicates that the warps in --warp should be interpreted
        as absolute, provided that it is not created by fnirt (which always
        uses relative warps). If set it also indicates that the output --out
        should be absolute.
        argument: ``--abs``
        mutually_exclusive: relative
relative: (a boolean)
        If set it indicates that the warps in --warp should be interpreted
        as relative. I.e. the values in --warp are displacements from the
        coordinates in the --ref space. If set it also indicates that the
        output --out should be relative.
        argument: ``--rel``
        mutually_exclusive: absolute
niter: (an integer (int or long))
        Determines how many iterations of the gradient-descent search that
        should be run.
        argument: ``--niter=%d``
regularise: (a float)
        Regularization strength (deafult=1.0).
        argument: ``--regularise=%f``
noconstraint: (a boolean)
        Do not apply Jacobian constraint
        argument: ``--noconstraint``
jacobian_min: (a float)
        Minimum acceptable Jacobian value for constraint (default 0.01)
        argument: ``--jmin=%f``
jacobian_max: (a float)
        Maximum acceptable Jacobian value for constraint (default 100.0)
        argument: ``--jmax=%f``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

inverse_warp: (an existing file name)
        Name of output file, containing warps that are the "reverse" of
        those in --warp.

References:

None

Merge

Link to code

Wraps the executable command fslmerge.

Use fslmerge to concatenate images

Images can be concatenated across time, x, y, or z dimensions. Across the time (t) dimension the TR is set by default to 1 sec.

Note: to set the TR to a different value, specify ‘t’ for dimension and specify the TR value in seconds for the tr input. The dimension will be automatically updated to ‘tr’.

Examples

>>> from nipype.interfaces.fsl import Merge
>>> merger = Merge()
>>> merger.inputs.in_files = ['functional2.nii', 'functional3.nii']
>>> merger.inputs.dimension = 't'
>>> merger.inputs.output_type = 'NIFTI_GZ'
>>> merger.cmdline
'fslmerge -t functional2_merged.nii.gz functional2.nii functional3.nii'
>>> merger.inputs.tr = 2.25
>>> merger.cmdline
'fslmerge -tr functional2_merged.nii.gz functional2.nii functional3.nii 2.25'

Inputs:

[Mandatory]
in_files: (a list of items which are an existing file name)
        argument: ``%s``, position: 2
dimension: ('t' or 'x' or 'y' or 'z' or 'a')
        dimension along which to merge, optionally set tr input when
        dimension is t
        argument: ``-%s``, position: 0

[Optional]
tr: (a float)
        use to specify TR in seconds (default is 1.00 sec), overrides
        dimension and sets it to tr
        argument: ``%.2f``, position: -1
merged_file: (a file name)
        argument: ``%s``, position: 1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

merged_file: (an existing file name)

References:

None

MotionOutliers

Link to code

Wraps the executable command fsl_motion_outliers.

Use FSL fsl_motion_outliers`http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLMotionOutliers`_ to find outliers in timeseries (4d) data. Examples ~~~~~~~~ >>> from nipype.interfaces.fsl import MotionOutliers >>> mo = MotionOutliers() >>> mo.inputs.in_file = “epi.nii” >>> mo.cmdline # doctest: +ELLIPSIS ‘fsl_motion_outliers -i epi.nii -o epi_outliers.txt -p epi_metrics.png -s epi_metrics.txt’ >>> res = mo.run() # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (an existing file name)
        unfiltered 4D image
        argument: ``-i %s``

[Optional]
out_file: (a file name)
        output outlier file name
        argument: ``-o %s``
mask: (an existing file name)
        mask image for calculating metric
        argument: ``-m %s``
metric: ('refrms' or 'dvars' or 'refmse' or 'fd' or 'fdrms')
        metrics: refrms - RMS intensity difference to reference volume as
        metric [default metric], refmse - Mean Square Error version of
        refrms (used in original version of fsl_motion_outliers), dvars -
        DVARS, fd - frame displacement, fdrms - FD with RMS matrix
        calculation
        argument: ``--%s``
threshold: (a float)
        specify absolute threshold value (otherwise use box-plot cutoff =
        P75 + 1.5*IQR)
        argument: ``--thresh=%g``
no_motion_correction: (a boolean)
        do not run motion correction (assumed already done)
        argument: ``--nomoco``
dummy: (an integer (int or long))
        number of dummy scans to delete (before running anything and
        creating EVs)
        argument: ``--dummy=%d``
out_metric_values: (a file name)
        output metric values (DVARS etc.) file name
        argument: ``-s %s``
out_metric_plot: (a file name)
        output metric values plot (DVARS etc.) file name
        argument: ``-p %s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
out_metric_values: (an existing file name)
out_metric_plot: (an existing file name)

References:

None

Overlay

Link to code

Wraps the executable command overlay.

Use FSL’s overlay command to combine background and statistical images
into one volume

Examples

>>> from nipype.interfaces import fsl
>>> combine = fsl.Overlay()
>>> combine.inputs.background_image = 'mean_func.nii.gz'
>>> combine.inputs.auto_thresh_bg = True
>>> combine.inputs.stat_image = 'zstat1.nii.gz'
>>> combine.inputs.stat_thresh = (3.5, 10)
>>> combine.inputs.show_negative_stats = True
>>> res = combine.run() 

Inputs:

[Mandatory]
background_image: (an existing file name)
        image to use as background
        argument: ``%s``, position: 4
auto_thresh_bg: (a boolean)
        automatically threshold the background image
        argument: ``-a``, position: 5
        mutually_exclusive: auto_thresh_bg, full_bg_range, bg_thresh
full_bg_range: (a boolean)
        use full range of background image
        argument: ``-A``, position: 5
        mutually_exclusive: auto_thresh_bg, full_bg_range, bg_thresh
bg_thresh: (a tuple of the form: (a float, a float))
        min and max values for background intensity
        argument: ``%.3f %.3f``, position: 5
        mutually_exclusive: auto_thresh_bg, full_bg_range, bg_thresh
stat_image: (an existing file name)
        statistical image to overlay in color
        argument: ``%s``, position: 6
stat_thresh: (a tuple of the form: (a float, a float))
        min and max values for the statistical overlay
        argument: ``%.2f %.2f``, position: 7

[Optional]
transparency: (a boolean, nipype default value: True)
        make overlay colors semi-transparent
        argument: ``%s``, position: 1
out_type: ('float' or 'int', nipype default value: float)
        write output with float or int
        argument: ``%s``, position: 2
use_checkerboard: (a boolean)
        use checkerboard mask for overlay
        argument: ``-c``, position: 3
show_negative_stats: (a boolean)
        display negative statistics in overlay
        argument: ``%s``, position: 8
        mutually_exclusive: stat_image2
stat_image2: (an existing file name)
        second statistical image to overlay in color
        argument: ``%s``, position: 9
        mutually_exclusive: show_negative_stats
stat_thresh2: (a tuple of the form: (a float, a float))
        min and max values for second statistical overlay
        argument: ``%.2f %.2f``, position: 10
out_file: (a file name)
        combined image volume
        argument: ``%s``, position: -1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        combined image volume

References:

None

PlotMotionParams

Link to code

Wraps the executable command fsl_tsplot.

Use fsl_tsplot to plot the estimated motion parameters from a realignment program.

Examples

>>> import nipype.interfaces.fsl as fsl
>>> plotter = fsl.PlotMotionParams()
>>> plotter.inputs.in_file = 'functional.par'
>>> plotter.inputs.in_source = 'fsl'
>>> plotter.inputs.plot_type = 'rotations'
>>> res = plotter.run() 

Notes

The ‘in_source’ attribute determines the order of columns that are expected in the source file. FSL prints motion parameters in the order rotations, translations, while SPM prints them in the opposite order. This interface should be able to plot timecourses of motion parameters generated from other sources as long as they fall under one of these two patterns. For more flexibilty, see the fsl.PlotTimeSeries interface.

Inputs:

[Mandatory]
in_file: (an existing file name or a list of items which are an
          existing file name)
        file with motion parameters
        argument: ``%s``, position: 1
in_source: ('spm' or 'fsl')
        which program generated the motion parameter file - fsl, spm
plot_type: ('rotations' or 'translations' or 'displacement')
        which motion type to plot - rotations, translations, displacement
        argument: ``%s``

[Optional]
plot_size: (a tuple of the form: (an integer (int or long), an
          integer (int or long)))
        plot image height and width
        argument: ``%s``
out_file: (a file name)
        image to write
        argument: ``-o %s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        image to write

References:

None

PlotTimeSeries

Link to code

Wraps the executable command fsl_tsplot.

Use fsl_tsplot to create images of time course plots.

Examples

>>> import nipype.interfaces.fsl as fsl
>>> plotter = fsl.PlotTimeSeries()
>>> plotter.inputs.in_file = 'functional.par'
>>> plotter.inputs.title = 'Functional timeseries'
>>> plotter.inputs.labels = ['run1', 'run2']
>>> plotter.run() 

Inputs:

[Mandatory]
in_file: (an existing file name or a list of items which are an
          existing file name)
        file or list of files with columns of timecourse information
        argument: ``%s``, position: 1

[Optional]
plot_start: (an integer (int or long))
        first column from in-file to plot
        argument: ``--start=%d``
        mutually_exclusive: plot_range
plot_finish: (an integer (int or long))
        final column from in-file to plot
        argument: ``--finish=%d``
        mutually_exclusive: plot_range
plot_range: (a tuple of the form: (an integer (int or long), an
          integer (int or long)))
        first and last columns from the in-file to plot
        argument: ``%s``
        mutually_exclusive: plot_start, plot_finish
title: (a unicode string)
        plot title
        argument: ``%s``
legend_file: (an existing file name)
        legend file
        argument: ``--legend=%s``
labels: (a unicode string or a list of items which are a unicode
          string)
        label or list of labels
        argument: ``%s``
y_min: (a float)
        minumum y value
        argument: ``--ymin=%.2f``
        mutually_exclusive: y_range
y_max: (a float)
        maximum y value
        argument: ``--ymax=%.2f``
        mutually_exclusive: y_range
y_range: (a tuple of the form: (a float, a float))
        min and max y axis values
        argument: ``%s``
        mutually_exclusive: y_min, y_max
x_units: (an integer (int or long), nipype default value: 1)
        scaling units for x-axis (between 1 and length of in file)
        argument: ``-u %d``
plot_size: (a tuple of the form: (an integer (int or long), an
          integer (int or long)))
        plot image height and width
        argument: ``%s``
x_precision: (an integer (int or long))
        precision of x-axis labels
        argument: ``--precision=%d``
sci_notation: (a boolean)
        switch on scientific notation
        argument: ``--sci``
out_file: (a file name)
        image to write
        argument: ``-o %s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        image to write

References:

None

PowerSpectrum

Link to code

Wraps the executable command fslpspec.

Use FSL PowerSpectrum command for power spectrum estimation.

Examples

>>> from nipype.interfaces import fsl
>>> pspec = fsl.PowerSpectrum()
>>> pspec.inputs.in_file = 'functional.nii'
>>> res = pspec.run() 

Inputs:

[Mandatory]
in_file: (an existing file name)
        input 4D file to estimate the power spectrum
        argument: ``%s``, position: 0

[Optional]
out_file: (a file name)
        name of output 4D file for power spectrum
        argument: ``%s``, position: 1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        path/name of the output 4D power spectrum file

References:

None

Reorient2Std

Link to code

Wraps the executable command fslreorient2std.

fslreorient2std is a tool for reorienting the image to match the approximate orientation of the standard template images (MNI152).

Examples

>>> reorient = Reorient2Std()
>>> reorient.inputs.in_file = "functional.nii"
>>> res = reorient.run() 

Inputs:

[Mandatory]
in_file: (an existing file name)
        argument: ``%s``

[Optional]
out_file: (a file name)
        argument: ``%s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)

References:

None

RobustFOV

Link to code

Wraps the executable command robustfov.

Automatically crops an image removing lower head and neck.

Interface is stable 5.0.0 to 5.0.9, but default brainsize changed from 150mm to 170mm.

Inputs:

[Mandatory]
in_file: (an existing file name)
        input filename
        argument: ``-i %s``, position: 0

[Optional]
out_roi: (a file name)
        ROI volume output name
        argument: ``-r %s``
brainsize: (an integer (int or long))
        size of brain in z-dimension (default 170mm/150mm)
        argument: ``-b %d``
out_transform: (a file name)
        Transformation matrix in_file to out_roi output name
        argument: ``-m %s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_roi: (an existing file name)
        ROI volume output name
out_transform: (an existing file name)
        Transformation matrix in_file to out_roi output name

References:

None

SigLoss

Link to code

Wraps the executable command sigloss.

Estimates signal loss from a field map (in rad/s)

Examples

>>> sigloss = SigLoss()
>>> sigloss.inputs.in_file = "phase.nii"
>>> sigloss.inputs.echo_time = 0.03
>>> res = sigloss.run() 

Inputs:

[Mandatory]
in_file: (an existing file name)
        b0 fieldmap file
        argument: ``-i %s``

[Optional]
out_file: (a file name)
        output signal loss estimate file
        argument: ``-s %s``
mask_file: (an existing file name)
        brain mask file
        argument: ``-m %s``
echo_time: (a float)
        echo time in seconds
        argument: ``--te=%f``
slice_direction: ('x' or 'y' or 'z')
        slicing direction
        argument: ``-d %s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        signal loss estimate file

References:

None

Slice

Link to code

Wraps the executable command fslslice.

Use fslslice to split a 3D file into lots of 2D files (along z-axis).

Examples

>>> from nipype.interfaces.fsl import Slice
>>> slice = Slice()
>>> slice.inputs.in_file = 'functional.nii'
>>> slice.inputs.out_base_name = 'sl'
>>> slice.cmdline
'fslslice functional.nii sl'

Inputs:

[Mandatory]
in_file: (an existing file name)
        input filename
        argument: ``%s``, position: 0

[Optional]
out_base_name: (a unicode string)
        outputs prefix
        argument: ``%s``, position: 1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_files: (a list of items which are an existing file name)

References:

None

Slicer

Link to code

Wraps the executable command slicer.

Use FSL’s slicer command to output a png image from a volume.

Examples

>>> from nipype.interfaces import fsl
>>> from nipype.testing import example_data
>>> slice = fsl.Slicer()
>>> slice.inputs.in_file = example_data('functional.nii')
>>> slice.inputs.all_axial = True
>>> slice.inputs.image_width = 750
>>> res = slice.run() 

Inputs:

[Mandatory]
in_file: (an existing file name)
        input volume
        argument: ``%s``, position: 1

[Optional]
image_edges: (an existing file name)
        volume to display edge overlay for (useful for checking registration
        argument: ``%s``, position: 2
label_slices: (a boolean, nipype default value: True)
        display slice number
        argument: ``-L``, position: 3
colour_map: (an existing file name)
        use different colour map from that stored in nifti header
        argument: ``-l %s``, position: 4
intensity_range: (a tuple of the form: (a float, a float))
        min and max intensities to display
        argument: ``-i %.3f %.3f``, position: 5
threshold_edges: (a float)
        use threshold for edges
        argument: ``-e %.3f``, position: 6
dither_edges: (a boolean)
        produce semi-transparent (dithered) edges
        argument: ``-t``, position: 7
nearest_neighbour: (a boolean)
        use nearest neighbor interpolation for output
        argument: ``-n``, position: 8
show_orientation: (a boolean, nipype default value: True)
        label left-right orientation
        argument: ``%s``, position: 9
single_slice: ('x' or 'y' or 'z')
        output picture of single slice in the x, y, or z plane
        argument: ``-%s``, position: 10
        mutually_exclusive: single_slice, middle_slices, all_axial,
          sample_axial
        requires: slice_number
slice_number: (an integer (int or long))
        slice number to save in picture
        argument: ``-%d``, position: 11
middle_slices: (a boolean)
        output picture of mid-sagittal, axial, and coronal slices
        argument: ``-a``, position: 10
        mutually_exclusive: single_slice, middle_slices, all_axial,
          sample_axial
all_axial: (a boolean)
        output all axial slices into one picture
        argument: ``-A``, position: 10
        mutually_exclusive: single_slice, middle_slices, all_axial,
          sample_axial
        requires: image_width
sample_axial: (an integer (int or long))
        output every n axial slices into one picture
        argument: ``-S %d``, position: 10
        mutually_exclusive: single_slice, middle_slices, all_axial,
          sample_axial
        requires: image_width
image_width: (an integer (int or long))
        max picture width
        argument: ``%d``, position: -2
out_file: (a file name)
        picture to write
        argument: ``%s``, position: -1
scaling: (a float)
        image scale
        argument: ``-s %f``, position: 0
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        picture to write

References:

None

Smooth

Link to code

Wraps the executable command fslmaths.

Use fslmaths to smooth the image

Examples

Setting the kernel width using sigma:

>>> sm = Smooth()
>>> sm.inputs.output_type = 'NIFTI_GZ'
>>> sm.inputs.in_file = 'functional2.nii'
>>> sm.inputs.sigma = 8.0
>>> sm.cmdline 
'fslmaths functional2.nii -kernel gauss 8.000 -fmean functional2_smooth.nii.gz'

Setting the kernel width using fwhm:

>>> sm = Smooth()
>>> sm.inputs.output_type = 'NIFTI_GZ'
>>> sm.inputs.in_file = 'functional2.nii'
>>> sm.inputs.fwhm = 8.0
>>> sm.cmdline 
'fslmaths functional2.nii -kernel gauss 3.397 -fmean functional2_smooth.nii.gz'

One of sigma or fwhm must be set:

>>> from nipype.interfaces.fsl import Smooth
>>> sm = Smooth()
>>> sm.inputs.output_type = 'NIFTI_GZ'
>>> sm.inputs.in_file = 'functional2.nii'
>>> sm.cmdline 
Traceback (most recent call last):
 ~~~
ValueError: Smooth requires a value for one of the inputs ...

Inputs:

[Mandatory]
in_file: (an existing file name)
        argument: ``%s``, position: 0
sigma: (a float)
        gaussian kernel sigma in mm (not voxels)
        argument: ``-kernel gauss %.03f -fmean``, position: 1
        mutually_exclusive: fwhm
fwhm: (a float)
        gaussian kernel fwhm, will be converted to sigma in mm (not voxels)
        argument: ``-kernel gauss %.03f -fmean``, position: 1
        mutually_exclusive: sigma

[Optional]
smoothed_file: (a file name)
        argument: ``%s``, position: 2
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

smoothed_file: (an existing file name)

References:

None

Split

Link to code

Wraps the executable command fslsplit.

Uses FSL Fslsplit command to separate a volume into images in time, x, y or z dimension.

Inputs:

[Mandatory]
in_file: (an existing file name)
        input filename
        argument: ``%s``, position: 0
dimension: ('t' or 'x' or 'y' or 'z')
        dimension along which the file will be split
        argument: ``-%s``, position: 2

[Optional]
out_base_name: (a unicode string)
        outputs prefix
        argument: ``%s``, position: 1
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_files: (a list of items which are an existing file name)

References:

None

SwapDimensions

Link to code

Wraps the executable command fslswapdim.

Use fslswapdim to alter the orientation of an image.

This interface accepts a three-tuple corresponding to the new orientation. You may either provide dimension ids in the form of (-)x, (-)y, or (-z), or nifti-syle dimension codes (RL, LR, AP, PA, IS, SI).

Inputs:

[Mandatory]
in_file: (an existing file name)
        input image
        argument: ``%s``, position: 1
new_dims: (a tuple of the form: ('x' or '-x' or 'y' or '-y' or 'z' or
          '-z' or 'RL' or 'LR' or 'AP' or 'PA' or 'IS' or 'SI', 'x' or '-x'
          or 'y' or '-y' or 'z' or '-z' or 'RL' or 'LR' or 'AP' or 'PA' or
          'IS' or 'SI', 'x' or '-x' or 'y' or '-y' or 'z' or '-z' or 'RL' or
          'LR' or 'AP' or 'PA' or 'IS' or 'SI'))
        3-tuple of new dimension order
        argument: ``%s %s %s``

[Optional]
out_file: (a file name)
        image to write
        argument: ``%s``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        image with new dimensions

References:

None

WarpPoints

Link to code

Wraps the executable command img2imgcoord.

Use FSL img2imgcoord to transform point sets. Accepts plain text files and vtk files.

Note

transformation of TrackVis trk files is not yet implemented

Examples

>>> from nipype.interfaces.fsl import WarpPoints
>>> warppoints = WarpPoints()
>>> warppoints.inputs.in_coords = 'surf.txt'
>>> warppoints.inputs.src_file = 'epi.nii'
>>> warppoints.inputs.dest_file = 'T1.nii'
>>> warppoints.inputs.warp_file = 'warpfield.nii'
>>> warppoints.inputs.coord_mm = True
>>> warppoints.cmdline 
'img2imgcoord -mm -dest T1.nii -src epi.nii -warp warpfield.nii surf.txt'
>>> res = warppoints.run() 

Inputs:

[Mandatory]
src_file: (an existing file name)
        filename of source image
        argument: ``-src %s``
dest_file: (an existing file name)
        filename of destination image
        argument: ``-dest %s``
in_coords: (an existing file name)
        filename of file containing coordinates
        argument: ``%s``, position: -1

[Optional]
xfm_file: (an existing file name)
        filename of affine transform (e.g. source2dest.mat)
        argument: ``-xfm %s``
        mutually_exclusive: warp_file
warp_file: (an existing file name)
        filename of warpfield (e.g. intermediate2dest_warp.nii.gz)
        argument: ``-warp %s``
        mutually_exclusive: xfm_file
coord_vox: (a boolean)
        all coordinates in voxels - default
        argument: ``-vox``
        mutually_exclusive: coord_mm
coord_mm: (a boolean)
        all coordinates in mm
        argument: ``-mm``
        mutually_exclusive: coord_vox
out_file: (a file name)
        output file name
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        Name of output file, containing the warp as field or coefficients.

WarpPointsFromStd

Link to code

Wraps the executable command std2imgcoord.

Use FSL std2imgcoord to transform point sets to standard space coordinates. Accepts plain text coordinates files.

Examples

>>> from nipype.interfaces.fsl import WarpPointsFromStd
>>> warppoints = WarpPointsFromStd()
>>> warppoints.inputs.in_coords = 'surf.txt'
>>> warppoints.inputs.img_file = 'T1.nii'
>>> warppoints.inputs.std_file = 'mni.nii'
>>> warppoints.inputs.warp_file = 'warpfield.nii'
>>> warppoints.inputs.coord_mm = True
>>> warppoints.cmdline 
'std2imgcoord -mm -img T1.nii -std mni.nii -warp warpfield.nii surf.txt'
>>> res = warppoints.run() 

Inputs:

[Mandatory]
img_file: (an existing file name)
        filename of a destination image
        argument: ``-img %s``
std_file: (an existing file name)
        filename of the image in standard space
        argument: ``-std %s``
in_coords: (an existing file name)
        filename of file containing coordinates
        argument: ``%s``, position: -2

[Optional]
xfm_file: (an existing file name)
        filename of affine transform (e.g. source2dest.mat)
        argument: ``-xfm %s``
        mutually_exclusive: warp_file
warp_file: (an existing file name)
        filename of warpfield (e.g. intermediate2dest_warp.nii.gz)
        argument: ``-warp %s``
        mutually_exclusive: xfm_file
coord_vox: (a boolean)
        all coordinates in voxels - default
        argument: ``-vox``
        mutually_exclusive: coord_mm
coord_mm: (a boolean)
        all coordinates in mm
        argument: ``-mm``
        mutually_exclusive: coord_vox
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        Name of output file, containing the warp as field or coefficients.

WarpPointsToStd

Link to code

Wraps the executable command img2stdcoord.

Use FSL img2stdcoord to transform point sets to standard space coordinates. Accepts plain text files and vtk files.

Note

transformation of TrackVis trk files is not yet implemented

Examples

>>> from nipype.interfaces.fsl import WarpPointsToStd
>>> warppoints = WarpPointsToStd()
>>> warppoints.inputs.in_coords = 'surf.txt'
>>> warppoints.inputs.img_file = 'T1.nii'
>>> warppoints.inputs.std_file = 'mni.nii'
>>> warppoints.inputs.warp_file = 'warpfield.nii'
>>> warppoints.inputs.coord_mm = True
>>> warppoints.cmdline 
'img2stdcoord -mm -img T1.nii -std mni.nii -warp warpfield.nii surf.txt'
>>> res = warppoints.run() 

Inputs:

[Mandatory]
img_file: (an existing file name)
        filename of input image
        argument: ``-img %s``
std_file: (an existing file name)
        filename of destination image
        argument: ``-std %s``
in_coords: (an existing file name)
        filename of file containing coordinates
        argument: ``%s``, position: -1

[Optional]
premat_file: (an existing file name)
        filename of pre-warp affine transform (e.g.
        example_func2highres.mat)
        argument: ``-premat %s``
xfm_file: (an existing file name)
        filename of affine transform (e.g. source2dest.mat)
        argument: ``-xfm %s``
        mutually_exclusive: warp_file
warp_file: (an existing file name)
        filename of warpfield (e.g. intermediate2dest_warp.nii.gz)
        argument: ``-warp %s``
        mutually_exclusive: xfm_file
coord_vox: (a boolean)
        all coordinates in voxels - default
        argument: ``-vox``
        mutually_exclusive: coord_mm
coord_mm: (a boolean)
        all coordinates in mm
        argument: ``-mm``
        mutually_exclusive: coord_vox
out_file: (a file name)
        output file name
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (an existing file name)
        Name of output file, containing the warp as field or coefficients.

WarpUtils

Link to code

Wraps the executable command fnirtfileutils.

Use FSL fnirtfileutils to convert field->coefficients, coefficients->field, coefficients->other_coefficients etc

Examples

>>> from nipype.interfaces.fsl import WarpUtils
>>> warputils = WarpUtils()
>>> warputils.inputs.in_file = "warpfield.nii"
>>> warputils.inputs.reference = "T1.nii"
>>> warputils.inputs.out_format = 'spline'
>>> warputils.inputs.warp_resolution = (10,10,10)
>>> warputils.inputs.output_type = "NIFTI_GZ"
>>> warputils.cmdline 
'fnirtfileutils --in=warpfield.nii --outformat=spline --ref=T1.nii --warpres=10.0000,10.0000,10.0000 --out=warpfield_coeffs.nii.gz'
>>> res = invwarp.run() 

Inputs:

[Mandatory]
in_file: (an existing file name)
        Name of file containing warp-coefficients/fields. This would
        typically be the output from the --cout switch of fnirt (but can
        also use fields, like the output from --fout).
        argument: ``--in=%s``
reference: (an existing file name)
        Name of a file in target space. Note that the target space is now
        different from the target space that was used to create the --warp
        file. It would typically be the file that was specified with the
        --in argument when running fnirt.
        argument: ``--ref=%s``
write_jacobian: (a boolean, nipype default value: False)
        Switch on --jac flag with automatically generated filename

[Optional]
out_format: ('spline' or 'field')
        Specifies the output format. If set to field (default) the output
        will be a (4D) field-file. If set to spline the format will be a
        (4D) file of spline coefficients.
        argument: ``--outformat=%s``
warp_resolution: (a tuple of the form: (a float, a float, a float))
        Specifies the resolution/knot-spacing of the splines pertaining to
        the coefficients in the --out file. This parameter is only relevant
        if --outformat is set to spline. It should be noted that if the --in
        file has a higher resolution, the resulting coefficients will
        pertain to the closest (in a least-squares sense) file in the space
        of fields with the --warpres resolution. It should also be noted
        that the resolution will always be an integer multiple of the voxel
        size.
        argument: ``--warpres=%0.4f,%0.4f,%0.4f``
knot_space: (a tuple of the form: (an integer (int or long), an
          integer (int or long), an integer (int or long)))
        Alternative (to --warpres) specification of the resolution of the
        output spline-field.
        argument: ``--knotspace=%d,%d,%d``
out_file: (a file name)
        Name of output file. The format of the output depends on what other
        parameters are set. The default format is a (4D) field-file. If the
        --outformat is set to spline the format will be a (4D) file of
        spline coefficients.
        argument: ``--out=%s``, position: -1
out_jacobian: (a file name)
        Specifies that a (3D) file of Jacobian determinants corresponding to
        --in should be produced and written to filename.
        argument: ``--jac=%s``
with_affine: (a boolean)
        Specifies that the affine transform (i.e. that which was specified
        for the --aff parameter in fnirt) should be included as
        displacements in the --out file. That can be useful for interfacing
        with software that cannot decode FSL/fnirt coefficient-files (where
        the affine transform is stored separately from the displacements).
        argument: ``--withaff``
output_type: ('NIFTI' or 'NIFTI_PAIR' or 'NIFTI_GZ' or
          'NIFTI_PAIR_GZ')
        FSL output type
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

out_file: (a file name)
        Name of output file, containing the warp as field or coefficients.
out_jacobian: (a file name)
        Name of output file, containing the map of the determinant of the
        Jacobian

References:

None