interfaces.freesurfer.model

Binarize

Link to code

Wraps the executable command mri_binarize.

Use FreeSurfer mri_binarize to threshold an input volume

Examples

>>> binvol = Binarize(in_file='structural.nii', min=10, binary_file='foo_out.nii')
>>> binvol.cmdline
'mri_binarize --o foo_out.nii --i structural.nii --min 10.000000'

Inputs:

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

[Optional]
binary_file: (a file name)
        binary output volume
        argument: ``--o %s``
count_file: (a boolean or a file name)
        save number of hits in ascii file (hits, ntotvox, pct)
        argument: ``--count %s``
frame_no: (an integer (int or long))
        use 0-based frame of input (default is 0)
        argument: ``--frame %s``
bin_val_not: (an integer (int or long))
        set vox outside range to val (default is 0)
        argument: ``--binvalnot %d``
zero_edges: (a boolean)
        zero the edge voxels
        argument: ``--zero-edges``
bin_val: (an integer (int or long))
        set vox within thresh to val (default is 1)
        argument: ``--binval %d``
rmin: (a float)
        compute min based on rmin*globalmean
        argument: ``--rmin %f``
dilate: (an integer (int or long))
        niters: dilate binarization in 3D
        argument: ``--dilate %d``
invert: (a boolean)
        set binval=0, binvalnot=1
        argument: ``--inv``
erode2d: (an integer (int or long))
        nerode2d: erode binarization in 2D (after any 3D erosion)
        argument: ``--erode2d %d``
abs: (a boolean)
        take abs of invol first (ie, make unsigned)
        argument: ``--abs``
match: (a list of items which are an integer (int or long))
        match instead of threshold
        argument: ``--match %d...``
zero_slice_edge: (a boolean)
        zero the edge slice voxels
        argument: ``--zero-slice-edges``
out_type: (u'nii' or u'nii.gz' or u'mgz')
        output file type
erode: (an integer (int or long))
        nerode: erode binarization in 3D (after any dilation)
        argument: ``--erode  %d``
max: (a float)
        max thresh
        argument: ``--max %f``
        mutually_exclusive: wm_ven_csf
wm: (a boolean)
        set match vals to 2 and 41 (aseg for cerebral WM)
        argument: ``--wm``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
rmax: (a float)
        compute max based on rmax*globalmean
        argument: ``--rmax %f``
wm_ven_csf: (a boolean)
        WM and ventricular CSF, including choroid (not 4th)
        argument: ``--wm+vcsf``
        mutually_exclusive: min, max
subjects_dir: (an existing directory name)
        subjects directory
ventricles: (a boolean)
        set match vals those for aseg ventricles+choroid (not 4th)
        argument: ``--ventricles``
bin_col_num: (a boolean)
        set binarized voxel value to its column number
        argument: ``--bincol``
min: (a float)
        min thresh
        argument: ``--min %f``
        mutually_exclusive: wm_ven_csf
merge_file: (an existing file name)
        merge with mergevol
        argument: ``--merge %s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
mask_thresh: (a float)
        set thresh for mask
        argument: ``--mask-thresh %f``
mask_file: (an existing file name)
        must be within mask
        argument: ``--mask maskvol``

Outputs:

count_file: (a file name)
        ascii file containing number of hits
binary_file: (an existing file name)
        binarized output volume

Concatenate

Link to code

Wraps the executable command mri_concat.

Use Freesurfer mri_concat to combine several input volumes into one output volume. Can concatenate by frames, or compute a variety of statistics on the input volumes.

Examples

Combine two input volumes into one volume with two frames

>>> concat = Concatenate()
>>> concat.inputs.in_files = ['cont1.nii', 'cont2.nii']
>>> concat.inputs.concatenated_file = 'bar.nii'
>>> concat.cmdline
'mri_concat --o bar.nii --i cont1.nii --i cont2.nii'

Inputs:

[Mandatory]
in_files: (a list of items which are an existing file name)
        Individual volumes to be concatenated
        argument: ``--i %s...``

[Optional]
sort: (a boolean)
        Sort each voxel by ascending frame value
        argument: ``--sort``
keep_dtype: (a boolean)
        Keep voxelwise precision type (default is float
        argument: ``--keep-datatype``
mean_div_n: (a boolean)
        compute mean/nframes (good for var)
        argument: ``--mean-div-n``
stats: (u'sum' or u'var' or u'std' or u'max' or u'min' or u'mean')
        Compute the sum, var, std, max, min or mean of the input volumes
        argument: ``--%s``
concatenated_file: (a file name)
        Output volume
        argument: ``--o %s``
combine: (a boolean)
        Combine non-zero values into single frame volume
        argument: ``--combine``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
add_val: (a float)
        Add some amount to the input volume
        argument: ``--add %f``
sign: (u'abs' or u'pos' or u'neg')
        Take only pos or neg voxles from input, or take abs
        argument: ``--%s``
mask_file: (an existing file name)
        Mask input with a volume
        argument: ``--mask %s``
max_bonfcor: (a boolean)
        Compute max and bonferroni correct (assumes -log10(ps))
        argument: ``--max-bonfcor``
gmean: (an integer (int or long))
        create matrix to average Ng groups, Nper=Ntot/Ng
        argument: ``--gmean %d``
subjects_dir: (an existing directory name)
        subjects directory
vote: (a boolean)
        Most frequent value at each voxel and fraction of occurances
        argument: ``--vote``
multiply_matrix_file: (an existing file name)
        Multiply input by an ascii matrix in file
        argument: ``--mtx %s``
max_index: (a boolean)
        Compute the index of max voxel in concatenated volumes
        argument: ``--max-index``
paired_stats: (u'sum' or u'avg' or u'diff' or u'diff-norm' or u'diff-
          norm1' or u'diff-norm2')
        Compute paired sum, avg, or diff
        argument: ``--paired-%s``
multiply_by: (a float)
        Multiply input volume by some amount
        argument: ``--mul %f``

Outputs:

concatenated_file: (an existing file name)
        Path/name of the output volume

GLMFit

Link to code

Wraps the executable command mri_glmfit.

Use FreeSurfer’s mri_glmfit to specify and estimate a general linear model.

Examples

>>> glmfit = GLMFit()
>>> glmfit.inputs.in_file = 'functional.nii'
>>> glmfit.inputs.one_sample = True
>>> glmfit.cmdline == 'mri_glmfit --glmdir %s --y functional.nii --osgm'%os.getcwd()
True

Inputs:

[Mandatory]
in_file: (a file name)
        input 4D file
        argument: ``--y %s``

[Optional]
surf: (a boolean)
        analysis is on a surface mesh
        argument: ``--surf %s %s %s``
        requires: subject_id, hemi
save_residual: (a boolean)
        save residual error (eres)
        argument: ``--eres-save``
invert_mask: (a boolean)
        invert mask
        argument: ``--mask-inv``
save_res_corr_mtx: (a boolean)
        save residual error spatial correlation matrix (eres.scm). Big!
        argument: ``--eres-scm``
fixed_fx_dof: (an integer (int or long))
        dof for fixed effects analysis
        argument: ``--ffxdof %d``
        mutually_exclusive: fixed_fx_dof_file
weight_file: (an existing file name)
        weight for each input at each voxel
        mutually_exclusive: weighted_ls
allow_repeated_subjects: (a boolean)
        allow subject names to repeat in the fsgd file (must appear before
        --fsgd
        argument: ``--allowsubjrep``
no_est_fwhm: (a boolean)
        turn off FWHM output estimation
        argument: ``--no-est-fwhm``
seed: (an integer (int or long))
        used for synthesizing noise
        argument: ``--seed %d``
design: (an existing file name)
        design matrix file
        argument: ``--X %s``
        mutually_exclusive: fsgd, design, one_sample
no_prune: (a boolean)
        do not prune
        argument: ``--no-prune``
        mutually_exclusive: prunethresh
surf_geo: (a unicode string, nipype default value: white)
        surface geometry name (e.g. white, pial)
fwhm: (a floating point number >= 0.0)
        smooth input by fwhm
        argument: ``--fwhm %f``
no_contrast_ok: (a boolean)
        do not fail if no contrasts specified
        argument: ``--no-contrasts-ok``
per_voxel_reg: (a list of items which are an existing file name)
        per-voxel regressors
        argument: ``--pvr %s...``
fixed_fx_dof_file: (a file name)
        text file with dof for fixed effects analysis
        argument: ``--ffxdofdat %d``
        mutually_exclusive: fixed_fx_dof
diag_cluster: (a boolean)
        save sig volume and exit from first sim loop
        argument: ``--diag-cluster``
check_opts: (a boolean)
        don't run anything, just check options and exit
        argument: ``--checkopts``
self_reg: (a tuple of the form: (an integer (int or long), an integer
          (int or long), an integer (int or long)))
        self-regressor from index col row slice
        argument: ``--selfreg %d %d %d``
weight_inv: (a boolean)
        invert weights
        argument: ``--w-inv``
        mutually_exclusive: weighted_ls
uniform: (a tuple of the form: (a float, a float))
        use uniform distribution instead of gaussian
        argument: ``--uniform %f %f``
var_fwhm: (a floating point number >= 0.0)
        smooth variance by fwhm
        argument: ``--var-fwhm %f``
synth: (a boolean)
        replace input with gaussian
        argument: ``--synth``
prune_thresh: (a float)
        prune threshold. Default is FLT_MIN
        argument: ``--prune_thr %f``
        mutually_exclusive: noprune
pca: (a boolean)
        perform pca/svd analysis on residual
        argument: ``--pca``
contrast: (a list of items which are an existing file name)
        contrast file
        argument: ``--C %s...``
label_file: (an existing file name)
        use label as mask, surfaces only
        argument: ``--label %s``
        mutually_exclusive: cortex
profile: (an integer (int or long))
        niters : test speed
        argument: ``--profile %d``
compute_log_y: (a boolean)
        compute natural log of y prior to analysis
        argument: ``--logy``
hemi: (u'lh' or u'rh')
        surface hemisphere
vox_dump: (a tuple of the form: (an integer (int or long), an integer
          (int or long), an integer (int or long)))
        dump voxel GLM and exit
        argument: ``--voxdump %d %d %d``
save_estimate: (a boolean)
        save signal estimate (yhat)
        argument: ``--yhat-save``
save_cond: (a boolean)
        flag to save design matrix condition at each voxel
        argument: ``--save-cond``
fsgd: (a tuple of the form: (an existing file name, u'doss' or
          u'dods'))
        freesurfer descriptor file
        argument: ``--fsgd %s %s``
        mutually_exclusive: fsgd, design, one_sample
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
calc_AR1: (a boolean)
        compute and save temporal AR1 of residual
        argument: ``--tar1``
mask_file: (an existing file name)
        binary mask
        argument: ``--mask %s``
subjects_dir: (an existing directory name)
        subjects directory
sim_sign: (u'abs' or u'pos' or u'neg')
        abs, pos, or neg
        argument: ``--sim-sign %s``
allow_ill_cond: (a boolean)
        allow ill-conditioned design matrices
        argument: ``--illcond``
force_perm: (a boolean)
        force perumtation test, even when design matrix is not orthog
        argument: ``--perm-force``
one_sample: (a boolean)
        construct X and C as a one-sample group mean
        argument: ``--osgm``
        mutually_exclusive: one_sample, fsgd, design, contrast
prune: (a boolean)
        remove voxels that do not have a non-zero value at each frame (def)
        argument: ``--prune``
fixed_fx_var: (an existing file name)
        for fixed effects analysis
        argument: ``--yffxvar %s``
no_mask_smooth: (a boolean)
        do not mask when smoothing
        argument: ``--no-mask-smooth``
simulation: (a tuple of the form: (u'perm' or u'mc-full' or u'mc-z',
          an integer (int or long), a float, a unicode string))
        nulltype nsim thresh csdbasename
        argument: ``--sim %s %d %f %s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
cortex: (a boolean)
        use subjects ?h.cortex.label as label
        argument: ``--cortex``
        mutually_exclusive: label_file
weight_sqrt: (a boolean)
        sqrt of weights
        argument: ``--w-sqrt``
        mutually_exclusive: weighted_ls
diag: (an integer (int or long))
        Gdiag_no : set diagnositc level
        argument: ``--diag %d``
debug: (a boolean)
        turn on debugging
        argument: ``--debug``
weighted_ls: (an existing file name)
        weighted least squares
        argument: ``--wls %s``
        mutually_exclusive: weight_file, weight_inv, weight_sqrt
glm_dir: (a unicode string)
        save outputs to dir
        argument: ``--glmdir %s``
subject_id: (a unicode string)
        subject id for surface geometry
resynth_test: (an integer (int or long))
        test GLM by resynthsis
        argument: ``--resynthtest %d``
sim_done_file: (a file name)
        create file when simulation finished
        argument: ``--sim-done %s``

Outputs:

frame_eigenvectors: (a file name)
        matrix of frame eigenvectors from residual PCA
spatial_eigenvectors: (a file name)
        map of spatial eigenvectors from residual PCA
gamma_var_file: (a list of items which are any value)
        map of regression contrast variance
error_var_file: (a file name)
        map of residual error variance
fwhm_file: (a file name)
        text file with estimated smoothness
ftest_file: (a list of items which are any value)
        map of test statistic values
beta_file: (an existing file name)
        map of regression coefficients
error_stddev_file: (a file name)
        map of residual error standard deviation
error_file: (a file name)
        map of residual error
gamma_file: (a list of items which are any value)
        map of contrast of regression coefficients
sig_file: (a list of items which are any value)
        map of F-test significance (in -log10p)
mask_file: (a file name)
        map of the mask used in the analysis
svd_stats_file: (a file name)
        text file summarizing the residual PCA
glm_dir: (an existing directory name)
        output directory
dof_file: (a file name)
        text file with effective degrees-of-freedom for the analysis
singular_values: (a file name)
        matrix singular values from residual PCA
estimate_file: (a file name)
        map of the estimated Y values

Label2Annot

Link to code

Wraps the executable command mris_label2annot.

Converts a set of surface labels to an annotation file

Examples

>>> from nipype.interfaces.freesurfer import Label2Annot
>>> l2a = Label2Annot()
>>> l2a.inputs.hemisphere = 'lh'
>>> l2a.inputs.subject_id = '10335'
>>> l2a.inputs.in_labels = ['lh.aparc.label']
>>> l2a.inputs.orig = 'lh.pial'
>>> l2a.inputs.out_annot = 'test'
>>> l2a.cmdline
'mris_label2annot --hemi lh --l lh.aparc.label --a test --s 10335'

Inputs:

[Mandatory]
out_annot: (a string)
        Name of the annotation to create
        argument: ``--a %s``
subject_id: (a string, nipype default value: subject_id)
        Subject name/ID
        argument: ``--s %s``
in_labels: (a list of items which are any value)
        List of input label files
        argument: ``--l %s...``
hemisphere: (u'lh' or u'rh')
        Input hemisphere
        argument: ``--hemi %s``
orig: (an existing file name)
        implicit {hemisphere}.orig

[Optional]
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
copy_inputs: (a boolean)
        copy implicit inputs and create a temp subjects_dir
verbose_off: (a boolean)
        Turn off overlap and stat override messages
        argument: ``--noverbose``
subjects_dir: (an existing directory name)
        subjects directory
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
keep_max: (a boolean)
        Keep label with highest 'stat' value
        argument: ``--maxstatwinner``
color_table: (an existing file name)
        File that defines the structure names, their indices, and their
        color
        argument: ``--ctab %s``

Outputs:

out_file: (an existing file name)
        Output annotation file

Label2Label

Link to code

Wraps the executable command mri_label2label.

Converts a label in one subject’s space to a label in another subject’s space using either talairach or spherical as an intermediate registration space.

If a source mask is used, then the input label must have been created from a surface (ie, the vertex numbers are valid). The format can be anything supported by mri_convert or curv or paint. Vertices in the source label that do not meet threshold in the mask will be removed from the label.

Examples

>>> from nipype.interfaces.freesurfer import Label2Label
>>> l2l = Label2Label()
>>> l2l.inputs.hemisphere = 'lh'
>>> l2l.inputs.subject_id = '10335'
>>> l2l.inputs.sphere_reg = 'lh.pial'
>>> l2l.inputs.white = 'lh.pial'
>>> l2l.inputs.source_subject = 'fsaverage'
>>> l2l.inputs.source_label = 'lh-pial.stl'
>>> l2l.inputs.source_white = 'lh.pial'
>>> l2l.inputs.source_sphere_reg = 'lh.pial'
>>> l2l.cmdline
'mri_label2label --hemi lh --trglabel lh-pial_converted.stl --regmethod surface --srclabel lh-pial.stl --srcsubject fsaverage --trgsubject 10335'

Inputs:

[Mandatory]
source_label: (an existing file name)
        Source label
        argument: ``--srclabel %s``
source_subject: (a string)
        Source subject name
        argument: ``--srcsubject %s``
subject_id: (a string, nipype default value: subject_id)
        Target subject
        argument: ``--trgsubject %s``
source_sphere_reg: (an existing file name)
        Implicit input <hemisphere>.sphere.reg
hemisphere: (u'lh' or u'rh')
        Input hemisphere
        argument: ``--hemi %s``
source_white: (an existing file name)
        Implicit input <hemisphere>.white
white: (an existing file name)
        Implicit input <hemisphere>.white
sphere_reg: (an existing file name)
        Implicit input <hemisphere>.sphere.reg

[Optional]
out_file: (a file name)
        Target label
        argument: ``--trglabel %s``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
copy_inputs: (a boolean)
        If running as a node, set this to True.This will copy the input
        files to the node directory.
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
subjects_dir: (an existing directory name)
        subjects directory
registration_method: (u'surface' or u'volume', nipype default value:
          surface)
        Registration method
        argument: ``--regmethod %s``

Outputs:

out_file: (an existing file name)
        Output label

Label2Vol

Link to code

Wraps the executable command mri_label2vol.

Make a binary volume from a Freesurfer label

Examples

>>> binvol = Label2Vol(label_file='cortex.label', template_file='structural.nii', reg_file='register.dat', fill_thresh=0.5, vol_label_file='foo_out.nii')
>>> binvol.cmdline
'mri_label2vol --fillthresh 0.5 --label cortex.label --reg register.dat --temp structural.nii --o foo_out.nii'

Inputs:

[Mandatory]
aparc_aseg: (a boolean)
        use aparc+aseg.mgz in subjectdir as seg
        argument: ``--aparc+aseg``
        mutually_exclusive: label_file, annot_file, seg_file, aparc_aseg
annot_file: (an existing file name)
        surface annotation file
        argument: ``--annot %s``
        mutually_exclusive: label_file, annot_file, seg_file, aparc_aseg
        requires: subject_id, hemi
seg_file: (an existing file name)
        segmentation file
        argument: ``--seg %s``
        mutually_exclusive: label_file, annot_file, seg_file, aparc_aseg
label_file: (a list of items which are an existing file name)
        list of label files
        argument: ``--label %s...``
        mutually_exclusive: label_file, annot_file, seg_file, aparc_aseg
template_file: (an existing file name)
        output template volume
        argument: ``--temp %s``

[Optional]
reg_file: (an existing file name)
        tkregister style matrix VolXYZ = R*LabelXYZ
        argument: ``--reg %s``
        mutually_exclusive: reg_file, reg_header, identity
surface: (a unicode string)
        use surface instead of white
        argument: ``--surf %s``
label_voxel_volume: (a float)
        volume of each label point (def 1mm3)
        argument: ``--labvoxvol %f``
native_vox2ras: (a boolean)
        use native vox2ras xform instead of tkregister-style
        argument: ``--native-vox2ras``
vol_label_file: (a file name)
        output volume
        argument: ``--o %s``
subject_id: (a unicode string)
        subject id
        argument: ``--subject %s``
invert_mtx: (a boolean)
        Invert the registration matrix
        argument: ``--invertmtx``
label_hit_file: (a file name)
        file with each frame is nhits for a label
        argument: ``--hits %s``
proj: (a tuple of the form: (u'abs' or u'frac', a float, a float, a
          float))
        project along surface normal
        argument: ``--proj %s %f %f %f``
        requires: subject_id, hemi
reg_header: (an existing file name)
        label template volume
        argument: ``--regheader %s``
        mutually_exclusive: reg_file, reg_header, identity
hemi: (u'lh' or u'rh')
        hemisphere to use lh or rh
        argument: ``--hemi %s``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
map_label_stat: (a file name)
        map the label stats field into the vol
        argument: ``--label-stat %s``
subjects_dir: (an existing directory name)
        subjects directory
fill_thresh: (0.0 <= a floating point number <= 1.0)
        thresh : between 0 and 1
        argument: ``--fillthresh %g``
identity: (a boolean)
        set R=I
        argument: ``--identity``
        mutually_exclusive: reg_file, reg_header, identity
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables

Outputs:

vol_label_file: (an existing file name)
        output volume

MRISPreproc

Link to code

Wraps the executable command mris_preproc.

Use FreeSurfer mris_preproc to prepare a group of contrasts for a second level analysis

Examples

>>> preproc = MRISPreproc()
>>> preproc.inputs.target = 'fsaverage'
>>> preproc.inputs.hemi = 'lh'
>>> preproc.inputs.vol_measure_file = [('cont1.nii', 'register.dat'),                                            ('cont1a.nii', 'register.dat')]
>>> preproc.inputs.out_file = 'concatenated_file.mgz'
>>> preproc.cmdline
'mris_preproc --hemi lh --out concatenated_file.mgz --target fsaverage --iv cont1.nii register.dat --iv cont1a.nii register.dat'

Inputs:

[Mandatory]
hemi: (u'lh' or u'rh')
        hemisphere for source and target
        argument: ``--hemi %s``
target: (a unicode string)
        target subject name
        argument: ``--target %s``

[Optional]
surf_dir: (a unicode string)
        alternative directory (instead of surf)
        argument: ``--surfdir %s``
out_file: (a file name)
        output filename
        argument: ``--out %s``
surf_area: (a unicode string)
        Extract vertex area from subject/surf/hemi.surfname to use as input.
        argument: ``--area %s``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
surf_measure: (a unicode string)
        Use subject/surf/hemi.surf_measure as input
        argument: ``--meas %s``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
subject_file: (an existing file name)
        file specifying subjects separated by white space
        argument: ``--f %s``
        mutually_exclusive: subjects, fsgd_file, subject_file
subjects_dir: (an existing directory name)
        subjects directory
fwhm_source: (a float)
        smooth by fwhm mm on the source surface
        argument: ``--fwhm-src %f``
        mutually_exclusive: num_iters_source
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
smooth_cortex_only: (a boolean)
        only smooth cortex (ie, exclude medial wall)
        argument: ``--smooth-cortex-only``
source_format: (a unicode string)
        source format
        argument: ``--srcfmt %s``
vol_measure_file: (a list of items which are a tuple of the form: (an
          existing file name, an existing file name))
        list of volume measure and reg file tuples
        argument: ``--iv %s %s...``
fsgd_file: (an existing file name)
        specify subjects using fsgd file
        argument: ``--fsgd %s``
        mutually_exclusive: subjects, fsgd_file, subject_file
num_iters_source: (an integer (int or long))
        niters : smooth by niters on the source surface
        argument: ``--niterssrc %d``
        mutually_exclusive: fwhm_source
subjects: (a list of items which are any value)
        subjects from who measures are calculated
        argument: ``--s %s...``
        mutually_exclusive: subjects, fsgd_file, subject_file
surf_measure_file: (a list of items which are an existing file name)
        file alternative to surfmeas, still requires list of subjects
        argument: ``--is %s...``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
fwhm: (a float)
        smooth by fwhm mm on the target surface
        argument: ``--fwhm %f``
        mutually_exclusive: num_iters
proj_frac: (a float)
        projection fraction for vol2surf
        argument: ``--projfrac %s``
num_iters: (an integer (int or long))
        niters : smooth by niters on the target surface
        argument: ``--niters %d``
        mutually_exclusive: fwhm

Outputs:

out_file: (a file name)
        preprocessed output file

MRISPreprocReconAll

Link to code

Wraps the executable command mris_preproc.

Extends MRISPreproc to allow it to be used in a recon-all workflow

Examples

>>> preproc = MRISPreprocReconAll()
>>> preproc.inputs.target = 'fsaverage'
>>> preproc.inputs.hemi = 'lh'
>>> preproc.inputs.vol_measure_file = [('cont1.nii', 'register.dat'),                                            ('cont1a.nii', 'register.dat')]
>>> preproc.inputs.out_file = 'concatenated_file.mgz'
>>> preproc.cmdline
'mris_preproc --hemi lh --out concatenated_file.mgz --s subject_id --target fsaverage --iv cont1.nii register.dat --iv cont1a.nii register.dat'

Inputs:

[Mandatory]
hemi: (u'lh' or u'rh')
        hemisphere for source and target
        argument: ``--hemi %s``
target: (a unicode string)
        target subject name
        argument: ``--target %s``

[Optional]
surf_dir: (a unicode string)
        alternative directory (instead of surf)
        argument: ``--surfdir %s``
lh_surfreg_target: (a file name)
        Implicit target surface registration file
        requires: surfreg_files
subjects_dir: (an existing directory name)
        subjects directory
fsgd_file: (an existing file name)
        specify subjects using fsgd file
        argument: ``--fsgd %s``
        mutually_exclusive: subjects, fsgd_file, subject_file
fwhm: (a float)
        smooth by fwhm mm on the target surface
        argument: ``--fwhm %f``
        mutually_exclusive: num_iters
fwhm_source: (a float)
        smooth by fwhm mm on the source surface
        argument: ``--fwhm-src %f``
        mutually_exclusive: num_iters_source
surf_measure: (a unicode string)
        Use subject/surf/hemi.surf_measure as input
        argument: ``--meas %s``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
subject_id: (a string, nipype default value: subject_id)
        subject from whom measures are calculated
        argument: ``--s %s``
        mutually_exclusive: subjects, fsgd_file, subject_file, subject_id
subject_file: (an existing file name)
        file specifying subjects separated by white space
        argument: ``--f %s``
        mutually_exclusive: subjects, fsgd_file, subject_file
rh_surfreg_target: (a file name)
        Implicit target surface registration file
        requires: surfreg_files
surf_measure_file: (an existing file name)
        file necessary for surfmeas
        argument: ``--meas %s``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
source_format: (a unicode string)
        source format
        argument: ``--srcfmt %s``
subjects: (a list of items which are any value)
        subjects from who measures are calculated
        argument: ``--s %s...``
        mutually_exclusive: subjects, fsgd_file, subject_file
surf_area: (a unicode string)
        Extract vertex area from subject/surf/hemi.surfname to use as input.
        argument: ``--area %s``
        mutually_exclusive: surf_measure, surf_measure_file, surf_area
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
copy_inputs: (a boolean)
        If running as a node, set this to True this will copy some implicit
        inputs to the node directory.
surfreg_files: (a list of items which are an existing file name)
        lh and rh input surface registration files
        argument: ``--surfreg %s``
        requires: lh_surfreg_target, rh_surfreg_target
num_iters_source: (an integer (int or long))
        niters : smooth by niters on the source surface
        argument: ``--niterssrc %d``
        mutually_exclusive: fwhm_source
smooth_cortex_only: (a boolean)
        only smooth cortex (ie, exclude medial wall)
        argument: ``--smooth-cortex-only``
vol_measure_file: (a list of items which are a tuple of the form: (an
          existing file name, an existing file name))
        list of volume measure and reg file tuples
        argument: ``--iv %s %s...``
proj_frac: (a float)
        projection fraction for vol2surf
        argument: ``--projfrac %s``
out_file: (a file name)
        output filename
        argument: ``--out %s``
num_iters: (an integer (int or long))
        niters : smooth by niters on the target surface
        argument: ``--niters %d``
        mutually_exclusive: fwhm
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables

Outputs:

out_file: (a file name)
        preprocessed output file

MS_LDA

Link to code

Wraps the executable command mri_ms_LDA.

Perform LDA reduction on the intensity space of an arbitrary # of FLASH images

Examples

>>> grey_label = 2
>>> white_label = 3
>>> zero_value = 1
>>> optimalWeights = MS_LDA(lda_labels=[grey_label, white_label],                                 label_file='label.mgz', weight_file='weights.txt',                                 shift=zero_value, vol_synth_file='synth_out.mgz',                                 conform=True, use_weights=True,                                 images=['FLASH1.mgz', 'FLASH2.mgz', 'FLASH3.mgz'])
>>> optimalWeights.cmdline
'mri_ms_LDA -conform -label label.mgz -lda 2 3 -shift 1 -W -synth synth_out.mgz -weight weights.txt FLASH1.mgz FLASH2.mgz FLASH3.mgz'

Inputs:

[Mandatory]
images: (a list of items which are an existing file name)
        list of input FLASH images
        argument: ``%s``, position: -1
weight_file: (a file name)
        filename for the LDA weights (input or output)
        argument: ``-weight %s``
lda_labels: (a list of from 2 to 2 items which are an integer (int or
          long))
        pair of class labels to optimize
        argument: ``-lda %s``
vol_synth_file: (a file name)
        filename for the synthesized output volume
        argument: ``-synth %s``

[Optional]
conform: (a boolean)
        Conform the input volumes (brain mask typically already conformed)
        argument: ``-conform``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
shift: (an integer (int or long))
        shift all values equal to the given value to zero
        argument: ``-shift %d``
mask_file: (a file name)
        filename of the brain mask volume
        argument: ``-mask %s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
label_file: (a file name)
        filename of the label volume
        argument: ``-label %s``
subjects_dir: (an existing directory name)
        subjects directory
use_weights: (a boolean)
        Use the weights from a previously generated weight file
        argument: ``-W``

Outputs:

weight_file: (an existing file name)
vol_synth_file: (an existing file name)

OneSampleTTest

Link to code

Wraps the executable command mri_glmfit.

Inputs:

[Mandatory]
in_file: (a file name)
        input 4D file
        argument: ``--y %s``

[Optional]
surf: (a boolean)
        analysis is on a surface mesh
        argument: ``--surf %s %s %s``
        requires: subject_id, hemi
save_residual: (a boolean)
        save residual error (eres)
        argument: ``--eres-save``
invert_mask: (a boolean)
        invert mask
        argument: ``--mask-inv``
save_res_corr_mtx: (a boolean)
        save residual error spatial correlation matrix (eres.scm). Big!
        argument: ``--eres-scm``
fixed_fx_dof: (an integer (int or long))
        dof for fixed effects analysis
        argument: ``--ffxdof %d``
        mutually_exclusive: fixed_fx_dof_file
weight_file: (an existing file name)
        weight for each input at each voxel
        mutually_exclusive: weighted_ls
allow_repeated_subjects: (a boolean)
        allow subject names to repeat in the fsgd file (must appear before
        --fsgd
        argument: ``--allowsubjrep``
no_est_fwhm: (a boolean)
        turn off FWHM output estimation
        argument: ``--no-est-fwhm``
seed: (an integer (int or long))
        used for synthesizing noise
        argument: ``--seed %d``
design: (an existing file name)
        design matrix file
        argument: ``--X %s``
        mutually_exclusive: fsgd, design, one_sample
no_prune: (a boolean)
        do not prune
        argument: ``--no-prune``
        mutually_exclusive: prunethresh
surf_geo: (a unicode string, nipype default value: white)
        surface geometry name (e.g. white, pial)
fwhm: (a floating point number >= 0.0)
        smooth input by fwhm
        argument: ``--fwhm %f``
no_contrast_ok: (a boolean)
        do not fail if no contrasts specified
        argument: ``--no-contrasts-ok``
per_voxel_reg: (a list of items which are an existing file name)
        per-voxel regressors
        argument: ``--pvr %s...``
fixed_fx_dof_file: (a file name)
        text file with dof for fixed effects analysis
        argument: ``--ffxdofdat %d``
        mutually_exclusive: fixed_fx_dof
diag_cluster: (a boolean)
        save sig volume and exit from first sim loop
        argument: ``--diag-cluster``
check_opts: (a boolean)
        don't run anything, just check options and exit
        argument: ``--checkopts``
self_reg: (a tuple of the form: (an integer (int or long), an integer
          (int or long), an integer (int or long)))
        self-regressor from index col row slice
        argument: ``--selfreg %d %d %d``
weight_inv: (a boolean)
        invert weights
        argument: ``--w-inv``
        mutually_exclusive: weighted_ls
uniform: (a tuple of the form: (a float, a float))
        use uniform distribution instead of gaussian
        argument: ``--uniform %f %f``
var_fwhm: (a floating point number >= 0.0)
        smooth variance by fwhm
        argument: ``--var-fwhm %f``
synth: (a boolean)
        replace input with gaussian
        argument: ``--synth``
prune_thresh: (a float)
        prune threshold. Default is FLT_MIN
        argument: ``--prune_thr %f``
        mutually_exclusive: noprune
pca: (a boolean)
        perform pca/svd analysis on residual
        argument: ``--pca``
contrast: (a list of items which are an existing file name)
        contrast file
        argument: ``--C %s...``
label_file: (an existing file name)
        use label as mask, surfaces only
        argument: ``--label %s``
        mutually_exclusive: cortex
profile: (an integer (int or long))
        niters : test speed
        argument: ``--profile %d``
compute_log_y: (a boolean)
        compute natural log of y prior to analysis
        argument: ``--logy``
hemi: (u'lh' or u'rh')
        surface hemisphere
vox_dump: (a tuple of the form: (an integer (int or long), an integer
          (int or long), an integer (int or long)))
        dump voxel GLM and exit
        argument: ``--voxdump %d %d %d``
save_estimate: (a boolean)
        save signal estimate (yhat)
        argument: ``--yhat-save``
save_cond: (a boolean)
        flag to save design matrix condition at each voxel
        argument: ``--save-cond``
fsgd: (a tuple of the form: (an existing file name, u'doss' or
          u'dods'))
        freesurfer descriptor file
        argument: ``--fsgd %s %s``
        mutually_exclusive: fsgd, design, one_sample
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
calc_AR1: (a boolean)
        compute and save temporal AR1 of residual
        argument: ``--tar1``
mask_file: (an existing file name)
        binary mask
        argument: ``--mask %s``
subjects_dir: (an existing directory name)
        subjects directory
sim_sign: (u'abs' or u'pos' or u'neg')
        abs, pos, or neg
        argument: ``--sim-sign %s``
allow_ill_cond: (a boolean)
        allow ill-conditioned design matrices
        argument: ``--illcond``
force_perm: (a boolean)
        force perumtation test, even when design matrix is not orthog
        argument: ``--perm-force``
one_sample: (a boolean)
        construct X and C as a one-sample group mean
        argument: ``--osgm``
        mutually_exclusive: one_sample, fsgd, design, contrast
prune: (a boolean)
        remove voxels that do not have a non-zero value at each frame (def)
        argument: ``--prune``
fixed_fx_var: (an existing file name)
        for fixed effects analysis
        argument: ``--yffxvar %s``
no_mask_smooth: (a boolean)
        do not mask when smoothing
        argument: ``--no-mask-smooth``
simulation: (a tuple of the form: (u'perm' or u'mc-full' or u'mc-z',
          an integer (int or long), a float, a unicode string))
        nulltype nsim thresh csdbasename
        argument: ``--sim %s %d %f %s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
cortex: (a boolean)
        use subjects ?h.cortex.label as label
        argument: ``--cortex``
        mutually_exclusive: label_file
weight_sqrt: (a boolean)
        sqrt of weights
        argument: ``--w-sqrt``
        mutually_exclusive: weighted_ls
diag: (an integer (int or long))
        Gdiag_no : set diagnositc level
        argument: ``--diag %d``
debug: (a boolean)
        turn on debugging
        argument: ``--debug``
weighted_ls: (an existing file name)
        weighted least squares
        argument: ``--wls %s``
        mutually_exclusive: weight_file, weight_inv, weight_sqrt
glm_dir: (a unicode string)
        save outputs to dir
        argument: ``--glmdir %s``
subject_id: (a unicode string)
        subject id for surface geometry
resynth_test: (an integer (int or long))
        test GLM by resynthsis
        argument: ``--resynthtest %d``
sim_done_file: (a file name)
        create file when simulation finished
        argument: ``--sim-done %s``

Outputs:

frame_eigenvectors: (a file name)
        matrix of frame eigenvectors from residual PCA
spatial_eigenvectors: (a file name)
        map of spatial eigenvectors from residual PCA
gamma_var_file: (a list of items which are any value)
        map of regression contrast variance
error_var_file: (a file name)
        map of residual error variance
fwhm_file: (a file name)
        text file with estimated smoothness
ftest_file: (a list of items which are any value)
        map of test statistic values
beta_file: (an existing file name)
        map of regression coefficients
error_stddev_file: (a file name)
        map of residual error standard deviation
error_file: (a file name)
        map of residual error
gamma_file: (a list of items which are any value)
        map of contrast of regression coefficients
sig_file: (a list of items which are any value)
        map of F-test significance (in -log10p)
mask_file: (a file name)
        map of the mask used in the analysis
svd_stats_file: (a file name)
        text file summarizing the residual PCA
glm_dir: (an existing directory name)
        output directory
dof_file: (a file name)
        text file with effective degrees-of-freedom for the analysis
singular_values: (a file name)
        matrix singular values from residual PCA
estimate_file: (a file name)
        map of the estimated Y values

SegStats

Link to code

Wraps the executable command mri_segstats.

Use FreeSurfer mri_segstats for ROI analysis

Examples

>>> import nipype.interfaces.freesurfer as fs
>>> ss = fs.SegStats()
>>> ss.inputs.annot = ('PWS04', 'lh', 'aparc')
>>> ss.inputs.in_file = 'functional.nii'
>>> ss.inputs.subjects_dir = '.'
>>> ss.inputs.avgwf_txt_file = 'avgwf.txt'
>>> ss.inputs.summary_file = 'summary.stats'
>>> ss.cmdline
'mri_segstats --annot PWS04 lh aparc --avgwf ./avgwf.txt --i functional.nii --sum ./summary.stats'

Inputs:

[Mandatory]
surf_label: (a tuple of the form: (a unicode string, u'lh' or u'rh',
          a unicode string))
        subject hemi label : use surface label
        argument: ``--slabel %s %s %s``
        mutually_exclusive: segmentation_file, annot, surf_label
segmentation_file: (an existing file name)
        segmentation volume path
        argument: ``--seg %s``
        mutually_exclusive: segmentation_file, annot, surf_label
annot: (a tuple of the form: (a unicode string, u'lh' or u'rh', a
          unicode string))
        subject hemi parc : use surface parcellation
        argument: ``--annot %s %s %s``
        mutually_exclusive: segmentation_file, annot, surf_label

[Optional]
exclude_ctx_gm_wm: (a boolean)
        exclude cortical gray and white matter
        argument: ``--excl-ctxgmwm``
calc_snr: (a boolean)
        save mean/std as extra column in output table
        argument: ``--snr``
frame: (an integer (int or long))
        Report stats on nth frame of input volume
        argument: ``--frame %d``
cortex_vol_from_surf: (a boolean)
        Compute cortex volume from surf
        argument: ``--surf-ctx-vol``
sf_avg_file: (a boolean or a file name)
        Save mean across space and time
        argument: ``--sfavg %s``
etiv: (a boolean)
        Compute ICV from talairach transform
        argument: ``--etiv``
brainmask_file: (an existing file name)
        Load brain mask and compute the volume of the brain as the non-zero
        voxels in this volume
        argument: ``--brainmask %s``
exclude_id: (an integer (int or long))
        Exclude seg id from report
        argument: ``--excludeid %d``
etiv_only: (u'etiv' or u'old-etiv' or u'--%s-only')
        Compute etiv and exit. Use ``etiv`` or ``old-etiv``
subcort_gm: (a boolean)
        Compute volume of subcortical gray matter
        argument: ``--subcortgray``
avgwf_txt_file: (a boolean or a file name)
        Save average waveform into file (bool or filename)
        argument: ``--avgwf %s``
default_color_table: (a boolean)
        use $FREESURFER_HOME/FreeSurferColorLUT.txt
        argument: ``--ctab-default``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
mask_erode: (an integer (int or long))
        Erode mask by some amount
        argument: ``--maskerode %d``
brain_vol: (u'brain-vol-from-seg' or u'brainmask')
        Compute brain volume either with ``brainmask`` or ``brain-vol-from-
        seg``
        argument: ``--%s``
in_file: (an existing file name)
        Use the segmentation to report stats on this volume
        argument: ``--i %s``
in_intensity: (a file name)
        Undocumented input norm.mgz file
        argument: ``--in %s --in-intensity-name %s``
gca_color_table: (an existing file name)
        get color table from GCA (CMA)
        argument: ``--ctab-gca %s``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
supratent: (a boolean)
        Undocumented input flag
        argument: ``--supratent``
partial_volume_file: (an existing file name)
        Compensate for partial voluming
        argument: ``--pv %s``
color_table_file: (an existing file name)
        color table file with seg id names
        argument: ``--ctab %s``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
avgwf_file: (a boolean or a file name)
        Save as binary volume (bool or filename)
        argument: ``--avgwfvol %s``
total_gray: (a boolean)
        Compute volume of total gray matter
        argument: ``--totalgray``
subjects_dir: (an existing directory name)
        subjects directory
multiply: (a float)
        multiply input by val
        argument: ``--mul %f``
mask_invert: (a boolean)
        Invert binarized mask volume
        argument: ``--maskinvert``
intensity_units: (u'MR')
        Intensity units
        argument: ``--in-intensity-units %s``
        requires: in_intensity
mask_sign: (u'abs' or u'pos' or u'neg' or u'--masksign %s')
        Sign for mask threshold: pos, neg, or abs
non_empty_only: (a boolean)
        Only report nonempty segmentations
        argument: ``--nonempty``
calc_power: (u'sqr' or u'sqrt')
        Compute either the sqr or the sqrt of the input
        argument: ``--%s``
mask_frame: (an integer (int or long))
        Mask with this (0 based) frame of the mask volume
        requires: mask_file
segment_id: (a list of items which are any value)
        Manually specify segmentation ids
        argument: ``--id %s...``
wm_vol_from_surf: (a boolean)
        Compute wm volume from surf
        argument: ``--surf-wm-vol``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
empty: (a boolean)
        Report on segmentations listed in the color table
        argument: ``--empty``
mask_thresh: (a float)
        binarize mask with this threshold <0.5>
        argument: ``--maskthresh %f``
mask_file: (an existing file name)
        Mask volume (same size as seg
        argument: ``--mask %s``
vox: (a list of items which are an integer (int or long))
        Replace seg with all 0s except at C R S (three int inputs)
        argument: ``--vox %s``
euler: (a boolean)
        Write out number of defect holes in orig.nofix based on the euler
        number
        argument: ``--euler``
summary_file: (a file name)
        Segmentation stats summary table file
        argument: ``--sum %s``, position: -1

Outputs:

sf_avg_file: (a file name)
        Text file with func statistics averaged over segs and framss
avgwf_txt_file: (a file name)
        Text file with functional statistics averaged over segs
summary_file: (an existing file name)
        Segmentation summary statistics table
avgwf_file: (a file name)
        Volume with functional statistics averaged over segs

SegStatsReconAll

Link to code

Wraps the executable command mri_segstats.

This class inherits SegStats and modifies it for use in a recon-all workflow. This implementation mandates implicit inputs that SegStats. To ensure backwards compatability of SegStats, this class was created.

Examples

>>> from nipype.interfaces.freesurfer import SegStatsReconAll
>>> segstatsreconall = SegStatsReconAll()
>>> segstatsreconall.inputs.annot = ('PWS04', 'lh', 'aparc')
>>> segstatsreconall.inputs.avgwf_txt_file = 'avgwf.txt'
>>> segstatsreconall.inputs.summary_file = 'summary.stats'
>>> segstatsreconall.inputs.subject_id = '10335'
>>> segstatsreconall.inputs.ribbon = 'wm.mgz'
>>> segstatsreconall.inputs.transform = 'trans.mat'
>>> segstatsreconall.inputs.presurf_seg = 'wm.mgz'
>>> segstatsreconall.inputs.lh_orig_nofix = 'lh.pial'
>>> segstatsreconall.inputs.rh_orig_nofix = 'lh.pial'
>>> segstatsreconall.inputs.lh_pial = 'lh.pial'
>>> segstatsreconall.inputs.rh_pial = 'lh.pial'
>>> segstatsreconall.inputs.lh_white = 'lh.pial'
>>> segstatsreconall.inputs.rh_white = 'lh.pial'
>>> segstatsreconall.inputs.empty = True
>>> segstatsreconall.inputs.brain_vol = 'brain-vol-from-seg'
>>> segstatsreconall.inputs.exclude_ctx_gm_wm = True
>>> segstatsreconall.inputs.supratent = True
>>> segstatsreconall.inputs.subcort_gm = True
>>> segstatsreconall.inputs.etiv = True
>>> segstatsreconall.inputs.wm_vol_from_surf = True
>>> segstatsreconall.inputs.cortex_vol_from_surf = True
>>> segstatsreconall.inputs.total_gray = True
>>> segstatsreconall.inputs.euler = True
>>> segstatsreconall.inputs.exclude_id = 0
>>> segstatsreconall.cmdline
'mri_segstats --annot PWS04 lh aparc --avgwf ./avgwf.txt --brain-vol-from-seg --surf-ctx-vol --empty --etiv --euler --excl-ctxgmwm --excludeid 0 --subcortgray --subject 10335 --supratent --totalgray --surf-wm-vol --sum ./summary.stats'

Inputs:

[Mandatory]
rh_white: (an existing file name)
        Input file must be <subject_id>/surf/rh.white
surf_label: (a tuple of the form: (a unicode string, u'lh' or u'rh',
          a unicode string))
        subject hemi label : use surface label
        argument: ``--slabel %s %s %s``
        mutually_exclusive: segmentation_file, annot, surf_label
lh_orig_nofix: (an existing file name)
        Input lh.orig.nofix
rh_orig_nofix: (an existing file name)
        Input rh.orig.nofix
subject_id: (a string, nipype default value: subject_id)
        Subject id being processed
        argument: ``--subject %s``
transform: (an existing file name)
        Input transform file
lh_white: (an existing file name)
        Input file must be <subject_id>/surf/lh.white
annot: (a tuple of the form: (a unicode string, u'lh' or u'rh', a
          unicode string))
        subject hemi parc : use surface parcellation
        argument: ``--annot %s %s %s``
        mutually_exclusive: segmentation_file, annot, surf_label
lh_pial: (an existing file name)
        Input file must be <subject_id>/surf/lh.pial
rh_pial: (an existing file name)
        Input file must be <subject_id>/surf/rh.pial
segmentation_file: (an existing file name)
        segmentation volume path
        argument: ``--seg %s``
        mutually_exclusive: segmentation_file, annot, surf_label
ribbon: (a file name)
        Input file mri/ribbon.mgz

[Optional]
calc_snr: (a boolean)
        save mean/std as extra column in output table
        argument: ``--snr``
frame: (an integer (int or long))
        Report stats on nth frame of input volume
        argument: ``--frame %d``
cortex_vol_from_surf: (a boolean)
        Compute cortex volume from surf
        argument: ``--surf-ctx-vol``
sf_avg_file: (a boolean or a file name)
        Save mean across space and time
        argument: ``--sfavg %s``
etiv: (a boolean)
        Compute ICV from talairach transform
        argument: ``--etiv``
brainmask_file: (an existing file name)
        Load brain mask and compute the volume of the brain as the non-zero
        voxels in this volume
        argument: ``--brainmask %s``
etiv_only: (u'etiv' or u'old-etiv' or u'--%s-only')
        Compute etiv and exit. Use ``etiv`` or ``old-etiv``
subcort_gm: (a boolean)
        Compute volume of subcortical gray matter
        argument: ``--subcortgray``
exclude_id: (an integer (int or long))
        Exclude seg id from report
        argument: ``--excludeid %d``
mask_erode: (an integer (int or long))
        Erode mask by some amount
        argument: ``--maskerode %d``
default_color_table: (a boolean)
        use $FREESURFER_HOME/FreeSurferColorLUT.txt
        argument: ``--ctab-default``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
presurf_seg: (an existing file name)
        Input segmentation volume
brain_vol: (u'brain-vol-from-seg' or u'brainmask')
        Compute brain volume either with ``brainmask`` or ``brain-vol-from-
        seg``
        argument: ``--%s``
in_file: (an existing file name)
        Use the segmentation to report stats on this volume
        argument: ``--i %s``
in_intensity: (a file name)
        Undocumented input norm.mgz file
        argument: ``--in %s --in-intensity-name %s``
gca_color_table: (an existing file name)
        get color table from GCA (CMA)
        argument: ``--ctab-gca %s``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
supratent: (a boolean)
        Undocumented input flag
        argument: ``--supratent``
partial_volume_file: (an existing file name)
        Compensate for partial voluming
        argument: ``--pv %s``
color_table_file: (an existing file name)
        color table file with seg id names
        argument: ``--ctab %s``
        mutually_exclusive: color_table_file, default_color_table,
          gca_color_table
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
avgwf_file: (a boolean or a file name)
        Save as binary volume (bool or filename)
        argument: ``--avgwfvol %s``
copy_inputs: (a boolean)
        If running as a node, set this to True otherwise, this will copy the
        implicit inputs to the node directory.
total_gray: (a boolean)
        Compute volume of total gray matter
        argument: ``--totalgray``
subjects_dir: (an existing directory name)
        subjects directory
multiply: (a float)
        multiply input by val
        argument: ``--mul %f``
aseg: (an existing file name)
        Mandatory implicit input in 5.3
mask_invert: (a boolean)
        Invert binarized mask volume
        argument: ``--maskinvert``
intensity_units: (u'MR')
        Intensity units
        argument: ``--in-intensity-units %s``
        requires: in_intensity
mask_sign: (u'abs' or u'pos' or u'neg' or u'--masksign %s')
        Sign for mask threshold: pos, neg, or abs
non_empty_only: (a boolean)
        Only report nonempty segmentations
        argument: ``--nonempty``
calc_power: (u'sqr' or u'sqrt')
        Compute either the sqr or the sqrt of the input
        argument: ``--%s``
mask_frame: (an integer (int or long))
        Mask with this (0 based) frame of the mask volume
        requires: mask_file
exclude_ctx_gm_wm: (a boolean)
        exclude cortical gray and white matter
        argument: ``--excl-ctxgmwm``
segment_id: (a list of items which are any value)
        Manually specify segmentation ids
        argument: ``--id %s...``
wm_vol_from_surf: (a boolean)
        Compute wm volume from surf
        argument: ``--surf-wm-vol``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
empty: (a boolean)
        Report on segmentations listed in the color table
        argument: ``--empty``
mask_thresh: (a float)
        binarize mask with this threshold <0.5>
        argument: ``--maskthresh %f``
avgwf_txt_file: (a boolean or a file name)
        Save average waveform into file (bool or filename)
        argument: ``--avgwf %s``
mask_file: (an existing file name)
        Mask volume (same size as seg
        argument: ``--mask %s``
vox: (a list of items which are an integer (int or long))
        Replace seg with all 0s except at C R S (three int inputs)
        argument: ``--vox %s``
euler: (a boolean)
        Write out number of defect holes in orig.nofix based on the euler
        number
        argument: ``--euler``
summary_file: (a file name)
        Segmentation stats summary table file
        argument: ``--sum %s``, position: -1

Outputs:

sf_avg_file: (a file name)
        Text file with func statistics averaged over segs and framss
avgwf_txt_file: (a file name)
        Text file with functional statistics averaged over segs
summary_file: (an existing file name)
        Segmentation summary statistics table
avgwf_file: (a file name)
        Volume with functional statistics averaged over segs

SphericalAverage

Link to code

Wraps the executable command mris_spherical_average.

This program will add a template into an average surface.

Examples

>>> from nipype.interfaces.freesurfer import SphericalAverage
>>> sphericalavg = SphericalAverage()
>>> sphericalavg.inputs.out_file = 'test.out'
>>> sphericalavg.inputs.in_average = '.'
>>> sphericalavg.inputs.in_surf = 'lh.pial'
>>> sphericalavg.inputs.hemisphere = 'lh'
>>> sphericalavg.inputs.fname = 'lh.entorhinal'
>>> sphericalavg.inputs.which = 'label'
>>> sphericalavg.inputs.subject_id = '10335'
>>> sphericalavg.inputs.erode = 2
>>> sphericalavg.inputs.threshold = 5
>>> sphericalavg.cmdline
'mris_spherical_average -erode 2 -o 10335 -t 5.0 label lh.entorhinal lh pial . test.out'

Inputs:

[Mandatory]
subject_id: (a string)
        Output subject id
        argument: ``-o %s``
in_surf: (an existing file name)
        Input surface file
        argument: ``%s``, position: -3
hemisphere: (u'lh' or u'rh')
        Input hemisphere
        argument: ``%s``, position: -4
fname: (a string)
        Filename from the average subject directory.
         Example: to use rh.entorhinal.label as the input label
         filename, set fname to 'rh.entorhinal' and which to
         'label'. The program will then search for
         '{in_average}/label/rh.entorhinal.label'
        argument: ``%s``, position: -5
which: (u'coords' or u'label' or u'vals' or u'curv' or u'area')
        No documentation
        argument: ``%s``, position: -6

[Optional]
erode: (an integer (int or long))
        Undocumented
        argument: ``-erode %d``
out_file: (a file name)
        Output filename
        argument: ``%s``, position: -1
in_average: (a directory name)
        Average subject
        argument: ``%s``, position: -2
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a newbytes or None or a
          newstr or None and with values which are a newbytes or None or a
          newstr or None, nipype default value: {})
        Environment variables
threshold: (a float)
        Undocumented
        argument: ``-t %.1f``
subjects_dir: (an existing directory name)
        subjects directory
in_orig: (an existing file name)
        Original surface filename
        argument: ``-orig %s``

Outputs:

out_file: (a file name)
        Output label