nipype.interfaces.fsl.utils module¶
The fsl module provides classes for interfacing with the FSL command line tools. This was written to work with FSL version 4.1.4.
Examples
See the docstrings of the individual classes for examples.
AvScale¶
Bases: CommandLine
Wrapped executable:
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()
- all_parama boolean
Maps to a command-line argument:
--allparams
.- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- mat_filea pathlike object or string representing an existing file
Mat file to read. Maps to a command-line argument:
%s
(position: -2).- ref_filea pathlike object or string representing an existing file
Reference file to get center of rotation. Maps to a command-line argument:
%s
(position: -1).
- average_scalinga float
Average Scaling.
- backward_half_transforma list of items which are a list of items which are a float
Backwards Half Transform.
- determinanta float
Determinant.
- forward_half_transforma list of items which are a list of items which are a float
Forward Half Transform.
- left_right_orientation_preserveda boolean
True if LR orientation preserved.
- rot_anglesa list of items which are a float
Rotation angles.
- rotation_translation_matrixa list of items which are a list of items which are a float
Rotation and Translation Matrix.
- scalesa list of items which are a float
Scales (x,y,z).
- skewsa list of items which are a float
Skews.
- translationsa list of items which are a float
Translations.
Complex¶
Bases: FSLCommand
Wrapped executable:
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()
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- complex_cartesiana boolean
Maps to a command-line argument:
-complex
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- complex_in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 2).- complex_in_file2a pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 3).- complex_mergea boolean
Maps to a command-line argument:
-complexmerge
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
,start_vol
,end_vol
.- complex_out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -3). Mutually exclusive with inputs:complex_out_file
,magnitude_out_file
,phase_out_file
,real_out_file
,imaginary_out_file
,real_polar
,real_cartesian
.- complex_polara boolean
Maps to a command-line argument:
-complexpolar
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- complex_splita boolean
Maps to a command-line argument:
-complexsplit
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- end_volan integer
Maps to a command-line argument:
%d
(position: -1).- environa 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’
Environment variables. (Nipype default value:
{}
)- imaginary_in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 3).- imaginary_out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -3). Mutually exclusive with inputs:complex_out_file
,magnitude_out_file
,phase_out_file
,real_polar
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- magnitude_in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 2).- magnitude_out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -4). Mutually exclusive with inputs:complex_out_file
,real_out_file
,imaginary_out_file
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- phase_in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 3).- phase_out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -3). Mutually exclusive with inputs:complex_out_file
,real_out_file
,imaginary_out_file
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- real_cartesiana boolean
Maps to a command-line argument:
-realcartesian
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- real_in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 2).- real_out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -4). Mutually exclusive with inputs:complex_out_file
,magnitude_out_file
,phase_out_file
,real_polar
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- real_polara boolean
Maps to a command-line argument:
-realpolar
(position: 1). Mutually exclusive with inputs:real_polar
,real_cartesian
,complex_cartesian
,complex_polar
,complex_split
,complex_merge
.- start_volan integer
Maps to a command-line argument:
%d
(position: -2).complex_out_file : a pathlike object or string representing a file imaginary_out_file : a pathlike object or string representing a file magnitude_out_file : a pathlike object or string representing a file phase_out_file : a pathlike object or string representing a file real_out_file : a pathlike object or string representing a file
ConvertWarp¶
Bases: FSLCommand
Wrapped executable:
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()
- referencea pathlike object or string representing an existing file
Name of a file in target space of the full transform. Maps to a command-line argument:
--ref=%s
(position: 1).
- abswarpa 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. Maps to a command-line argument:
--abs
. Mutually exclusive with inputs:relwarp
.- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- cons_jacobiana boolean
Constrain the Jacobian of the warpfield to lie within specified min/max limits. Maps to a command-line argument:
--constrainj
.- environa 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’
Environment variables. (Nipype default value:
{}
)- jacobian_maxa float
Maximum acceptable Jacobian value for constraint (default 100.0). Maps to a command-line argument:
--jmax=%f
.- jacobian_mina float
Minimum acceptable Jacobian value for constraint (default 0.01). Maps to a command-line argument:
--jmin=%f
.- midmata pathlike object or string representing an existing file
Name of file containing mid-warp-affine transform. Maps to a command-line argument:
--midmat=%s
.- out_abswarpa 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. Maps to a command-line argument:
--absout
. Mutually exclusive with inputs:out_relwarp
.- out_filea pathlike object or string representing a file
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. Maps to a command-line argument:
--out=%s
(position: -1).- out_relwarpa 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. Maps to a command-line argument:
--relout
. Mutually exclusive with inputs:out_abswarp
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- postmata pathlike object or string representing an existing file
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). Maps to a command-line argument:
--postmat=%s
.- premata pathlike object or string representing an existing file
Filename for pre-transform (affine matrix). Maps to a command-line argument:
--premat=%s
.- relwarpa 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. Maps to a command-line argument:
--rel
. Mutually exclusive with inputs:abswarp
.- 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. Maps to a command-line argument:
--shiftdir=%s
. Requires inputs:shift_in_file
.- shift_in_filea pathlike object or string representing an existing file
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). Maps to a command-line argument:
--shiftmap=%s
.- warp1a pathlike object or string representing an existing file
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. Maps to a command-line argument:
--warp1=%s
.- warp2a pathlike object or string representing an existing file
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). Maps to a command-line argument:
--warp2=%s
.
- out_filea pathlike object or string representing an existing file
Name of output file, containing the warp as field or coefficients.
ConvertXFM¶
Bases: FSLCommand
Wrapped executable:
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'
- in_filea pathlike object or string representing an existing file
Input transformation matrix. Maps to a command-line argument:
%s
(position: -1).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- concat_xfma boolean
Write joint transformation of two input matrices. Maps to a command-line argument:
-concat
(position: -3). Mutually exclusive with inputs:invert_xfm
,concat_xfm
,fix_scale_skew
. Requires inputs:in_file2
.- environa 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’
Environment variables. (Nipype default value:
{}
)- fix_scale_skewa boolean
Use secondary matrix to fix scale and skew. Maps to a command-line argument:
-fixscaleskew
(position: -3). Mutually exclusive with inputs:invert_xfm
,concat_xfm
,fix_scale_skew
. Requires inputs:in_file2
.- in_file2a pathlike object or string representing an existing file
Second input matrix (for use with fix_scale_skew or concat_xfm). Maps to a command-line argument:
%s
(position: -2).- invert_xfma boolean
Invert input transformation. Maps to a command-line argument:
-inverse
(position: -3). Mutually exclusive with inputs:invert_xfm
,concat_xfm
,fix_scale_skew
.- out_filea pathlike object or string representing a file
Final transformation matrix. Maps to a command-line argument:
-omat %s
(position: 1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- out_filea pathlike object or string representing an existing file
Output transformation matrix.
CopyGeom¶
Bases: FSLCommand
Wrapped executable:
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.
- dest_filea pathlike object or string representing an existing file
Destination image. Maps to a command-line argument:
%s
(position: 1).- in_filea pathlike object or string representing an existing file
Source image. Maps to a command-line argument:
%s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- ignore_dimsa boolean
Do not copy image dimensions. Maps to a command-line argument:
-d
(position: -1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- out_filea pathlike object or string representing an existing file
Image with new geometry header.
ExtractROI¶
Bases: FSLCommand
Wrapped executable:
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
- in_filea pathlike object or string representing an existing file
Input file. Maps to a command-line argument:
%s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- crop_lista list of items which are a tuple of the form: (an integer, an integer)
List of two tuples specifying crop options. Maps to a command-line argument:
%s
(position: 2). Mutually exclusive with inputs:x_min
,x_size
,y_min
,y_size
,z_min
,z_size
,t_min
,t_size
.- environa 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’
Environment variables. (Nipype default value:
{}
)- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- roi_filea pathlike object or string representing a file
Output file. Maps to a command-line argument:
%s
(position: 1).- t_minan integer
Maps to a command-line argument:
%d
(position: 8).- t_sizean integer
Maps to a command-line argument:
%d
(position: 9).- x_minan integer
Maps to a command-line argument:
%d
(position: 2).- x_sizean integer
Maps to a command-line argument:
%d
(position: 3).- y_minan integer
Maps to a command-line argument:
%d
(position: 4).- y_sizean integer
Maps to a command-line argument:
%d
(position: 5).- z_minan integer
Maps to a command-line argument:
%d
(position: 6).- z_sizean integer
Maps to a command-line argument:
%d
(position: 7).roi_file : a pathlike object or string representing an existing file
FilterRegressor¶
Bases: FSLCommand
Wrapped executable:
fsl_regfilt
.Data de-noising by regressing out part of a design matrix
Uses simple OLS regression on 4D images
- design_filea pathlike object or string representing an existing file
Name of the matrix with time courses (e.g. GLM design or MELODIC mixing matrix). Maps to a command-line argument:
-d %s
(position: 3).- filter_alla boolean
Use all columns in the design file in denoising. Maps to a command-line argument:
-f '%s'
(position: 4). Mutually exclusive with inputs:filter_columns
.- filter_columnsa list of items which are an integer
(1-based) column indices to filter out of the data. Maps to a command-line argument:
-f '%s'
(position: 4). Mutually exclusive with inputs:filter_all
.- in_filea pathlike object or string representing an existing file
Input file name (4D image). Maps to a command-line argument:
-i %s
(position: 1).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- maska pathlike object or string representing an existing file
Mask image file name. Maps to a command-line argument:
-m %s
.- out_filea pathlike object or string representing a file
Output file name for the filtered data. Maps to a command-line argument:
-o %s
(position: 2).- out_vnscalesa boolean
Output scaling factors for variance normalization. Maps to a command-line argument:
--out_vnscales
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- var_norma boolean
Perform variance-normalization on data. Maps to a command-line argument:
--vn
.
- out_filea pathlike object or string representing an existing file
Output file name for the filtered data.
ImageMaths¶
Bases: FSLCommand
Wrapped executable:
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
- in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 1).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- in_file2a pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 3).- mask_filea pathlike object or string representing an existing file
Use (following image>0) to mask current image. Maps to a command-line argument:
-mas %s
.- op_stringa string
String defining the operation, i. e. -add. Maps to a command-line argument:
%s
(position: 2).- out_data_type‘char’ or ‘short’ or ‘int’ or ‘float’ or ‘double’ or ‘input’
Output datatype, one of (char, short, int, float, double, input). Maps to a command-line argument:
-odt %s
(position: -1).- out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: -2).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- suffixa string
Out_file suffix.
out_file : a pathlike object or string representing an existing file
ImageMeants¶
Bases: FSLCommand
Wrapped executable:
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)
- in_filea pathlike object or string representing an existing file
Input file for computing the average timeseries. Maps to a command-line argument:
-i %s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- eiga boolean
Calculate Eigenvariate(s) instead of mean (output will have 0 mean). Maps to a command-line argument:
--eig
.- environa 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’
Environment variables. (Nipype default value:
{}
)- maska pathlike object or string representing an existing file
Input 3D mask. Maps to a command-line argument:
-m %s
.- nobina boolean
Do not binarise the mask for calculation of Eigenvariates. Maps to a command-line argument:
--no_bin
.- orderan integer
Select number of Eigenvariates. Maps to a command-line argument:
--order=%d
. (Nipype default value:1
)- out_filea pathlike object or string representing a file
Name of output text matrix. Maps to a command-line argument:
-o %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- show_alla boolean
Show all voxel time series (within mask) instead of averaging. Maps to a command-line argument:
--showall
.- spatial_coorda list of items which are an integer
<x y z> requested spatial coordinate (instead of mask). Maps to a command-line argument:
-c %s
.- transposea boolean
Output results in transpose format (one row per voxel/mean). Maps to a command-line argument:
--transpose
.- use_mma boolean
Use mm instead of voxel coordinates (for -c option). Maps to a command-line argument:
--usemm
.
- out_filea pathlike object or string representing an existing file
Path/name of output text matrix.
ImageStats¶
Bases: FSLCommand
Wrapped executable:
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
- in_filea pathlike object or string representing an existing file
Input file to generate stats of. Maps to a command-line argument:
%s
(position: 3).- op_stringa 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. Maps to a command-line argument:
%s
(position: 4).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- index_mask_filea pathlike object or string representing an existing file
Generate seperate n submasks from indexMask, for indexvalues 1..n where n is the maximum index value in indexMask, and generate statistics for each submask. Maps to a command-line argument:
-K %s
(position: 2).- mask_filea pathlike object or string representing an existing file
Mask file used for option -k %s.
- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- split_4da boolean
Give a separate output line for each 3D volume of a 4D timeseries. Maps to a command-line argument:
-t
(position: 1).
- out_statany value
Stats output.
- ImageStats.aggregate_outputs(runtime=None, needed_outputs=None)¶
Collate expected outputs and apply output traits validation.
InvWarp¶
Bases: FSLCommand
Wrapped executable:
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()
- referencea pathlike object or string representing an existing file
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. Maps to a command-line argument:
--ref=%s
.- warpa pathlike object or string representing an existing file
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). Maps to a command-line argument:
--warp=%s
.
- absolutea 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. Maps to a command-line argument:
--abs
. Mutually exclusive with inputs:relative
.- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- inverse_warpa pathlike object or string representing a file
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. Maps to a command-line argument:
--out=%s
.- jacobian_maxa float
Maximum acceptable Jacobian value for constraint (default 100.0). Maps to a command-line argument:
--jmax=%f
.- jacobian_mina float
Minimum acceptable Jacobian value for constraint (default 0.01). Maps to a command-line argument:
--jmin=%f
.- niteran integer
Determines how many iterations of the gradient-descent search that should be run. Maps to a command-line argument:
--niter=%d
.- noconstrainta boolean
Do not apply Jacobian constraint. Maps to a command-line argument:
--noconstraint
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- regularisea float
Regularization strength (deafult=1.0). Maps to a command-line argument:
--regularise=%f
.- relativea 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. Maps to a command-line argument:
--rel
. Mutually exclusive with inputs:absolute
.
- inverse_warpa pathlike object or string representing an existing file
Name of output file, containing warps that are the “reverse” of those in –warp.
Merge¶
Bases: FSLCommand
Wrapped executable:
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'
- dimension‘t’ or ‘x’ or ‘y’ or ‘z’ or ‘a’
Dimension along which to merge, optionally set tr input when dimension is t. Maps to a command-line argument:
-%s
(position: 0).- in_filesa list of items which are a pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 2).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- merged_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: 1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- tra float
Use to specify TR in seconds (default is 1.00 sec), overrides dimension and sets it to tr. Maps to a command-line argument:
%.2f
(position: -1).merged_file : a pathlike object or string representing an existing file
MotionOutliers¶
Bases: FSLCommand
Wrapped executable:
fsl_motion_outliers
.Use FSL fsl_motion_outliers`http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLMotionOutliers`_ to find outliers in timeseries (4d) data. .. rubric:: Examples
>>> from nipype.interfaces.fsl import MotionOutliers >>> mo = MotionOutliers() >>> mo.inputs.in_file = "epi.nii" >>> mo.cmdline 'fsl_motion_outliers -i epi.nii -o epi_outliers.txt -p epi_metrics.png -s epi_metrics.txt' >>> res = mo.run()
- in_filea pathlike object or string representing an existing file
Unfiltered 4D image. Maps to a command-line argument:
-i %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- dummyan integer
Number of dummy scans to delete (before running anything and creating EVs). Maps to a command-line argument:
--dummy=%d
.- environa 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’
Environment variables. (Nipype default value:
{}
)- maska pathlike object or string representing an existing file
Mask image for calculating metric. Maps to a command-line 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. Maps to a command-line argument:
--%s
.- no_motion_correctiona boolean
Do not run motion correction (assumed already done). Maps to a command-line argument:
--nomoco
.- out_filea pathlike object or string representing a file
Output outlier file name. Maps to a command-line argument:
-o %s
.- out_metric_plota pathlike object or string representing a file
Output metric values plot (DVARS etc.) file name. Maps to a command-line argument:
-p %s
.- out_metric_valuesa pathlike object or string representing a file
Output metric values (DVARS etc.) file name. Maps to a command-line argument:
-s %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- thresholda float
Specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR). Maps to a command-line argument:
--thresh=%g
.out_file : a pathlike object or string representing an existing file out_metric_plot : a pathlike object or string representing an existing file out_metric_values : a pathlike object or string representing an existing file
Overlay¶
Bases: FSLCommand
Wrapped executable:
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()
- auto_thresh_bga boolean
Automatically threshold the background image. Maps to a command-line argument:
-a
(position: 5). Mutually exclusive with inputs:auto_thresh_bg
,full_bg_range
,bg_thresh
.- background_imagea pathlike object or string representing an existing file
Image to use as background. Maps to a command-line argument:
%s
(position: 4).- bg_thresha tuple of the form: (a float, a float)
Min and max values for background intensity. Maps to a command-line argument:
%.3f %.3f
(position: 5). Mutually exclusive with inputs:auto_thresh_bg
,full_bg_range
,bg_thresh
.- full_bg_rangea boolean
Use full range of background image. Maps to a command-line argument:
-A
(position: 5). Mutually exclusive with inputs:auto_thresh_bg
,full_bg_range
,bg_thresh
.- stat_imagea pathlike object or string representing an existing file
Statistical image to overlay in color. Maps to a command-line argument:
%s
(position: 6).- stat_thresha tuple of the form: (a float, a float)
Min and max values for the statistical overlay. Maps to a command-line argument:
%.2f %.2f
(position: 7).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Combined image volume. Maps to a command-line argument:
%s
(position: -1).- out_type‘float’ or ‘int’
Write output with float or int. Maps to a command-line argument:
%s
(position: 2). (Nipype default value:float
)- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- show_negative_statsa boolean
Display negative statistics in overlay. Maps to a command-line argument:
%s
(position: 8). Mutually exclusive with inputs:stat_image2
.- stat_image2a pathlike object or string representing an existing file
Second statistical image to overlay in color. Maps to a command-line argument:
%s
(position: 9). Mutually exclusive with inputs:show_negative_stats
.- stat_thresh2a tuple of the form: (a float, a float)
Min and max values for second statistical overlay. Maps to a command-line argument:
%.2f %.2f
(position: 10).- transparencya boolean
Make overlay colors semi-transparent. Maps to a command-line argument:
%s
(position: 1). (Nipype default value:True
)- use_checkerboarda boolean
Use checkerboard mask for overlay. Maps to a command-line argument:
-c
(position: 3).
- out_filea pathlike object or string representing an existing file
Combined image volume.
PlotMotionParams¶
Bases: FSLCommand
Wrapped executable:
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.
- in_filea pathlike object or string representing an existing file or a list of items which are a pathlike object or string representing an existing file
File with motion parameters. Maps to a command-line 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. Maps to a command-line argument:
%s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Image to write. Maps to a command-line argument:
-o %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- plot_sizea tuple of the form: (an integer, an integer)
Plot image height and width. Maps to a command-line argument:
%s
.
- out_filea pathlike object or string representing an existing file
Image to write.
PlotTimeSeries¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file or a list of items which are a pathlike object or string representing an existing file
File or list of files with columns of timecourse information. Maps to a command-line argument:
%s
(position: 1).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- labelsa string or a list of items which are a string
Label or list of labels. Maps to a command-line argument:
%s
.- legend_filea pathlike object or string representing an existing file
Legend file. Maps to a command-line argument:
--legend=%s
.- out_filea pathlike object or string representing a file
Image to write. Maps to a command-line argument:
-o %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- plot_finishan integer
Final column from in-file to plot. Maps to a command-line argument:
--finish=%d
. Mutually exclusive with inputs:plot_range
.- plot_rangea tuple of the form: (an integer, an integer)
First and last columns from the in-file to plot. Maps to a command-line argument:
%s
. Mutually exclusive with inputs:plot_start
,plot_finish
.- plot_sizea tuple of the form: (an integer, an integer)
Plot image height and width. Maps to a command-line argument:
%s
.- plot_startan integer
First column from in-file to plot. Maps to a command-line argument:
--start=%d
. Mutually exclusive with inputs:plot_range
.- sci_notationa boolean
Switch on scientific notation. Maps to a command-line argument:
--sci
.- titlea string
Plot title. Maps to a command-line argument:
%s
.- x_precisionan integer
Precision of x-axis labels. Maps to a command-line argument:
--precision=%d
.- x_unitsan integer
Scaling units for x-axis (between 1 and length of in file). Maps to a command-line argument:
-u %d
. (Nipype default value:1
)- y_maxa float
Maximum y value. Maps to a command-line argument:
--ymax=%.2f
. Mutually exclusive with inputs:y_range
.- y_mina float
Minumum y value. Maps to a command-line argument:
--ymin=%.2f
. Mutually exclusive with inputs:y_range
.- y_rangea tuple of the form: (a float, a float)
Min and max y axis values. Maps to a command-line argument:
%s
. Mutually exclusive with inputs:y_min
,y_max
.
- out_filea pathlike object or string representing an existing file
Image to write.
PowerSpectrum¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file
Input 4D file to estimate the power spectrum. Maps to a command-line argument:
%s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Name of output 4D file for power spectrum. Maps to a command-line argument:
%s
(position: 1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- out_filea pathlike object or string representing an existing file
Path/name of the output 4D power spectrum file.
Reorient2Std¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
out_file : a pathlike object or string representing an existing file
RobustFOV¶
Bases: FSLCommand
Wrapped executable:
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.
- in_filea pathlike object or string representing an existing file
Input filename. Maps to a command-line argument:
-i %s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- brainsizean integer
Size of brain in z-dimension (default 170mm/150mm). Maps to a command-line argument:
-b %d
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_roia pathlike object or string representing a file
ROI volume output name. Maps to a command-line argument:
-r %s
.- out_transforma pathlike object or string representing a file
Transformation matrix in_file to out_roi output name. Maps to a command-line argument:
-m %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- out_roia pathlike object or string representing an existing file
ROI volume output name.
- out_transforma pathlike object or string representing an existing file
Transformation matrix in_file to out_roi output name.
SigLoss¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file
B0 fieldmap file. Maps to a command-line argument:
-i %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- echo_timea float
Echo time in seconds. Maps to a command-line argument:
--te=%f
.- environa 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’
Environment variables. (Nipype default value:
{}
)- mask_filea pathlike object or string representing an existing file
Brain mask file. Maps to a command-line argument:
-m %s
.- out_filea pathlike object or string representing a file
Output signal loss estimate file. Maps to a command-line argument:
-s %s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- slice_direction‘x’ or ‘y’ or ‘z’
Slicing direction. Maps to a command-line argument:
-d %s
.
- out_filea pathlike object or string representing an existing file
Signal loss estimate file.
Slice¶
Bases: FSLCommand
Wrapped executable:
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'
- in_filea pathlike object or string representing an existing file
Input filename. Maps to a command-line argument:
%s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_base_namea string
Outputs prefix. Maps to a command-line argument:
%s
(position: 1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
out_files : a list of items which are a pathlike object or string representing an existing file
Slicer¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file
Input volume. Maps to a command-line argument:
%s
(position: 1).
- all_axiala boolean
Output all axial slices into one picture. Maps to a command-line argument:
-A
(position: 10). Mutually exclusive with inputs:single_slice
,middle_slices
,all_axial
,sample_axial
. Requires inputs:image_width
.- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- colour_mapa pathlike object or string representing an existing file
Use different colour map from that stored in nifti header. Maps to a command-line argument:
-l %s
(position: 4).- dither_edgesa boolean
Produce semi-transparent (dithered) edges. Maps to a command-line argument:
-t
(position: 7).- environa 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’
Environment variables. (Nipype default value:
{}
)- image_edgesa pathlike object or string representing an existing file
Volume to display edge overlay for (useful for checking registration. Maps to a command-line argument:
%s
(position: 2).- image_widthan integer
Max picture width. Maps to a command-line argument:
%d
(position: -2).- intensity_rangea tuple of the form: (a float, a float)
Min and max intensities to display. Maps to a command-line argument:
-i %.3f %.3f
(position: 5).- label_slicesa boolean
Display slice number. Maps to a command-line argument:
-L
(position: 3). (Nipype default value:True
)- middle_slicesa boolean
Output picture of mid-sagittal, axial, and coronal slices. Maps to a command-line argument:
-a
(position: 10). Mutually exclusive with inputs:single_slice
,middle_slices
,all_axial
,sample_axial
.- nearest_neighboura boolean
Use nearest neighbor interpolation for output. Maps to a command-line argument:
-n
(position: 8).- out_filea pathlike object or string representing a file
Picture to write. Maps to a command-line argument:
%s
(position: -1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- sample_axialan integer
Output every n axial slices into one picture. Maps to a command-line argument:
-S %d
(position: 10). Mutually exclusive with inputs:single_slice
,middle_slices
,all_axial
,sample_axial
. Requires inputs:image_width
.- scalinga float
Image scale. Maps to a command-line argument:
-s %f
(position: 0).- show_orientationa boolean
Label left-right orientation. Maps to a command-line argument:
%s
(position: 9). (Nipype default value:True
)- single_slice‘x’ or ‘y’ or ‘z’
Output picture of single slice in the x, y, or z plane. Maps to a command-line argument:
-%s
(position: 10). Mutually exclusive with inputs:single_slice
,middle_slices
,all_axial
,sample_axial
. Requires inputs:slice_number
.- slice_numberan integer
Slice number to save in picture. Maps to a command-line argument:
-%d
(position: 11).- threshold_edgesa float
Use threshold for edges. Maps to a command-line argument:
-e %.3f
(position: 6).
- out_filea pathlike object or string representing an existing file
Picture to write.
Smooth¶
Bases: FSLCommand
Wrapped executable:
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 ...
- fwhma float
Gaussian kernel fwhm, will be converted to sigma in mm (not voxels). Maps to a command-line argument:
-kernel gauss %.03f -fmean
(position: 1). Mutually exclusive with inputs:sigma
.- in_filea pathlike object or string representing an existing file
Maps to a command-line argument:
%s
(position: 0).- sigmaa float
Gaussian kernel sigma in mm (not voxels). Maps to a command-line argument:
-kernel gauss %.03f -fmean
(position: 1). Mutually exclusive with inputs:fwhm
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- smoothed_filea pathlike object or string representing a file
Maps to a command-line argument:
%s
(position: 2).smoothed_file : a pathlike object or string representing an existing file
Split¶
Bases: FSLCommand
Wrapped executable:
fslsplit
.Uses FSL Fslsplit command to separate a volume into images in time, x, y or z dimension.
- dimension‘t’ or ‘x’ or ‘y’ or ‘z’
Dimension along which the file will be split. Maps to a command-line argument:
-%s
(position: 2).- in_filea pathlike object or string representing an existing file
Input filename. Maps to a command-line argument:
%s
(position: 0).
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_base_namea string
Outputs prefix. Maps to a command-line argument:
%s
(position: 1).- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
out_files : a list of items which are a pathlike object or string representing an existing file
SwapDimensions¶
Bases: FSLCommand
Wrapped executable:
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).
- in_filea pathlike object or string representing an existing file
Input image. Maps to a command-line argument:
%s
(position: 1).- new_dimsa 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. Maps to a command-line argument:
%s %s %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Image to write. Maps to a command-line argument:
%s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- out_filea pathlike object or string representing an existing file
Image with new dimensions.
WarpPoints¶
Bases: CommandLine
Wrapped executable:
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()
- dest_filea pathlike object or string representing an existing file
Filename of destination image. Maps to a command-line argument:
-dest %s
.- in_coordsa pathlike object or string representing an existing file
Filename of file containing coordinates. Maps to a command-line argument:
%s
(position: -1).- src_filea pathlike object or string representing an existing file
Filename of source image. Maps to a command-line argument:
-src %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- coord_mma boolean
All coordinates in mm. Maps to a command-line argument:
-mm
. Mutually exclusive with inputs:coord_vox
.- coord_voxa boolean
All coordinates in voxels - default. Maps to a command-line argument:
-vox
. Mutually exclusive with inputs:coord_mm
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Output file name.
- warp_filea pathlike object or string representing an existing file
Filename of warpfield (e.g. intermediate2dest_warp.nii.gz). Maps to a command-line argument:
-warp %s
. Mutually exclusive with inputs:xfm_file
.- xfm_filea pathlike object or string representing an existing file
Filename of affine transform (e.g. source2dest.mat). Maps to a command-line argument:
-xfm %s
. Mutually exclusive with inputs:warp_file
.
- out_filea pathlike object or string representing an existing file
Name of output file, containing the warp as field or coefficients.
WarpPointsFromStd¶
Bases: CommandLine
Wrapped executable:
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()
- img_filea pathlike object or string representing an existing file
Filename of a destination image. Maps to a command-line argument:
-img %s
.- in_coordsa pathlike object or string representing an existing file
Filename of file containing coordinates. Maps to a command-line argument:
%s
(position: -2).- std_filea pathlike object or string representing an existing file
Filename of the image in standard space. Maps to a command-line argument:
-std %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- coord_mma boolean
All coordinates in mm. Maps to a command-line argument:
-mm
. Mutually exclusive with inputs:coord_vox
.- coord_voxa boolean
All coordinates in voxels - default. Maps to a command-line argument:
-vox
. Mutually exclusive with inputs:coord_mm
.- environa 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’
Environment variables. (Nipype default value:
{}
)- warp_filea pathlike object or string representing an existing file
Filename of warpfield (e.g. intermediate2dest_warp.nii.gz). Maps to a command-line argument:
-warp %s
. Mutually exclusive with inputs:xfm_file
.- xfm_filea pathlike object or string representing an existing file
Filename of affine transform (e.g. source2dest.mat). Maps to a command-line argument:
-xfm %s
. Mutually exclusive with inputs:warp_file
.
- out_filea pathlike object or string representing an existing file
Name of output file, containing the warp as field or coefficients.
WarpPointsToStd¶
Bases: WarpPoints
Wrapped executable:
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()
- img_filea pathlike object or string representing an existing file
Filename of input image. Maps to a command-line argument:
-img %s
.- in_coordsa pathlike object or string representing an existing file
Filename of file containing coordinates. Maps to a command-line argument:
%s
(position: -1).- std_filea pathlike object or string representing an existing file
Filename of destination image. Maps to a command-line argument:
-std %s
.
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- coord_mma boolean
All coordinates in mm. Maps to a command-line argument:
-mm
. Mutually exclusive with inputs:coord_vox
.- coord_voxa boolean
All coordinates in voxels - default. Maps to a command-line argument:
-vox
. Mutually exclusive with inputs:coord_mm
.- environa 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’
Environment variables. (Nipype default value:
{}
)- out_filea pathlike object or string representing a file
Output file name.
- premat_filea pathlike object or string representing an existing file
Filename of pre-warp affine transform (e.g. example_func2highres.mat). Maps to a command-line argument:
-premat %s
.- warp_filea pathlike object or string representing an existing file
Filename of warpfield (e.g. intermediate2dest_warp.nii.gz). Maps to a command-line argument:
-warp %s
. Mutually exclusive with inputs:xfm_file
.- xfm_filea pathlike object or string representing an existing file
Filename of affine transform (e.g. source2dest.mat). Maps to a command-line argument:
-xfm %s
. Mutually exclusive with inputs:warp_file
.
- out_filea pathlike object or string representing an existing file
Name of output file, containing the warp as field or coefficients.
WarpUtils¶
Bases: FSLCommand
Wrapped executable:
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()
- in_filea pathlike object or string representing an existing file
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). Maps to a command-line argument:
--in=%s
.- referencea pathlike object or string representing an existing file
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. Maps to a command-line argument:
--ref=%s
.- write_jacobiana boolean
Switch on –jac flag with automatically generated filename. (Nipype default value:
False
)
- argsa string
Additional parameters to the command. Maps to a command-line argument:
%s
.- environa 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’
Environment variables. (Nipype default value:
{}
)- knot_spacea tuple of the form: (an integer, an integer, an integer)
Alternative (to –warpres) specification of the resolution of the output spline-field. Maps to a command-line argument:
--knotspace=%d,%d,%d
.- out_filea pathlike object or string representing a file
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. Maps to a command-line argument:
--out=%s
(position: -1).- 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. Maps to a command-line argument:
--outformat=%s
.- out_jacobiana pathlike object or string representing a file
Specifies that a (3D) file of Jacobian determinants corresponding to –in should be produced and written to filename. Maps to a command-line argument:
--jac=%s
.- output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’
FSL output type.
- warp_resolutiona 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. Maps to a command-line argument:
--warpres=%0.4f,%0.4f,%0.4f
.- with_affinea 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). Maps to a command-line argument:
--withaff
.
- out_filea pathlike object or string representing a file
Name of output file, containing the warp as field or coefficients.
- out_jacobiana pathlike object or string representing a file
Name of output file, containing the map of the determinant of the Jacobian.