interfaces.fsl.model¶
Cluster¶
Wraps the executable command cluster
.
Uses FSL cluster to perform clustering on statistical output
Examples¶
>>> cl = Cluster()
>>> cl.inputs.threshold = 2.3
>>> cl.inputs.in_file = 'zstat1.nii.gz'
>>> cl.inputs.out_localmax_txt_file = 'stats.txt'
>>> cl.inputs.use_mm = True
>>> cl.cmdline
'cluster --in=zstat1.nii.gz --olmax=stats.txt --thresh=2.3000000000 --mm'
Inputs:
[Mandatory]
in_file: (a pathlike object or string representing an existing file)
input volume
argument: ``--in=%s``
threshold: (a float)
threshold for input volume
argument: ``--thresh=%.10f``
[Optional]
out_index_file: (a boolean or a pathlike object or string
representing a file)
output of cluster index (in size order)
argument: ``--oindex=%s``
out_threshold_file: (a boolean or a pathlike object or string
representing a file)
thresholded image
argument: ``--othresh=%s``
out_localmax_txt_file: (a boolean or a pathlike object or string
representing a file)
local maxima text file
argument: ``--olmax=%s``
out_localmax_vol_file: (a boolean or a pathlike object or string
representing a file)
output of local maxima volume
argument: ``--olmaxim=%s``
out_size_file: (a boolean or a pathlike object or string representing
a file)
filename for output of size image
argument: ``--osize=%s``
out_max_file: (a boolean or a pathlike object or string representing
a file)
filename for output of max image
argument: ``--omax=%s``
out_mean_file: (a boolean or a pathlike object or string representing
a file)
filename for output of mean image
argument: ``--omean=%s``
out_pval_file: (a boolean or a pathlike object or string representing
a file)
filename for image output of log pvals
argument: ``--opvals=%s``
pthreshold: (a float)
p-threshold for clusters
argument: ``--pthresh=%.10f``
requires: dlh, volume
peak_distance: (a float)
minimum distance between local maxima/minima, in mm (default 0)
argument: ``--peakdist=%.10f``
cope_file: (a pathlike object or string representing a file)
cope volume
argument: ``--cope=%s``
volume: (an integer (int or long))
number of voxels in the mask
argument: ``--volume=%d``
dlh: (a float)
smoothness estimate = sqrt(det(Lambda))
argument: ``--dlh=%.10f``
fractional: (a boolean, nipype default value: False)
interprets the threshold as a fraction of the robust range
argument: ``--fractional``
connectivity: (an integer (int or long))
the connectivity of voxels (default 26)
argument: ``--connectivity=%d``
use_mm: (a boolean, nipype default value: False)
use mm, not voxel, coordinates
argument: ``--mm``
find_min: (a boolean, nipype default value: False)
find minima instead of maxima
argument: ``--min``
no_table: (a boolean, nipype default value: False)
suppresses printing of the table info
argument: ``--no_table``
minclustersize: (a boolean, nipype default value: False)
prints out minimum significant cluster size
argument: ``--minclustersize``
xfm_file: (a pathlike object or string representing a file)
filename for Linear: input->standard-space transform. Non-linear:
input->highres transform
argument: ``--xfm=%s``
std_space_file: (a pathlike object or string representing a file)
filename for standard-space volume
argument: ``--stdvol=%s``
num_maxima: (an integer (int or long))
no of local maxima to report
argument: ``--num=%d``
warpfield_file: (a pathlike object or string representing a file)
file contining warpfield
argument: ``--warpvol=%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:
index_file: (a pathlike object or string representing a file)
output of cluster index (in size order)
threshold_file: (a pathlike object or string representing a file)
thresholded image
localmax_txt_file: (a pathlike object or string representing a file)
local maxima text file
localmax_vol_file: (a pathlike object or string representing a file)
output of local maxima volume
size_file: (a pathlike object or string representing a file)
filename for output of size image
max_file: (a pathlike object or string representing a file)
filename for output of max image
mean_file: (a pathlike object or string representing a file)
filename for output of mean image
pval_file: (a pathlike object or string representing a file)
filename for image output of log pvals
References:¶
None
ContrastMgr¶
Wraps the executable command contrast_mgr
.
Use FSL contrast_mgr command to evaluate contrasts
In interface mode this file assumes that all the required inputs are in the same location. This has deprecated for FSL versions 5.0.7+ as the necessary corrections file is no longer generated by FILMGLS.
Inputs:
[Mandatory]
tcon_file: (a pathlike object or string representing an existing
file)
contrast file containing T-contrasts
argument: ``%s``, position: -1
param_estimates: (a list of items which are a pathlike object or
string representing an existing file)
Parameter estimates for each column of the design matrix
corrections: (a pathlike object or string representing an existing
file)
statistical corrections used within FILM modelling
dof_file: (a pathlike object or string representing an existing file)
degrees of freedom
sigmasquareds: (a pathlike object or string representing an existing
file)
summary of residuals, See Woolrich, et. al., 2001
[Optional]
fcon_file: (a pathlike object or string representing an existing
file)
contrast file containing F-contrasts
argument: ``-f %s``
contrast_num: (a long integer >= 1)
contrast number to start labeling copes from
argument: ``-cope``
suffix: (a unicode string)
suffix to put on the end of the cope filename before the contrast
number, default is nothing
argument: ``-suffix %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:
copes: (a list of items which are a pathlike object or string
representing an existing file)
Contrast estimates for each contrast
varcopes: (a list of items which are a pathlike object or string
representing an existing file)
Variance estimates for each contrast
zstats: (a list of items which are a pathlike object or string
representing an existing file)
z-stat file for each contrast
tstats: (a list of items which are a pathlike object or string
representing an existing file)
t-stat file for each contrast
fstats: (a list of items which are a pathlike object or string
representing an existing file)
f-stat file for each contrast
zfstats: (a list of items which are a pathlike object or string
representing an existing file)
z-stat file for each F contrast
neffs: (a list of items which are a pathlike object or string
representing an existing file)
neff file ?? for each contrast
References:¶
None
DualRegression¶
Wraps the executable command dual_regression
.
Wrapper Script for Dual Regression Workflow
Examples¶
>>> dual_regression = DualRegression()
>>> dual_regression.inputs.in_files = ["functional.nii", "functional2.nii", "functional3.nii"]
>>> dual_regression.inputs.group_IC_maps_4D = "allFA.nii"
>>> dual_regression.inputs.des_norm = False
>>> dual_regression.inputs.one_sample_group_mean = True
>>> dual_regression.inputs.n_perm = 10
>>> dual_regression.inputs.out_dir = "my_output_directory"
>>> dual_regression.cmdline
'dual_regression allFA.nii 0 -1 10 my_output_directory functional.nii functional2.nii functional3.nii'
>>> dual_regression.run() # doctest: +SKIP
Inputs:
[Mandatory]
in_files: (a list of items which are a pathlike object or string
representing an existing file)
List all subjects' preprocessed, standard-space 4D datasets
argument: ``%s``, position: -1
group_IC_maps_4D: (a pathlike object or string representing an
existing file)
4D image containing spatial IC maps (melodic_IC) from the whole-
group ICA analysis
argument: ``%s``, position: 1
n_perm: (an integer (int or long))
Number of permutations for randomise; set to 1 for just raw tstat
output, set to 0 to not run randomise at all.
argument: ``%i``, position: 5
[Optional]
des_norm: (a boolean, nipype default value: True)
Whether to variance-normalise the timecourses used as the stage-2
regressors; True is default and recommended
argument: ``%i``, position: 2
one_sample_group_mean: (a boolean)
perform 1-sample group-mean test instead of generic permutation test
argument: ``-1``, position: 3
design_file: (a pathlike object or string representing an existing
file)
Design matrix for final cross-subject modelling with randomise
argument: ``%s``, position: 3
con_file: (a pathlike object or string representing an existing file)
Design contrasts for final cross-subject modelling with randomise
argument: ``%s``, position: 4
out_dir: (a pathlike object or string representing a directory,
nipype default value: output)
This directory will be created to hold all output and logfiles
argument: ``%s``, position: 6
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_dir: (a pathlike object or string representing an existing
directory)
References:¶
None
FEAT¶
Wraps the executable command feat
.
Uses FSL feat to calculate first level stats
Inputs:
[Mandatory]
fsf_file: (a pathlike object or string representing an existing file)
File specifying the feat design spec file
argument: ``%s``, position: 0
[Optional]
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:
feat_dir: (a pathlike object or string representing an existing
directory)
References:¶
None
FEATModel¶
Wraps the executable command feat_model
.
Uses FSL feat_model to generate design.mat files
Inputs:
[Mandatory]
fsf_file: (a pathlike object or string representing an existing file)
File specifying the feat design spec file
argument: ``%s``, position: 0
ev_files: (a list of items which are a pathlike object or string
representing an existing file)
Event spec files generated by level1design
argument: ``%s``, position: 1
[Optional]
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:
design_file: (a pathlike object or string representing an existing
file)
Mat file containing ascii matrix for design
design_image: (a pathlike object or string representing an existing
file)
Graphical representation of design matrix
design_cov: (a pathlike object or string representing an existing
file)
Graphical representation of design covariance
con_file: (a pathlike object or string representing an existing file)
Contrast file containing contrast vectors
fcon_file: (a pathlike object or string representing a file)
Contrast file containing contrast vectors
References:¶
None
FEATRegister¶
Register feat directories to a specific standard
Inputs:
[Mandatory]
feat_dirs: (a list of items which are a pathlike object or string
representing an existing directory)
Lower level feat dirs
reg_image: (a pathlike object or string representing an existing
file)
image to register to (will be treated as standard)
[Optional]
reg_dof: (an integer (int or long), nipype default value: 12)
registration degrees of freedom
Outputs:
fsf_file: (a pathlike object or string representing an existing file)
FSL feat specification file
FILMGLS¶
Wraps the executable command film_gls
.
Use FSL film_gls command to fit a design matrix to voxel timeseries
Examples¶
Initialize with no options, assigning them when calling run:
>>> from nipype.interfaces import fsl
>>> fgls = fsl.FILMGLS()
>>> res = fgls.run('in_file', 'design_file', 'thresh', rn='stats') #doctest: +SKIP
Assign options through the inputs
attribute:
>>> fgls = fsl.FILMGLS()
>>> fgls.inputs.in_file = 'functional.nii'
>>> fgls.inputs.design_file = 'design.mat'
>>> fgls.inputs.threshold = 10
>>> fgls.inputs.results_dir = 'stats'
>>> res = fgls.run() #doctest: +SKIP
Specify options when creating an instance:
>>> fgls = fsl.FILMGLS(in_file='functional.nii', design_file='design.mat', threshold=10, results_dir='stats')
>>> res = fgls.run() #doctest: +SKIP
Inputs:
[Mandatory]
in_file: (a pathlike object or string representing an existing file)
input data file
argument: ``%s``, position: -3
[Optional]
design_file: (a pathlike object or string representing an existing
file)
design matrix file
argument: ``%s``, position: -2
threshold: (a floating point number >= 0.0, nipype default value:
1000.0)
threshold
argument: ``%f``, position: -1
smooth_autocorr: (a boolean)
Smooth auto corr estimates
argument: ``-sa``
mask_size: (an integer (int or long))
susan mask size
argument: ``-ms %d``
brightness_threshold: (a long integer >= 0)
susan brightness threshold, otherwise it is estimated
argument: ``-epith %d``
full_data: (a boolean)
output full data
argument: ``-v``
autocorr_estimate_only: (a boolean)
perform autocorrelation estimatation only
argument: ``-ac``
mutually_exclusive: autocorr_estimate_only, fit_armodel,
tukey_window, multitaper_product, use_pava, autocorr_noestimate
fit_armodel: (a boolean)
fits autoregressive model - default is to use tukey with
M=sqrt(numvols)
argument: ``-ar``
mutually_exclusive: autocorr_estimate_only, fit_armodel,
tukey_window, multitaper_product, use_pava, autocorr_noestimate
tukey_window: (an integer (int or long))
tukey window size to estimate autocorr
argument: ``-tukey %d``
mutually_exclusive: autocorr_estimate_only, fit_armodel,
tukey_window, multitaper_product, use_pava, autocorr_noestimate
multitaper_product: (an integer (int or long))
multitapering with slepian tapers and num is the time-bandwidth
product
argument: ``-mt %d``
mutually_exclusive: autocorr_estimate_only, fit_armodel,
tukey_window, multitaper_product, use_pava, autocorr_noestimate
use_pava: (a boolean)
estimates autocorr using PAVA
argument: ``-pava``
autocorr_noestimate: (a boolean)
do not estimate autocorrs
argument: ``-noest``
mutually_exclusive: autocorr_estimate_only, fit_armodel,
tukey_window, multitaper_product, use_pava, autocorr_noestimate
output_pwdata: (a boolean)
output prewhitened data and average design matrix
argument: ``-output_pwdata``
results_dir: (a pathlike object or string representing a directory,
nipype default value: results)
directory to store results in
argument: ``-rn %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:
param_estimates: (a list of items which are a pathlike object or
string representing an existing file)
Parameter estimates for each column of the design matrix
residual4d: (a pathlike object or string representing an existing
file)
Model fit residual mean-squared error for each time point
dof_file: (a pathlike object or string representing an existing file)
degrees of freedom
sigmasquareds: (a pathlike object or string representing an existing
file)
summary of residuals, See Woolrich, et. al., 2001
results_dir: (a pathlike object or string representing an existing
directory)
directory storing model estimation output
corrections: (a pathlike object or string representing an existing
file)
statistical corrections used within FILM modeling
thresholdac: (a pathlike object or string representing an existing
file)
The FILM autocorrelation parameters
logfile: (a pathlike object or string representing an existing file)
FILM run logfile
References:¶
None
FLAMEO¶
Wraps the executable command flameo
.
Use FSL flameo command to perform higher level model fits
Examples¶
Initialize FLAMEO with no options, assigning them when calling run:
>>> from nipype.interfaces import fsl
>>> flameo = fsl.FLAMEO()
>>> flameo.inputs.cope_file = 'cope.nii.gz'
>>> flameo.inputs.var_cope_file = 'varcope.nii.gz'
>>> flameo.inputs.cov_split_file = 'cov_split.mat'
>>> flameo.inputs.design_file = 'design.mat'
>>> flameo.inputs.t_con_file = 'design.con'
>>> flameo.inputs.mask_file = 'mask.nii'
>>> flameo.inputs.run_mode = 'fe'
>>> flameo.cmdline
'flameo --copefile=cope.nii.gz --covsplitfile=cov_split.mat --designfile=design.mat --ld=stats --maskfile=mask.nii --runmode=fe --tcontrastsfile=design.con --varcopefile=varcope.nii.gz'
Inputs:
[Mandatory]
cope_file: (a pathlike object or string representing an existing
file)
cope regressor data file
argument: ``--copefile=%s``
mask_file: (a pathlike object or string representing an existing
file)
mask file
argument: ``--maskfile=%s``
design_file: (a pathlike object or string representing an existing
file)
design matrix file
argument: ``--designfile=%s``
t_con_file: (a pathlike object or string representing an existing
file)
ascii matrix specifying t-contrasts
argument: ``--tcontrastsfile=%s``
cov_split_file: (a pathlike object or string representing an existing
file)
ascii matrix specifying the groups the covariance is split into
argument: ``--covsplitfile=%s``
run_mode: ('fe' or 'ols' or 'flame1' or 'flame12')
inference to perform
argument: ``--runmode=%s``
[Optional]
var_cope_file: (a pathlike object or string representing an existing
file)
varcope weightings data file
argument: ``--varcopefile=%s``
dof_var_cope_file: (a pathlike object or string representing an
existing file)
dof data file for varcope data
argument: ``--dofvarcopefile=%s``
f_con_file: (a pathlike object or string representing an existing
file)
ascii matrix specifying f-contrasts
argument: ``--fcontrastsfile=%s``
n_jumps: (an integer (int or long))
number of jumps made by mcmc
argument: ``--njumps=%d``
burnin: (an integer (int or long))
number of jumps at start of mcmc to be discarded
argument: ``--burnin=%d``
sample_every: (an integer (int or long))
number of jumps for each sample
argument: ``--sampleevery=%d``
fix_mean: (a boolean)
fix mean for tfit
argument: ``--fixmean``
infer_outliers: (a boolean)
infer outliers - not for fe
argument: ``--inferoutliers``
no_pe_outputs: (a boolean)
do not output pe files
argument: ``--nopeoutput``
sigma_dofs: (an integer (int or long))
sigma (in mm) to use for Gaussian smoothing the DOFs in FLAME 2.
Default is 1mm, -1 indicates no smoothing
argument: ``--sigma_dofs=%d``
outlier_iter: (an integer (int or long))
Number of max iterations to use when inferring outliers. Default is
12.
argument: ``--ioni=%d``
log_dir: (a pathlike object or string representing a directory,
nipype default value: stats)
argument: ``--ld=%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:
pes: (a list of items which are a pathlike object or string
representing an existing file)
Parameter estimates for each column of the design matrix for each
voxel
res4d: (a list of items which are a pathlike object or string
representing an existing file)
Model fit residual mean-squared error for each time point
copes: (a list of items which are a pathlike object or string
representing an existing file)
Contrast estimates for each contrast
var_copes: (a list of items which are a pathlike object or string
representing an existing file)
Variance estimates for each contrast
zstats: (a list of items which are a pathlike object or string
representing an existing file)
z-stat file for each contrast
tstats: (a list of items which are a pathlike object or string
representing an existing file)
t-stat file for each contrast
zfstats: (a list of items which are a pathlike object or string
representing an existing file)
z stat file for each f contrast
fstats: (a list of items which are a pathlike object or string
representing an existing file)
f-stat file for each contrast
mrefvars: (a list of items which are a pathlike object or string
representing an existing file)
mean random effect variances for each contrast
tdof: (a list of items which are a pathlike object or string
representing an existing file)
temporal dof file for each contrast
weights: (a list of items which are a pathlike object or string
representing an existing file)
weights file for each contrast
stats_dir: (a pathlike object or string representing a directory)
directory storing model estimation output
References:¶
None None
GLM¶
Wraps the executable command fsl_glm
.
FSL GLM:
Example¶
>>> import nipype.interfaces.fsl as fsl
>>> glm = fsl.GLM(in_file='functional.nii', design='maps.nii', output_type='NIFTI')
>>> glm.cmdline
'fsl_glm -i functional.nii -d maps.nii -o functional_glm.nii'
Inputs:
[Mandatory]
in_file: (a pathlike object or string representing an existing file)
input file name (text matrix or 3D/4D image file)
argument: ``-i %s``, position: 1
design: (a pathlike object or string representing an existing file)
file name of the GLM design matrix (text time courses for temporal
regression or an image file for spatial regression)
argument: ``-d %s``, position: 2
[Optional]
out_file: (a pathlike object or string representing a file)
filename for GLM parameter estimates (GLM betas)
argument: ``-o %s``, position: 3
contrasts: (a pathlike object or string representing an existing
file)
matrix of t-statics contrasts
argument: ``-c %s``
mask: (a pathlike object or string representing an existing file)
mask image file name if input is image
argument: ``-m %s``
dof: (an integer (int or long))
set degrees of freedom explicitly
argument: ``--dof=%d``
des_norm: (a boolean)
switch on normalization of the design matrix columns to unit std
deviation
argument: ``--des_norm``
dat_norm: (a boolean)
switch on normalization of the data time series to unit std
deviation
argument: ``--dat_norm``
var_norm: (a boolean)
perform MELODIC variance-normalisation on data
argument: ``--vn``
demean: (a boolean)
switch on demeaining of design and data
argument: ``--demean``
out_cope: (a pathlike object or string representing a file)
output file name for COPE (either as txt or image
argument: ``--out_cope=%s``
out_z_name: (a pathlike object or string representing a file)
output file name for Z-stats (either as txt or image
argument: ``--out_z=%s``
out_t_name: (a pathlike object or string representing a file)
output file name for t-stats (either as txt or image
argument: ``--out_t=%s``
out_p_name: (a pathlike object or string representing a file)
output file name for p-values of Z-stats (either as text file or
image)
argument: ``--out_p=%s``
out_f_name: (a pathlike object or string representing a file)
output file name for F-value of full model fit
argument: ``--out_f=%s``
out_pf_name: (a pathlike object or string representing a file)
output file name for p-value for full model fit
argument: ``--out_pf=%s``
out_res_name: (a pathlike object or string representing a file)
output file name for residuals
argument: ``--out_res=%s``
out_varcb_name: (a pathlike object or string representing a file)
output file name for variance of COPEs
argument: ``--out_varcb=%s``
out_sigsq_name: (a pathlike object or string representing a file)
output file name for residual noise variance sigma-square
argument: ``--out_sigsq=%s``
out_data_name: (a pathlike object or string representing a file)
output file name for pre-processed data
argument: ``--out_data=%s``
out_vnscales_name: (a pathlike object or string representing a file)
output file name for scaling factors for variance normalisation
argument: ``--out_vnscales=%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: (a pathlike object or string representing an existing file)
file name of GLM parameters (if generated)
out_cope: (a list of items which are a pathlike object or string
representing an existing file)
output file name for COPEs (either as text file or image)
out_z: (a list of items which are a pathlike object or string
representing an existing file)
output file name for COPEs (either as text file or image)
out_t: (a list of items which are a pathlike object or string
representing an existing file)
output file name for t-stats (either as text file or image)
out_p: (a list of items which are a pathlike object or string
representing an existing file)
output file name for p-values of Z-stats (either as text file or
image)
out_f: (a list of items which are a pathlike object or string
representing an existing file)
output file name for F-value of full model fit
out_pf: (a list of items which are a pathlike object or string
representing an existing file)
output file name for p-value for full model fit
out_res: (a list of items which are a pathlike object or string
representing an existing file)
output file name for residuals
out_varcb: (a list of items which are a pathlike object or string
representing an existing file)
output file name for variance of COPEs
out_sigsq: (a list of items which are a pathlike object or string
representing an existing file)
output file name for residual noise variance sigma-square
out_data: (a list of items which are a pathlike object or string
representing an existing file)
output file for preprocessed data
out_vnscales: (a list of items which are a pathlike object or string
representing an existing file)
output file name for scaling factors for variance normalisation
References:¶
None
L2Model¶
Generate subject specific second level model
Examples¶
>>> from nipype.interfaces.fsl import L2Model
>>> model = L2Model(num_copes=3) # 3 sessions
Inputs:
[Mandatory]
num_copes: (a long integer >= 1)
number of copes to be combined
Outputs:
design_mat: (a pathlike object or string representing an existing
file)
design matrix file
design_con: (a pathlike object or string representing an existing
file)
design contrast file
design_grp: (a pathlike object or string representing an existing
file)
design group file
Level1Design¶
Generate FEAT specific files
Examples¶
>>> level1design = Level1Design()
>>> level1design.inputs.interscan_interval = 2.5
>>> level1design.inputs.bases = {'dgamma':{'derivs': False}}
>>> level1design.inputs.session_info = 'session_info.npz'
>>> level1design.run() # doctest: +SKIP
Inputs:
[Mandatory]
interscan_interval: (a float)
Interscan interval (in secs)
session_info: (any value)
Session specific information generated by ``modelgen.SpecifyModel``
bases: (a dictionary with keys which are 'dgamma' and with values
which are a dictionary with keys which are 'derivs' and with
values which are a boolean or a dictionary with keys which are
'gamma' and with values which are a dictionary with keys which are
'derivs' or 'gammasigma' or 'gammadelay' and with values which are
any value or a dictionary with keys which are 'custom' and with
values which are a dictionary with keys which are 'bfcustompath'
and with values which are a unicode string or a dictionary with
keys which are 'none' and with values which are a dictionary with
keys which are any value and with values which are any value or a
dictionary with keys which are 'none' and with values which are
None)
name of basis function and options e.g., {'dgamma': {'derivs':
True}}
model_serial_correlations: (a boolean)
Option to model serial correlations using an autoregressive
estimator (order 1). Setting this option is only useful in the
context of the fsf file. If you set this to False, you need to
repeat this option for FILMGLS by setting autocorr_noestimate to
True
[Optional]
orthogonalization: (a dictionary with keys which are an integer (int
or long) and with values which are a dictionary with keys which
are an integer (int or long) and with values which are a boolean
or an integer (int or long), nipype default value: {})
which regressors to make orthogonal e.g., {1: {0:0,1:0,2:0}, 2:
{0:1,1:1,2:0}} to make the second regressor in a 2-regressor model
orthogonal to the first.
contrasts: (a list of items which are a tuple of the form: (a unicode
string, 'T', a list of items which are a unicode string, a list of
items which are a float) or a tuple of the form: (a unicode
string, 'T', a list of items which are a unicode string, a list of
items which are a float, a list of items which are a float) or a
tuple of the form: (a unicode string, 'F', a list of items which
are a tuple of the form: (a unicode string, 'T', a list of items
which are a unicode string, a list of items which are a float) or
a tuple of the form: (a unicode string, 'T', a list of items which
are a unicode string, a list of items which are a float, a list of
items which are a float)))
List of contrasts with each contrast being a list of the form -
[('name', 'stat', [condition list], [weight list], [session list])].
if session list is None or not provided, all sessions are used. For
F contrasts, the condition list should contain previously defined
T-contrasts.
Outputs:
fsf_files: (a list of items which are a pathlike object or string
representing an existing file)
FSL feat specification files
ev_files: (a list of items which are a list of items which are a
pathlike object or string representing an existing file)
condition information files
MELODIC¶
Wraps the executable command melodic
.
Multivariate Exploratory Linear Optimised Decomposition into Independent Components
Examples¶
>>> melodic_setup = MELODIC()
>>> melodic_setup.inputs.approach = 'tica'
>>> melodic_setup.inputs.in_files = ['functional.nii', 'functional2.nii', 'functional3.nii']
>>> melodic_setup.inputs.no_bet = True
>>> melodic_setup.inputs.bg_threshold = 10
>>> melodic_setup.inputs.tr_sec = 1.5
>>> melodic_setup.inputs.mm_thresh = 0.5
>>> melodic_setup.inputs.out_stats = True
>>> melodic_setup.inputs.t_des = 'timeDesign.mat'
>>> melodic_setup.inputs.t_con = 'timeDesign.con'
>>> melodic_setup.inputs.s_des = 'subjectDesign.mat'
>>> melodic_setup.inputs.s_con = 'subjectDesign.con'
>>> melodic_setup.inputs.out_dir = 'groupICA.out'
>>> melodic_setup.cmdline
'melodic -i functional.nii,functional2.nii,functional3.nii -a tica --bgthreshold=10.000000 --mmthresh=0.500000 --nobet -o groupICA.out --Ostats --Scon=subjectDesign.con --Sdes=subjectDesign.mat --Tcon=timeDesign.con --Tdes=timeDesign.mat --tr=1.500000'
>>> melodic_setup.run() # doctest: +SKIP
Inputs:
[Mandatory]
in_files: (a list of items which are a pathlike object or string
representing an existing file)
input file names (either single file name or a list)
argument: ``-i %s``, position: 0
[Optional]
out_dir: (a pathlike object or string representing a directory)
output directory name
argument: ``-o %s``
mask: (a pathlike object or string representing an existing file)
file name of mask for thresholding
argument: ``-m %s``
no_mask: (a boolean)
switch off masking
argument: ``--nomask``
update_mask: (a boolean)
switch off mask updating
argument: ``--update_mask``
no_bet: (a boolean)
switch off BET
argument: ``--nobet``
bg_threshold: (a float)
brain/non-brain threshold used to mask non-brain voxels, as a
percentage (only if --nobet selected)
argument: ``--bgthreshold=%f``
dim: (an integer (int or long))
dimensionality reduction into #num dimensions (default: automatic
estimation)
argument: ``-d %d``
dim_est: (a unicode string)
use specific dim. estimation technique: lap, bic, mdl, aic, mean
(default: lap)
argument: ``--dimest=%s``
sep_whiten: (a boolean)
switch on separate whitening
argument: ``--sep_whiten``
sep_vn: (a boolean)
switch off joined variance normalization
argument: ``--sep_vn``
migp: (a boolean)
switch on MIGP data reduction
argument: ``--migp``
migpN: (an integer (int or long))
number of internal Eigenmaps
argument: ``--migpN %d``
migp_shuffle: (a boolean)
randomise MIGP file order (default: TRUE)
argument: ``--migp_shuffle``
migp_factor: (an integer (int or long))
Internal Factor of mem-threshold relative to number of Eigenmaps
(default: 2)
argument: ``--migp_factor %d``
num_ICs: (an integer (int or long))
number of IC's to extract (for deflation approach)
argument: ``-n %d``
approach: (a unicode string)
approach for decomposition, 2D: defl, symm (default), 3D: tica
(default), concat
argument: ``-a %s``
non_linearity: (a unicode string)
nonlinearity: gauss, tanh, pow3, pow4
argument: ``--nl=%s``
var_norm: (a boolean)
switch off variance normalization
argument: ``--vn``
pbsc: (a boolean)
switch off conversion to percent BOLD signal change
argument: ``--pbsc``
cov_weight: (a float)
voxel-wise weights for the covariance matrix (e.g. segmentation
information)
argument: ``--covarweight=%f``
epsilon: (a float)
minimum error change
argument: ``--eps=%f``
epsilonS: (a float)
minimum error change for rank-1 approximation in TICA
argument: ``--epsS=%f``
maxit: (an integer (int or long))
maximum number of iterations before restart
argument: ``--maxit=%d``
max_restart: (an integer (int or long))
maximum number of restarts
argument: ``--maxrestart=%d``
mm_thresh: (a float)
threshold for Mixture Model based inference
argument: ``--mmthresh=%f``
no_mm: (a boolean)
switch off mixture modelling on IC maps
argument: ``--no_mm``
ICs: (a pathlike object or string representing an existing file)
filename of the IC components file for mixture modelling
argument: ``--ICs=%s``
mix: (a pathlike object or string representing an existing file)
mixing matrix for mixture modelling / filtering
argument: ``--mix=%s``
smode: (a pathlike object or string representing an existing file)
matrix of session modes for report generation
argument: ``--smode=%s``
rem_cmp: (a list of items which are an integer (int or long))
component numbers to remove
argument: ``-f %d``
report: (a boolean)
generate Melodic web report
argument: ``--report``
bg_image: (a pathlike object or string representing an existing file)
specify background image for report (default: mean image)
argument: ``--bgimage=%s``
tr_sec: (a float)
TR in seconds
argument: ``--tr=%f``
log_power: (a boolean)
calculate log of power for frequency spectrum
argument: ``--logPower``
t_des: (a pathlike object or string representing an existing file)
design matrix across time-domain
argument: ``--Tdes=%s``
t_con: (a pathlike object or string representing an existing file)
t-contrast matrix across time-domain
argument: ``--Tcon=%s``
s_des: (a pathlike object or string representing an existing file)
design matrix across subject-domain
argument: ``--Sdes=%s``
s_con: (a pathlike object or string representing an existing file)
t-contrast matrix across subject-domain
argument: ``--Scon=%s``
out_all: (a boolean)
output everything
argument: ``--Oall``
out_unmix: (a boolean)
output unmixing matrix
argument: ``--Ounmix``
out_stats: (a boolean)
output thresholded maps and probability maps
argument: ``--Ostats``
out_pca: (a boolean)
output PCA results
argument: ``--Opca``
out_white: (a boolean)
output whitening/dewhitening matrices
argument: ``--Owhite``
out_orig: (a boolean)
output the original ICs
argument: ``--Oorig``
out_mean: (a boolean)
output mean volume
argument: ``--Omean``
report_maps: (a unicode string)
control string for spatial map images (see slicer)
argument: ``--report_maps=%s``
remove_deriv: (a boolean)
removes every second entry in paradigm file (EV derivatives)
argument: ``--remove_deriv``
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_dir: (a pathlike object or string representing an existing
directory)
report_dir: (a pathlike object or string representing an existing
directory)
References:¶
None
MultipleRegressDesign¶
Generate multiple regression design
Note
FSL does not demean columns for higher level analysis.
Please see FSL documentation for more details on model specification for higher level analysis.
Examples¶
>>> from nipype.interfaces.fsl import MultipleRegressDesign
>>> model = MultipleRegressDesign()
>>> model.inputs.contrasts = [['group mean', 'T',['reg1'],[1]]]
>>> model.inputs.regressors = dict(reg1=[1, 1, 1], reg2=[2.,-4, 3])
>>> model.run() # doctest: +SKIP
Inputs:
[Mandatory]
contrasts: (a list of items which are a tuple of the form: (a unicode
string, 'T', a list of items which are a unicode string, a list of
items which are a float) or a tuple of the form: (a unicode
string, 'F', a list of items which are a tuple of the form: (a
unicode string, 'T', a list of items which are a unicode string, a
list of items which are a float)))
List of contrasts with each contrast being a list of the form -
[('name', 'stat', [condition list], [weight list])]. if session list
is None or not provided, all sessions are used. For F contrasts, the
condition list should contain previously defined T-contrasts without
any weight list.
regressors: (a dictionary with keys which are a unicode string and
with values which are a list of items which are a float)
dictionary containing named lists of regressors
[Optional]
groups: (a list of items which are an integer (int or long))
list of group identifiers (defaults to single group)
Outputs:
design_mat: (a pathlike object or string representing an existing
file)
design matrix file
design_con: (a pathlike object or string representing an existing
file)
design t-contrast file
design_fts: (a pathlike object or string representing an existing
file)
design f-contrast file
design_grp: (a pathlike object or string representing an existing
file)
design group file
Randomise¶
Wraps the executable command randomise
.
FSL Randomise: feeds the 4D projected FA data into GLM modelling and thresholding in order to find voxels which correlate with your model
Example¶
>>> import nipype.interfaces.fsl as fsl
>>> rand = fsl.Randomise(in_file='allFA.nii', mask = 'mask.nii', tcon='design.con', design_mat='design.mat')
>>> rand.cmdline
'randomise -i allFA.nii -o "randomise" -d design.mat -t design.con -m mask.nii'
Inputs:
[Mandatory]
in_file: (a pathlike object or string representing an existing file)
4D input file
argument: ``-i %s``, position: 0
[Optional]
base_name: (a unicode string, nipype default value: randomise)
the rootname that all generated files will have
argument: ``-o "%s"``, position: 1
design_mat: (a pathlike object or string representing an existing
file)
design matrix file
argument: ``-d %s``, position: 2
tcon: (a pathlike object or string representing an existing file)
t contrasts file
argument: ``-t %s``, position: 3
fcon: (a pathlike object or string representing an existing file)
f contrasts file
argument: ``-f %s``
mask: (a pathlike object or string representing an existing file)
mask image
argument: ``-m %s``
x_block_labels: (a pathlike object or string representing an existing
file)
exchangeability block labels file
argument: ``-e %s``
demean: (a boolean)
demean data temporally before model fitting
argument: ``-D``
one_sample_group_mean: (a boolean)
perform 1-sample group-mean test instead of generic permutation test
argument: ``-1``
show_total_perms: (a boolean)
print out how many unique permutations would be generated and exit
argument: ``-q``
show_info_parallel_mode: (a boolean)
print out information required for parallel mode and exit
argument: ``-Q``
vox_p_values: (a boolean)
output voxelwise (corrected and uncorrected) p-value images
argument: ``-x``
tfce: (a boolean)
carry out Threshold-Free Cluster Enhancement
argument: ``-T``
tfce2D: (a boolean)
carry out Threshold-Free Cluster Enhancement with 2D optimisation
argument: ``--T2``
f_only: (a boolean)
calculate f-statistics only
argument: ``--f_only``
raw_stats_imgs: (a boolean)
output raw ( unpermuted ) statistic images
argument: ``-R``
p_vec_n_dist_files: (a boolean)
output permutation vector and null distribution text files
argument: ``-P``
num_perm: (an integer (int or long))
number of permutations (default 5000, set to 0 for exhaustive)
argument: ``-n %d``
seed: (an integer (int or long))
specific integer seed for random number generator
argument: ``--seed=%d``
var_smooth: (an integer (int or long))
use variance smoothing (std is in mm)
argument: ``-v %d``
c_thresh: (a float)
carry out cluster-based thresholding
argument: ``-c %.1f``
cm_thresh: (a float)
carry out cluster-mass-based thresholding
argument: ``-C %.1f``
f_c_thresh: (a float)
carry out f cluster thresholding
argument: ``-F %.2f``
f_cm_thresh: (a float)
carry out f cluster-mass thresholding
argument: ``-S %.2f``
tfce_H: (a float)
TFCE height parameter (default=2)
argument: ``--tfce_H=%.2f``
tfce_E: (a float)
TFCE extent parameter (default=0.5)
argument: ``--tfce_E=%.2f``
tfce_C: (a float)
TFCE connectivity (6 or 26; default=6)
argument: ``--tfce_C=%.2f``
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:
tstat_files: (a list of items which are a pathlike object or string
representing an existing file)
t contrast raw statistic
fstat_files: (a list of items which are a pathlike object or string
representing an existing file)
f contrast raw statistic
t_p_files: (a list of items which are a pathlike object or string
representing an existing file)
f contrast uncorrected p values files
f_p_files: (a list of items which are a pathlike object or string
representing an existing file)
f contrast uncorrected p values files
t_corrected_p_files: (a list of items which are a pathlike object or
string representing an existing file)
t contrast FWE (Family-wise error) corrected p values files
f_corrected_p_files: (a list of items which are a pathlike object or
string representing an existing file)
f contrast FWE (Family-wise error) corrected p values files
References:¶
None
SMM¶
Wraps the executable command mm --ld=logdir
.
Spatial Mixture Modelling. For more detail on the spatial mixture modelling see Mixture Models with Adaptive Spatial Regularisation for Segmentation with an Application to FMRI Data; Woolrich, M., Behrens, T., Beckmann, C., and Smith, S.; IEEE Trans. Medical Imaging, 24(1):1-11, 2005.
Inputs:
[Mandatory]
spatial_data_file: (a pathlike object or string representing an
existing file)
statistics spatial map
argument: ``--sdf="%s"``, position: 0
mask: (a pathlike object or string representing an existing file)
mask file
argument: ``--mask="%s"``, position: 1
[Optional]
no_deactivation_class: (a boolean)
enforces no deactivation class
argument: ``--zfstatmode``, 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:
null_p_map: (a pathlike object or string representing an existing
file)
activation_p_map: (a pathlike object or string representing an
existing file)
deactivation_p_map: (a pathlike object or string representing an
existing file)
References:¶
None
SmoothEstimate¶
Wraps the executable command smoothest
.
Estimates the smoothness of an image
Examples¶
>>> est = SmoothEstimate()
>>> est.inputs.zstat_file = 'zstat1.nii.gz'
>>> est.inputs.mask_file = 'mask.nii'
>>> est.cmdline
'smoothest --mask=mask.nii --zstat=zstat1.nii.gz'
Inputs:
[Mandatory]
dof: (an integer (int or long))
number of degrees of freedom
argument: ``--dof=%d``
mutually_exclusive: zstat_file
mask_file: (a pathlike object or string representing an existing
file)
brain mask volume
argument: ``--mask=%s``
[Optional]
residual_fit_file: (a pathlike object or string representing an
existing file)
residual-fit image file
argument: ``--res=%s``
requires: dof
zstat_file: (a pathlike object or string representing an existing
file)
zstat image file
argument: ``--zstat=%s``
mutually_exclusive: dof
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:
dlh: (a float)
smoothness estimate sqrt(det(Lambda))
volume: (an integer (int or long))
number of voxels in mask
resels: (a float)
number of resels
References:¶
None