Home · Quickstart · User Guide and Examples · Interfaces Index · Developers · About · Nipy

# nipype.interfaces.freesurfer.preprocess module

Provides interfaces to various commands provided by FreeSurfer

## ApplyVolTransform

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_vol2vol`.

> Use FreeSurfer mri_vol2vol to apply a transform.

> Examples

>     >>> from nipype.interfaces.freesurfer import ApplyVolTransform
>     >>> applyreg = ApplyVolTransform()
>     >>> applyreg.inputs.source_file = 'structural.nii'
>     >>> applyreg.inputs.reg_file = 'register.dat'
>     >>> applyreg.inputs.transformed_file = 'struct_warped.nii'
>     >>> applyreg.inputs.fs_target = True
>     >>> applyreg.cmdline
>     'mri_vol2vol --fstarg --reg register.dat --mov structural.nii --o struct_warped.nii'

> fs_targeta boolean

>   Use orig.mgz from subject in regfile as target. Maps to a command-line argument: `--fstarg`. Mutually exclusive with inputs: `target_file`, `tal`, `fs_target`. Requires inputs: `reg_file`.

> fsl_reg_filea pathlike object or string representing an existing file

>   FslRAS-to-fslRAS matrix (FSL format). Maps to a command-line argument: `--fsl %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> lta_filea pathlike object or string representing an existing file

>   Linear Transform Array file. Maps to a command-line argument: `--lta %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> lta_inv_filea pathlike object or string representing an existing file

>   LTA, invert. Maps to a command-line argument: `--lta-inv %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> mni_152_rega boolean

>   Target MNI152 space. Maps to a command-line argument: `--regheader`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> reg_filea pathlike object or string representing an existing file

>   TkRAS-to-tkRAS matrix (tkregister2 format). Maps to a command-line argument: `--reg %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> reg_headera boolean

>   ScannerRAS-to-ScannerRAS matrix = identity. Maps to a command-line argument: `--regheader`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> source_filea pathlike object or string representing an existing file

>   Input volume you wish to transform. Maps to a command-line argument: `--mov %s`.

> subjecta unicode string

>   Set matrix = identity and use subject for any templates. Maps to a command-line argument: `--s %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> tala boolean

>   Map to a sub FOV of MNI305 (with –reg only). Maps to a command-line argument: `--tal`. Mutually exclusive with inputs: `target_file`, `tal`, `fs_target`.

> target_filea pathlike object or string representing an existing file

>   Output template volume. Maps to a command-line argument: `--targ %s`. Mutually exclusive with inputs: `target_file`, `tal`, `fs_target`.

> xfm_reg_filea pathlike object or string representing an existing file

>   ScannerRAS-to-ScannerRAS matrix (MNI format). Maps to a command-line argument: `--xfm %s`. Mutually exclusive with inputs: `reg_file`, `lta_file`, `lta_inv_file`, `fsl_reg_file`, `xfm_reg_file`, `reg_header`, `mni_152_reg`, `subject`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> interp‘trilin’ or ‘nearest’ or ‘cubic’

>   Interpolation method (<trilin> or nearest). Maps to a command-line argument: `--interp %s`.

> inversea boolean

>   Sample from target to source. Maps to a command-line argument: `--inv`.

> invert_morpha boolean

>   Compute and use the inverse of the non-linear morph to resample the input volume. To be used by –m3z. Maps to a command-line argument: `--inv-morph`. Requires inputs: `m3z_file`.

> m3z_filea pathlike object or string representing a file

>   This is the morph to be applied to the volume. Unless the morph is in mri/transforms (eg.: for talairach.m3z computed by reconall), you will need to specify the full path to this morph and use the –noDefM3zPath flag. Maps to a command-line argument: `--m3z %s`.

> no_ded_m3z_patha boolean

>   To be used with the m3z flag. Instructs the code not to look for them3z morph in the default location (SUBJECTS_DIR/subj/mri/transforms), but instead just use the path indicated in –m3z. Maps to a command-line argument: `--noDefM3zPath`. Requires inputs: `m3z_file`.

> no_resamplea boolean

>   Do not resample; just change vox2ras matrix. Maps to a command-line argument: `--no-resample`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> tal_resolutiona float

>   Resolution to sample when using tal. Maps to a command-line argument: `--talres %.10f`.

> transformed_filea pathlike object or string representing a file

>   Output volume. Maps to a command-line argument: `--o %s`.

> transformed_filea pathlike object or string representing an existing file

>   Path to output file if used normally.

## BBRegister

Link to code

> Bases: FSCommand

> Wrapped executable: `bbregister`.

> Use FreeSurfer bbregister to register a volume to the Freesurfer anatomical.

> This program performs within-subject, cross-modal registration using a boundary-based cost function. It is required that you have an anatomical scan of the subject that has already been recon-all-ed using freesurfer.

> Examples

>     >>> from nipype.interfaces.freesurfer import BBRegister
>     >>> bbreg = BBRegister(subject_id='me', source_file='structural.nii', init='header', contrast_type='t2')
>     >>> bbreg.cmdline
>     'bbregister --t2 --init-header --reg structural_bbreg_me.dat --mov structural.nii --s me'

> contrast_type‘t1’ or ‘t2’ or ‘bold’ or ‘dti’

>   Contrast type of image. Maps to a command-line argument: `--%s`.

> source_filea pathlike object or string representing a file

>   Source file to be registered. Maps to a command-line argument: `--mov %s`.

> subject_ida unicode string

>   Freesurfer subject id. Maps to a command-line argument: `--s %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> dof6 or 9 or 12

>   Number of transform degrees of freedom. Maps to a command-line argument: `--%d`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> epi_maska boolean

>   Mask out B0 regions in stages 1 and 2. Maps to a command-line argument: `--epi-mask`.

> fsldofan integer (int or long)

>   Degrees of freedom for initial registration (FSL). Maps to a command-line argument: `--fsl-dof %d`.

> init‘coreg’ or ‘rr’ or ‘spm’ or ‘fsl’ or ‘header’ or ‘best’

>   Initialize registration with mri_coreg, spm, fsl, or header. Maps to a command-line argument: `--init-%s`. Mutually exclusive with inputs: `init_reg_file`.

> init_cost_filea boolean or a pathlike object or string representing a file

>   Output initial registration cost file. Maps to a command-line argument: `--initcost %s`.

> init_reg_filea pathlike object or string representing an existing file

>   Existing registration file. Maps to a command-line argument: `--init-reg %s`. Mutually exclusive with inputs: `init`.

> intermediate_filea pathlike object or string representing an existing file

>   Intermediate image, e.g. in case of partial FOV. Maps to a command-line argument: `--int %s`.

> out_fsl_filea boolean or a pathlike object or string representing a file

>   Write the transformation matrix in FSL FLIRT format. Maps to a command-line argument: `--fslmat %s`.

> out_lta_filea boolean or a pathlike object or string representing a file

>   Write the transformation matrix in LTA format. Maps to a command-line argument: `--lta %s`.

> out_reg_filea pathlike object or string representing a file

>   Output registration file. Maps to a command-line argument: `--reg %s`.

> reg_framean integer (int or long)

>   0-based frame index for 4D source file. Maps to a command-line argument: `--frame %d`. Mutually exclusive with inputs: `reg_middle_frame`.

> reg_middle_framea boolean

>   Register middle frame of 4D source file. Maps to a command-line argument: `--mid-frame`. Mutually exclusive with inputs: `reg_frame`.

> registered_filea boolean or a pathlike object or string representing a file

>   Output warped sourcefile either True or filename. Maps to a command-line argument: `--o %s`.

> spm_niftia boolean

>   Force use of nifti rather than analyze with SPM. Maps to a command-line argument: `--spm-nii`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> init_cost_filea pathlike object or string representing an existing file

>   Output initial registration cost file.

> min_cost_filea pathlike object or string representing an existing file

>   Output registration minimum cost file.

> out_fsl_filea pathlike object or string representing an existing file

>   Output FLIRT-style registration file.

> out_lta_filea pathlike object or string representing an existing file

>   Output LTA-style registration file.

> out_reg_filea pathlike object or string representing an existing file

>   Output registration file.

> registered_filea pathlike object or string representing an existing file

>   Registered and resampled source file.

## CALabel

Link to code

> Bases: FSCommandOpenMP

> Wrapped executable: `mri_ca_label`.

> Label subcortical structures based in GCA model.

> See also

> For complete details, see the FS Documentation

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> ca_label = freesurfer.CALabel()
>     >>> ca_label.inputs.in_file = "norm.mgz"
>     >>> ca_label.inputs.out_file = "out.mgz"
>     >>> ca_label.inputs.transform = "trans.mat"
>     >>> ca_label.inputs.template = "Template_6.nii" # in practice use .gcs extension
>     >>> ca_label.cmdline
>     'mri_ca_label norm.mgz trans.mat Template_6.nii out.mgz'

> in_filea pathlike object or string representing an existing file

>   Input volume for CALabel. Maps to a command-line argument: `%s` (position: -4).

> out_filea pathlike object or string representing a file

>   Output file for CALabel. Maps to a command-line argument: `%s` (position: -1).

> templatea pathlike object or string representing an existing file

>   Input template for CALabel. Maps to a command-line argument: `%s` (position: -2).

> transforma pathlike object or string representing an existing file

>   Input transform for CALabel. Maps to a command-line argument: `%s` (position: -3).

> aligna boolean

>   Align CALabel. Maps to a command-line argument: `-align`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> asega pathlike object or string representing an existing file

>   Undocumented flag. Autorecon3 uses ../mri/aseg.presurf.mgz as input file. Maps to a command-line argument: `-aseg %s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> in_vola pathlike object or string representing an existing file

>   Set input volume. Maps to a command-line argument: `-r %s`.

> intensitiesa pathlike object or string representing an existing file

>   Input label intensities file(used in longitudinal processing). Maps to a command-line argument: `-r %s`.

> labela pathlike object or string representing an existing file

>   Undocumented flag. Autorecon3 uses ../label/{hemisphere}.cortex.label as input file. Maps to a command-line argument: `-l %s`.

> no_big_ventriclesa boolean

>   No big ventricles. Maps to a command-line argument: `-nobigventricles`.

> num_threadsan integer (int or long)

>   Allows for specifying more threads.

> priora float

>   Prior for CALabel. Maps to a command-line argument: `-prior %.1f`.

> relabel_unlikelya tuple of the form: (an integer (int or long), a float)

>   Reclassify voxels at least some std devs from the mean using some size Gaussian window. Maps to a command-line argument: `-relabel_unlikely %d %.1f`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing a file

>   Output volume from CALabel.

## CANormalize

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_ca_normalize`.

> This program creates a normalized volume using the brain volume and an input gca file.

> See also

> For complete details, see the FS Documentation.

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> ca_normalize = freesurfer.CANormalize()
>     >>> ca_normalize.inputs.in_file = "T1.mgz"
>     >>> ca_normalize.inputs.atlas = "atlas.nii.gz" # in practice use .gca atlases
>     >>> ca_normalize.inputs.transform = "trans.mat" # in practice use .lta transforms
>     >>> ca_normalize.cmdline
>     'mri_ca_normalize T1.mgz atlas.nii.gz trans.mat T1_norm.mgz'

> atlasa pathlike object or string representing an existing file

>   The atlas file in gca format. Maps to a command-line argument: `%s` (position: -3).

> in_filea pathlike object or string representing an existing file

>   The input file for CANormalize. Maps to a command-line argument: `%s` (position: -4).

> transforma pathlike object or string representing an existing file

>   The tranform file in lta format. Maps to a command-line argument: `%s` (position: -2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> control_pointsa pathlike object or string representing a file

>   File name for the output control points. Maps to a command-line argument: `-c %s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> long_filea pathlike object or string representing a file

>   Undocumented flag used in longitudinal processing. Maps to a command-line argument: `-long %s`.

> maska pathlike object or string representing an existing file

>   Specifies volume to use as mask. Maps to a command-line argument: `-mask %s`.

> out_filea pathlike object or string representing a file

>   The output file for CANormalize. Maps to a command-line argument: `%s` (position: -1).

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> control_pointsa pathlike object or string representing a file

>   The output control points for Normalize.

> out_filea pathlike object or string representing a file

>   The output file for Normalize.

## CARegister

Link to code

> Bases: FSCommandOpenMP

> Wrapped executable: `mri_ca_register`.

> Generates a multi-dimensional talairach transform from a gca file and talairach.lta file

> See also

> For complete details, see the FS Documentation

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> ca_register = freesurfer.CARegister()
>     >>> ca_register.inputs.in_file = "norm.mgz"
>     >>> ca_register.inputs.out_file = "talairach.m3z"
>     >>> ca_register.cmdline
>     'mri_ca_register norm.mgz talairach.m3z'

> in_filea pathlike object or string representing an existing file

>   The input volume for CARegister. Maps to a command-line argument: `%s` (position: -3).

> Aan integer (int or long)

>   Undocumented flag used in longitudinal processing. Maps to a command-line argument: `-A %d`.

> aligna string

>   Specifies when to perform alignment. Maps to a command-line argument: `-align-%s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> invert_and_savea boolean

>   Invert and save the .m3z multi-dimensional talaraich transform to x, y, and z .mgz files. Maps to a command-line argument: `-invert-and-save` (position: -4).

> l_filesa list of items which are a pathlike object or string representing a file

>   Undocumented flag used in longitudinal processing. Maps to a command-line argument: `-l %s`.

> levelsan integer (int or long)

>   Defines how many surrounding voxels will be used in interpolations, default is 6. Maps to a command-line argument: `-levels %d`.

> maska pathlike object or string representing an existing file

>   Specifies volume to use as mask. Maps to a command-line argument: `-mask %s`.

> no_big_ventriclesa boolean

>   No big ventricles. Maps to a command-line argument: `-nobigventricles`.

> num_threadsan integer (int or long)

>   Allows for specifying more threads.

> out_filea pathlike object or string representing a file

>   The output volume for CARegister. Maps to a command-line argument: `%s` (position: -1).

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> templatea pathlike object or string representing an existing file

>   The template file in gca format. Maps to a command-line argument: `%s` (position: -2).

> transforma pathlike object or string representing an existing file

>   Specifies transform in lta format. Maps to a command-line argument: `-T %s`.

> out_filea pathlike object or string representing a file

>   The output file for CARegister.

## ConcatenateLTA

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_concatenate_lta`.

> Concatenates two consecutive LTA transformations into one overall transformation

> Out = LTA2*LTA1

> Examples

>     >>> from nipype.interfaces.freesurfer import ConcatenateLTA
>     >>> conc_lta = ConcatenateLTA()
>     >>> conc_lta.inputs.in_lta1 = 'lta1.lta'
>     >>> conc_lta.inputs.in_lta2 = 'lta2.lta'
>     >>> conc_lta.cmdline
>     'mri_concatenate_lta lta1.lta lta2.lta lta1_concat.lta'

> You can use ‘identity.nofile’ as the filename for in_lta2, e.g.:

>     >>> conc_lta.inputs.in_lta2 = 'identity.nofile'
>     >>> conc_lta.inputs.invert_1 = True
>     >>> conc_lta.inputs.out_file = 'inv1.lta'
>     >>> conc_lta.cmdline
>     'mri_concatenate_lta -invert1 lta1.lta identity.nofile inv1.lta'

> To create a RAS2RAS transform:

>     >>> conc_lta.inputs.out_type = 'RAS2RAS'
>     >>> conc_lta.cmdline
>     'mri_concatenate_lta -invert1 -out_type 1 lta1.lta identity.nofile inv1.lta'

> in_lta1a pathlike object or string representing an existing file

>   Maps some src1 to dst1. Maps to a command-line argument: `%s` (position: -3).

> in_lta2a pathlike object or string representing an existing file or ‘identity.nofile’

>   Maps dst1(src2) to dst2. Maps to a command-line argument: `%s` (position: -2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> invert_1a boolean

>   Invert in_lta1 before applying it. Maps to a command-line argument: `-invert1`.

> invert_2a boolean

>   Invert in_lta2 before applying it. Maps to a command-line argument: `-invert2`.

> invert_outa boolean

>   Invert output LTA. Maps to a command-line argument: `-invertout`.

> out_filea pathlike object or string representing a file

>   The combined LTA maps: src1 to dst2 = LTA2*LTA1. Maps to a command-line argument: `%s` (position: -1).

> out_type‘VOX2VOX’ or ‘RAS2RAS’

>   Set final LTA type. Maps to a command-line argument: `-out_type %d`.

> subjecta unicode string

>   Set subject in output LTA. Maps to a command-line argument: `-subject %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> tal_source_filea pathlike object or string representing an existing file

>   If in_lta2 is talairach.xfm, specify source for talairach. Maps to a command-line argument: `-tal %s` (position: -5). Requires inputs: `tal_template_file`.

> tal_template_filea pathlike object or string representing an existing file

>   If in_lta2 is talairach.xfm, specify template for talairach. Maps to a command-line argument: `%s` (position: -4). Requires inputs: `tal_source_file`.

> out_filea pathlike object or string representing a file

>   The combined LTA maps: src1 to dst2 = LTA2*LTA1.

## DICOMConvert

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_convert`.

> use fs mri_convert to convert dicom files

> Examples

>     >>> from nipype.interfaces.freesurfer import DICOMConvert
>     >>> cvt = DICOMConvert()
>     >>> cvt.inputs.dicom_dir = 'dicomdir'
>     >>> cvt.inputs.file_mapping = [('nifti', '*.nii'), ('info', 'dicom*.txt'), ('dti', '*dti.bv*')]

> base_output_dira pathlike object or string representing a directory

>   Directory in which subject directories are created.

> dicom_dira pathlike object or string representing an existing directory

>   Dicom directory from which to convert dicom files.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> dicom_infoa pathlike object or string representing an existing file

>   File containing summary information from mri_parse_sdcmdir.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> file_mappinga list of items which are a tuple of the form: (a unicode string, a unicode string)

>   Defines the output fields of interface.

> ignore_single_slicea boolean

>   Ignore volumes containing a single slice. Requires inputs: `dicom_info`.

> out_type‘cor’ or ‘mgh’ or ‘mgz’ or ‘minc’ or ‘analyze’ or ‘analyze4d’ or ‘spm’ or ‘afni’ or ‘brik’ or ‘bshort’ or ‘bfloat’ or ‘sdt’ or ‘outline’ or ‘otl’ or ‘gdf’ or ‘nifti1’ or ‘nii’ or ‘niigz’

>   Defines the type of output file produced. (Nipype default value: `niigz`)

> seq_lista list of items which are a unicode string

>   List of pulse sequence names to be converted. Requires inputs: `dicom_info`.

> subject_dir_templatea unicode string

>   Template for subject directory name. (Nipype default value: `S.%04d`)

> subject_idany value

>   Subject identifier to insert into template.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> property DICOMConvert.cmdline

>   command plus any arguments (args) validates arguments and generates command line

## EditWMwithAseg

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_edit_wm_with_aseg`.

> Edits a wm file using a segmentation

> Examples

>     >>> from nipype.interfaces.freesurfer import EditWMwithAseg
>     >>> editwm = EditWMwithAseg()
>     >>> editwm.inputs.in_file = "T1.mgz"
>     >>> editwm.inputs.brain_file = "norm.mgz"
>     >>> editwm.inputs.seg_file = "aseg.mgz"
>     >>> editwm.inputs.out_file = "wm.asegedit.mgz"
>     >>> editwm.inputs.keep_in = True
>     >>> editwm.cmdline
>     'mri_edit_wm_with_aseg -keep-in T1.mgz norm.mgz aseg.mgz wm.asegedit.mgz'

> brain_filea pathlike object or string representing an existing file

>   Input brain/T1 file. Maps to a command-line argument: `%s` (position: -3).

> in_filea pathlike object or string representing an existing file

>   Input white matter segmentation file. Maps to a command-line argument: `%s` (position: -4).

> out_filea pathlike object or string representing a file

>   File to be written as output. Maps to a command-line argument: `%s` (position: -1).

> seg_filea pathlike object or string representing an existing file

>   Input presurf segmentation file. Maps to a command-line argument: `%s` (position: -2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> keep_ina boolean

>   Keep edits as found in input volume. Maps to a command-line argument: `-keep-in`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing a file

>   Output edited WM file.

## FitMSParams

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_ms_fitparms`.

> Estimate tissue paramaters from a set of FLASH images.

> Examples

>     >>> from nipype.interfaces.freesurfer import FitMSParams
>     >>> msfit = FitMSParams()
>     >>> msfit.inputs.in_files = ['flash_05.mgz', 'flash_30.mgz']
>     >>> msfit.inputs.out_dir = 'flash_parameters'
>     >>> msfit.cmdline
>     'mri_ms_fitparms  flash_05.mgz flash_30.mgz flash_parameters'

> in_filesa list of items which are a pathlike object or string representing an existing file

>   List of FLASH images (must be in mgh format). Maps to a command-line argument: `%s` (position: -2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> flip_lista list of items which are an integer (int or long)

>   List of flip angles of the input files.

> out_dira pathlike object or string representing a directory

>   Directory to store output in. Maps to a command-line argument: `%s` (position: -1).

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> te_lista list of items which are a float

>   List of TEs of the input files (in msec).

> tr_lista list of items which are an integer (int or long)

>   List of TRs of the input files (in msec).

> xfm_lista list of items which are a pathlike object or string representing an existing file

>   List of transform files to apply to each FLASH image.

> pd_imagea pathlike object or string representing an existing file

>   Image of estimated proton density values.

> t1_imagea pathlike object or string representing an existing file

>   Image of estimated T1 relaxation values.

> t2star_imagea pathlike object or string representing an existing file

>   Image of estimated T2* values.

## MNIBiasCorrection

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_nu_correct.mni`.

> Wrapper for nu_correct, a program from the Montreal Neurological Insitute (MNI) used for correcting intensity non-uniformity (ie, bias fields). You must have the MNI software installed on your system to run this. See [www.bic.mni.mcgill.ca/software/N3] for more info.

> mri_nu_correct.mni uses float internally instead of uchar. It also rescales the output so that the global mean is the same as that of the input. These two changes are linked and can be turned off with –no-float

> Examples

>     >>> from nipype.interfaces.freesurfer import MNIBiasCorrection
>     >>> correct = MNIBiasCorrection()
>     >>> correct.inputs.in_file = "norm.mgz"
>     >>> correct.inputs.iterations = 6
>     >>> correct.inputs.protocol_iterations = 1000
>     >>> correct.inputs.distance = 50
>     >>> correct.cmdline
>     'mri_nu_correct.mni --distance 50 --i norm.mgz --n 6 --o norm_output.mgz --proto-iters 1000'

> References

> [http://freesurfer.net/fswiki/mri_nu_correct.mni] [http://www.bic.mni.mcgill.ca/software/N3] [https://github.com/BIC-MNI/N3]

> in_filea pathlike object or string representing an existing file

>   Input volume. Input can be any format accepted by mri_convert. Maps to a command-line argument: `--i %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> distancean integer (int or long)

>   N3 -distance option. Maps to a command-line argument: `--distance %d`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> iterationsan integer (int or long)

>   Number of iterations to run nu_correct. Default is 4. This is the number of times that nu_correct is repeated (ie, using the output from the previous run as the input for the next). This is different than the -iterations option to nu_correct. Maps to a command-line argument: `--n %d`. (Nipype default value: `4`)

> maska pathlike object or string representing an existing file

>   Brainmask volume. Input can be any format accepted by mri_convert. Maps to a command-line argument: `--mask %s`.

> no_rescalea boolean

>   Do not rescale so that global mean of output == input global mean. Maps to a command-line argument: `--no-rescale`.

> out_filea pathlike object or string representing a file

>   Output volume. Output can be any format accepted by mri_convert. If the output format is COR, then the directory must exist. Maps to a command-line argument: `--o %s`.

> protocol_iterationsan integer (int or long)

>   Passes Np as argument of the -iterations flag of nu_correct. This is different than the –n flag above. Default is not to pass nu_correct the -iterations flag. Maps to a command-line argument: `--proto-iters %d`.

> shrinkan integer (int or long)

>   Shrink parameter for finer sampling (default is 4). Maps to a command-line argument: `--shrink %d`.

> stopa float

>   Convergence threshold below which iteration stops (suggest 0.01 to 0.0001). Maps to a command-line argument: `--stop %f`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> transforma pathlike object or string representing an existing file

>   Tal.xfm. Use mri_make_uchar instead of conforming. Maps to a command-line argument: `--uchar %s`.

> out_filea pathlike object or string representing an existing file

>   Output volume.

## MRIConvert

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_convert`.

> use fs mri_convert to manipulate files

> Note

> Adds niigz as an output type option

> Examples

>     >>> mc = MRIConvert()
>     >>> mc.inputs.in_file = 'structural.nii'
>     >>> mc.inputs.out_file = 'outfile.mgz'
>     >>> mc.inputs.out_type = 'mgz'
>     >>> mc.cmdline
>     'mri_convert --out_type mgz --input_volume structural.nii --output_volume outfile.mgz'

> in_filea pathlike object or string representing an existing file

>   File to read/convert. Maps to a command-line argument: `--input_volume %s` (position: -2).

> apply_inv_transforma pathlike object or string representing an existing file

>   Apply inverse transformation xfm file. Maps to a command-line argument: `--apply_inverse_transform %s`.

> apply_transforma pathlike object or string representing an existing file

>   Apply xfm file. Maps to a command-line argument: `--apply_transform %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> asciia boolean

>   Save output as ascii col>row>slice>frame. Maps to a command-line argument: `--ascii`.

> autoalign_matrixa pathlike object or string representing an existing file

>   Text file with autoalign matrix. Maps to a command-line argument: `--autoalign %s`.

> color_filea pathlike object or string representing an existing file

>   Color file. Maps to a command-line argument: `--color_file %s`.

> conforma boolean

>   Conform to 1mm voxel size in coronal slice direction with 256^3 or more. Maps to a command-line argument: `--conform`.

> conform_mina boolean

>   Conform to smallest size. Maps to a command-line argument: `--conform_min`.

> conform_sizea float

>   Conform to size_in_mm. Maps to a command-line argument: `--conform_size %s`.

> crop_centera tuple of the form: (an integer (int or long), an integer (int or long), an integer (int or long))

>   <x> <y> <z> crop to 256 around center (x, y, z). Maps to a command-line argument: `--crop %d %d %d`.

> crop_gdfa boolean

>   Apply GDF cropping. Maps to a command-line argument: `--crop_gdf`.

> crop_sizea tuple of the form: (an integer (int or long), an integer (int or long), an integer (int or long))

>   <dx> <dy> <dz> crop to size <dx, dy, dz>. Maps to a command-line argument: `--cropsize %d %d %d`.

> cut_endsan integer (int or long)

>   Remove ncut slices from the ends. Maps to a command-line argument: `--cutends %d`.

> cw256a boolean

>   Confrom to dimensions of 256^3. Maps to a command-line argument: `--cw256`.

> devolve_transforma unicode string

>   Subject id. Maps to a command-line argument: `--devolvexfm %s`.

> drop_nan integer (int or long)

>   Drop the last n frames. Maps to a command-line argument: `--ndrop %d`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> fill_parcellationa boolean

>   Fill parcellation. Maps to a command-line argument: `--fill_parcellation`.

> force_rasa boolean

>   Use default when orientation info absent. Maps to a command-line argument: `--force_ras_good`.

> framean integer (int or long)

>   Keep only 0-based frame number. Maps to a command-line argument: `--frame %d`.

> frame_subsamplea tuple of the form: (an integer (int or long), an integer (int or long), an integer (int or long))

>   Start delta end : frame subsampling (end = -1 for end). Maps to a command-line argument: `--fsubsample %d %d %d`.

> fwhma float

>   Smooth input volume by fwhm mm. Maps to a command-line argument: `--fwhm %f`.

> in_centera list of at most 3 items which are a float

>   <R coordinate> <A coordinate> <S coordinate>. Maps to a command-line argument: `--in_center %s`.

> in_i_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--in_i_direction %f %f %f`.

> in_i_sizean integer (int or long)

>   Input i size. Maps to a command-line argument: `--in_i_size %d`.

> in_infoa boolean

>   Display input info. Maps to a command-line argument: `--in_info`.

> in_j_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--in_j_direction %f %f %f`.

> in_j_sizean integer (int or long)

>   Input j size. Maps to a command-line argument: `--in_j_size %d`.

> in_k_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--in_k_direction %f %f %f`.

> in_k_sizean integer (int or long)

>   Input k size. Maps to a command-line argument: `--in_k_size %d`.

> in_likea pathlike object or string representing an existing file

>   Input looks like. Maps to a command-line argument: `--in_like %s`.

> in_matrixa boolean

>   Display input matrix. Maps to a command-line argument: `--in_matrix`.

> in_orientation‘LAI’ or ‘LIA’ or ‘ALI’ or ‘AIL’ or ‘ILA’ or ‘IAL’ or ‘LAS’ or ‘LSA’ or ‘ALS’ or ‘ASL’ or ‘SLA’ or ‘SAL’ or ‘LPI’ or ‘LIP’ or ‘PLI’ or ‘PIL’ or ‘ILP’ or ‘IPL’ or ‘LPS’ or ‘LSP’ or ‘PLS’ or ‘PSL’ or ‘SLP’ or ‘SPL’ or ‘RAI’ or ‘RIA’ or ‘ARI’ or ‘AIR’ or ‘IRA’ or ‘IAR’ or ‘RAS’ or ‘RSA’ or ‘ARS’ or ‘ASR’ or ‘SRA’ or ‘SAR’ or ‘RPI’ or ‘RIP’ or ‘PRI’ or ‘PIR’ or ‘IRP’ or ‘IPR’ or ‘RPS’ or ‘RSP’ or ‘PRS’ or ‘PSR’ or ‘SRP’ or ‘SPR’

>   Specify the input orientation. Maps to a command-line argument: `--in_orientation %s`.

> in_scalea float

>   Input intensity scale factor. Maps to a command-line argument: `--scale %f`.

> in_statsa boolean

>   Display input stats. Maps to a command-line argument: `--in_stats`.

> in_type‘cor’ or ‘mgh’ or ‘mgz’ or ‘minc’ or ‘analyze’ or ‘analyze4d’ or ‘spm’ or ‘afni’ or ‘brik’ or ‘bshort’ or ‘bfloat’ or ‘sdt’ or ‘outline’ or ‘otl’ or ‘gdf’ or ‘nifti1’ or ‘nii’ or ‘niigz’ or ‘ge’ or ‘gelx’ or ‘lx’ or ‘ximg’ or ‘siemens’ or ‘dicom’ or ‘siemens_dicom’

>   Input file type. Maps to a command-line argument: `--in_type %s`.

> invert_contrasta float

>   Threshold for inversting contrast. Maps to a command-line argument: `--invert_contrast %f`.

> midframea boolean

>   Keep only the middle frame. Maps to a command-line argument: `--mid-frame`.

> no_changea boolean

>   Don’t change type of input to that of template. Maps to a command-line argument: `--nochange`.

> no_scalea boolean

>   Dont rescale values for COR. Maps to a command-line argument: `--no_scale 1`.

> no_translatea boolean

>   ???. Maps to a command-line argument: `--no_translate`.

> no_writea boolean

>   Do not write output. Maps to a command-line argument: `--no_write`.

> out_centera tuple of the form: (a float, a float, a float)

>   <R coordinate> <A coordinate> <S coordinate>. Maps to a command-line argument: `--out_center %f %f %f`.

> out_datatype‘uchar’ or ‘short’ or ‘int’ or ‘float’

>   Output data type <uchar|short|int|float>. Maps to a command-line argument: `--out_data_type %s`.

> out_filea pathlike object or string representing a file

>   Output filename or True to generate one. Maps to a command-line argument: `--output_volume %s` (position: -1).

> out_i_countan integer (int or long)

>   Some count ?? in i direction. Maps to a command-line argument: `--out_i_count %d`.

> out_i_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--out_i_direction %f %f %f`.

> out_i_sizean integer (int or long)

>   Output i size. Maps to a command-line argument: `--out_i_size %d`.

> out_infoa boolean

>   Display output info. Maps to a command-line argument: `--out_info`.

> out_j_countan integer (int or long)

>   Some count ?? in j direction. Maps to a command-line argument: `--out_j_count %d`.

> out_j_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--out_j_direction %f %f %f`.

> out_j_sizean integer (int or long)

>   Output j size. Maps to a command-line argument: `--out_j_size %d`.

> out_k_countan integer (int or long)

>   Some count ?? in k direction. Maps to a command-line argument: `--out_k_count %d`.

> out_k_dira tuple of the form: (a float, a float, a float)

>   <R direction> <A direction> <S direction>. Maps to a command-line argument: `--out_k_direction %f %f %f`.

> out_k_sizean integer (int or long)

>   Output k size. Maps to a command-line argument: `--out_k_size %d`.

> out_matrixa boolean

>   Display output matrix. Maps to a command-line argument: `--out_matrix`.

> out_orientation‘LAI’ or ‘LIA’ or ‘ALI’ or ‘AIL’ or ‘ILA’ or ‘IAL’ or ‘LAS’ or ‘LSA’ or ‘ALS’ or ‘ASL’ or ‘SLA’ or ‘SAL’ or ‘LPI’ or ‘LIP’ or ‘PLI’ or ‘PIL’ or ‘ILP’ or ‘IPL’ or ‘LPS’ or ‘LSP’ or ‘PLS’ or ‘PSL’ or ‘SLP’ or ‘SPL’ or ‘RAI’ or ‘RIA’ or ‘ARI’ or ‘AIR’ or ‘IRA’ or ‘IAR’ or ‘RAS’ or ‘RSA’ or ‘ARS’ or ‘ASR’ or ‘SRA’ or ‘SAR’ or ‘RPI’ or ‘RIP’ or ‘PRI’ or ‘PIR’ or ‘IRP’ or ‘IPR’ or ‘RPS’ or ‘RSP’ or ‘PRS’ or ‘PSR’ or ‘SRP’ or ‘SPR’

>   Specify the output orientation. Maps to a command-line argument: `--out_orientation %s`.

> out_scalea float

>   Output intensity scale factor. Maps to a command-line argument: `--out-scale %d`.

> out_statsa boolean

>   Display output stats. Maps to a command-line argument: `--out_stats`.

> out_type‘cor’ or ‘mgh’ or ‘mgz’ or ‘minc’ or ‘analyze’ or ‘analyze4d’ or ‘spm’ or ‘afni’ or ‘brik’ or ‘bshort’ or ‘bfloat’ or ‘sdt’ or ‘outline’ or ‘otl’ or ‘gdf’ or ‘nifti1’ or ‘nii’ or ‘niigz’

>   Output file type. Maps to a command-line argument: `--out_type %s`.

> parse_onlya boolean

>   Parse input only. Maps to a command-line argument: `--parse_only`.

> read_onlya boolean

>   Read the input volume. Maps to a command-line argument: `--read_only`.

> reordera tuple of the form: (an integer (int or long), an integer (int or long), an integer (int or long))

>   Olddim1 olddim2 olddim3. Maps to a command-line argument: `--reorder %d %d %d`.

> resample_type‘interpolate’ or ‘weighted’ or ‘nearest’ or ‘sinc’ or ‘cubic’

>   <interpolate|weighted|nearest|sinc|cubic> (default is interpolate). Maps to a command-line argument: `--resample_type %s`.

> reslice_likea pathlike object or string representing an existing file

>   Reslice output to match file. Maps to a command-line argument: `--reslice_like %s`.

> sdcm_lista pathlike object or string representing an existing file

>   List of DICOM files for conversion. Maps to a command-line argument: `--sdcmlist %s`.

> skip_nan integer (int or long)

>   Skip the first n frames. Maps to a command-line argument: `--nskip %d`.

> slice_biasa float

>   Apply half-cosine bias field. Maps to a command-line argument: `--slice-bias %f`.

> slice_cropa tuple of the form: (an integer (int or long), an integer (int or long))

>   S_start s_end : keep slices s_start to s_end. Maps to a command-line argument: `--slice-crop %d %d`.

> slice_reversea boolean

>   Reverse order of slices, update vox2ras. Maps to a command-line argument: `--slice-reverse`.

> smooth_parcellationa boolean

>   Smooth parcellation. Maps to a command-line argument: `--smooth_parcellation`.

> sphinxa boolean

>   Change orientation info to sphinx. Maps to a command-line argument: `--sphinx`.

> splita boolean

>   Split output frames into separate output files. Maps to a command-line argument: `--split`.

> status_filea pathlike object or string representing a file

>   Status file for DICOM conversion. Maps to a command-line argument: `--status %s`.

> subject_namea unicode string

>   Subject name ???. Maps to a command-line argument: `--subject_name %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> tean integer (int or long)

>   TE in msec. Maps to a command-line argument: `-te %d`.

> template_infoa boolean

>   Dump info about template. Maps to a command-line argument: `--template_info`.

> template_type‘cor’ or ‘mgh’ or ‘mgz’ or ‘minc’ or ‘analyze’ or ‘analyze4d’ or ‘spm’ or ‘afni’ or ‘brik’ or ‘bshort’ or ‘bfloat’ or ‘sdt’ or ‘outline’ or ‘otl’ or ‘gdf’ or ‘nifti1’ or ‘nii’ or ‘niigz’ or ‘ge’ or ‘gelx’ or ‘lx’ or ‘ximg’ or ‘siemens’ or ‘dicom’ or ‘siemens_dicom’

>   Template file type. Maps to a command-line argument: `--template_type %s`.

> tian integer (int or long)

>   TI in msec (note upper case flag). Maps to a command-line argument: `-ti %d`.

> tran integer (int or long)

>   TR in msec. Maps to a command-line argument: `-tr %d`.

> unwarp_gradienta boolean

>   Unwarp gradient nonlinearity. Maps to a command-line argument: `--unwarp_gradient_nonlinearity`.

> vox_sizea tuple of the form: (a float, a float, a float)

>   <size_x> <size_y> <size_z> specify the size (mm) - useful for upsampling or downsampling. Maps to a command-line argument: `-voxsize %f %f %f`.

> zero_ge_z_offseta boolean

>   Zero ge z offset ???. Maps to a command-line argument: `--zero_ge_z_offset`.

> zero_outlinesa boolean

>   Zero outlines. Maps to a command-line argument: `--zero_outlines`.

> out_filea list of items which are a pathlike object or string representing an existing file

>   Converted output file.

> MRIConvert.filemap = {'afni': 'brik', 'analyze': 'img', 'analyze4d': 'img', 'bfloat': 'bfloat', 'brik': 'brik', 'bshort': 'bshort', 'cor': 'cor', 'mgh': 'mgh', 'mgz': 'mgz', 'minc': 'mnc', 'nifti1': 'img', 'nii': 'nii', 'niigz': 'nii.gz', 'spm': 'img'}

## MRIsCALabel

Link to code

> Bases: FSCommandOpenMP

> Wrapped executable: `mris_ca_label`.

> For a single subject, produces an annotation file, in which each cortical surface vertex is assigned a neuroanatomical label.This automatic procedure employs data from a previously-prepared atlas file. An atlas file is created from a training set, capturing region data manually drawn by neuroanatomists combined with statistics on variability correlated to geometric information derived from the cortical model (sulcus and curvature). Besides the atlases provided with FreeSurfer, new ones can be prepared using mris_ca_train).

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> ca_label = freesurfer.MRIsCALabel()
>     >>> ca_label.inputs.subject_id = "test"
>     >>> ca_label.inputs.hemisphere = "lh"
>     >>> ca_label.inputs.canonsurf = "lh.pial"
>     >>> ca_label.inputs.curv = "lh.pial"
>     >>> ca_label.inputs.sulc = "lh.pial"
>     >>> ca_label.inputs.classifier = "im1.nii" # in pracice, use .gcs extension
>     >>> ca_label.inputs.smoothwm = "lh.pial"
>     >>> ca_label.cmdline
>     'mris_ca_label test lh lh.pial im1.nii lh.aparc.annot'

> canonsurfa pathlike object or string representing an existing file

>   Input canonical surface file. Maps to a command-line argument: `%s` (position: -3).

> classifiera pathlike object or string representing an existing file

>   Classifier array input file. Maps to a command-line argument: `%s` (position: -2).

> curva pathlike object or string representing an existing file

>   Implicit input {hemisphere}.curv.

> hemisphere‘lh’ or ‘rh’

>   Hemisphere (‘lh’ or ‘rh’). Maps to a command-line argument: `%s` (position: -4).

> smoothwma pathlike object or string representing an existing file

>   Implicit input {hemisphere}.smoothwm.

> subject_ida string

>   Subject name or ID. Maps to a command-line argument: `%s` (position: -5). (Nipype default value: `subject_id`)

> sulca pathlike object or string representing an existing file

>   Implicit input {hemisphere}.sulc.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> asega pathlike object or string representing an existing file

>   Undocumented flag. Autorecon3 uses ../mri/aseg.presurf.mgz as input file. Maps to a command-line argument: `-aseg %s`.

> copy_inputsa boolean

>   Copies implicit inputs to node directory and creates a temp subjects_directory. Use this when running as a node.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> labela pathlike object or string representing an existing file

>   Undocumented flag. Autorecon3 uses ../label/{hemisphere}.cortex.label as input file. Maps to a command-line argument: `-l %s`.

> num_threadsan integer (int or long)

>   Allows for specifying more threads.

> out_filea pathlike object or string representing a file

>   Annotated surface output file. Maps to a command-line argument: `%s` (position: -1).

> seedan integer (int or long)

>   Maps to a command-line argument: `-seed %d`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing a file

>   Output volume from MRIsCALabel.

> MRIsCALabel.run(**inputs)

>   Execute this interface.

>   This interface will not raise an exception if runtime.returncode is non-zero.

>   Parameters

>     - cwd (specify a folder where the interface should be run) –

>     - inputs (allows the interface settings to be updated) –

>   Returns

>     results – A copy of the instance that was executed, provenance information and, if successful, results

>   Return type

>     `nipype.interfaces.base.support.InterfaceResult`

## Normalize

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_normalize`.

> Normalize the white-matter, optionally based on control points. The input volume is converted into a new volume where white matter image values all range around 110.

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> normalize = freesurfer.Normalize()
>     >>> normalize.inputs.in_file = "T1.mgz"
>     >>> normalize.inputs.gradient = 1
>     >>> normalize.cmdline
>     'mri_normalize -g 1 T1.mgz T1_norm.mgz'

> in_filea pathlike object or string representing an existing file

>   The input file for Normalize. Maps to a command-line argument: `%s` (position: -2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> gradientan integer (int or long)

>   Use max intensity/mm gradient g (default=1). Maps to a command-line argument: `-g %d`.

> maska pathlike object or string representing an existing file

>   The input mask file for Normalize. Maps to a command-line argument: `-mask %s`.

> out_filea pathlike object or string representing a file

>   The output file for Normalize. Maps to a command-line argument: `%s` (position: -1).

> segmentationa pathlike object or string representing an existing file

>   The input segmentation for Normalize. Maps to a command-line argument: `-aseg %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> transforma pathlike object or string representing an existing file

>   Tranform file from the header of the input file.

> out_filea pathlike object or string representing a file

>   The output file for Normalize.

## ParseDICOMDir

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_parse_sdcmdir`.

> Uses mri_parse_sdcmdir to get information from dicom directories

> Examples

>     >>> from nipype.interfaces.freesurfer import ParseDICOMDir
>     >>> dcminfo = ParseDICOMDir()
>     >>> dcminfo.inputs.dicom_dir = '.'
>     >>> dcminfo.inputs.sortbyrun = True
>     >>> dcminfo.inputs.summarize = True
>     >>> dcminfo.cmdline
>     'mri_parse_sdcmdir --d . --o dicominfo.txt --sortbyrun --summarize'

> dicom_dira pathlike object or string representing an existing directory

>   Path to siemens dicom directory. Maps to a command-line argument: `--d %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> dicom_info_filea pathlike object or string representing a file

>   File to which results are written. Maps to a command-line argument: `--o %s`. (Nipype default value: `dicominfo.txt`)

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> sortbyruna boolean

>   Assign run numbers. Maps to a command-line argument: `--sortbyrun`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> summarizea boolean

>   Only print out info for run leaders. Maps to a command-line argument: `--summarize`.

> dicom_info_filea pathlike object or string representing an existing file

>   Text file containing dicom information.

## ReconAll

Link to code

> Bases: CommandLine

> Wrapped executable: `recon-all`.

> Uses recon-all to generate surfaces and parcellations of structural data from anatomical images of a subject.

> Examples

>     >>> from nipype.interfaces.freesurfer import ReconAll
>     >>> reconall = ReconAll()
>     >>> reconall.inputs.subject_id = 'foo'
>     >>> reconall.inputs.directive = 'all'
>     >>> reconall.inputs.subjects_dir = '.'
>     >>> reconall.inputs.T1_files = 'structural.nii'
>     >>> reconall.cmdline
>     'recon-all -all -i structural.nii -subjid foo -sd .'
>     >>> reconall.inputs.flags = "-qcache"
>     >>> reconall.cmdline
>     'recon-all -all -i structural.nii -qcache -subjid foo -sd .'
>     >>> reconall.inputs.flags = ["-cw256", "-qcache"]
>     >>> reconall.cmdline
>     'recon-all -all -i structural.nii -cw256 -qcache -subjid foo -sd .'

> Hemisphere may be specified regardless of directive:

>     >>> reconall.inputs.flags = []
>     >>> reconall.inputs.hemi = 'lh'
>     >>> reconall.cmdline
>     'recon-all -all -i structural.nii -hemi lh -subjid foo -sd .'

> `-autorecon-hemi` uses the `-hemi` input to specify the hemisphere to operate upon:

>     >>> reconall.inputs.directive = 'autorecon-hemi'
>     >>> reconall.cmdline
>     'recon-all -autorecon-hemi lh -i structural.nii -subjid foo -sd .'

> Hippocampal subfields can accept T1 and T2 images:

>     >>> reconall_subfields = ReconAll()
>     >>> reconall_subfields.inputs.subject_id = 'foo'
>     >>> reconall_subfields.inputs.directive = 'all'
>     >>> reconall_subfields.inputs.subjects_dir = '.'
>     >>> reconall_subfields.inputs.T1_files = 'structural.nii'
>     >>> reconall_subfields.inputs.hippocampal_subfields_T1 = True
>     >>> reconall_subfields.cmdline
>     'recon-all -all -i structural.nii -hippocampal-subfields-T1 -subjid foo -sd .'
>     >>> reconall_subfields.inputs.hippocampal_subfields_T2 = (
>     ... 'structural.nii', 'test')
>     >>> reconall_subfields.cmdline
>     'recon-all -all -i structural.nii -hippocampal-subfields-T1T2 structural.nii test -subjid foo -sd .'
>     >>> reconall_subfields.inputs.hippocampal_subfields_T1 = False
>     >>> reconall_subfields.cmdline
>     'recon-all -all -i structural.nii -hippocampal-subfields-T2 structural.nii test -subjid foo -sd .'

> FLAIR_filea pathlike object or string representing an existing file

>   Convert FLAIR image to orig directory. Maps to a command-line argument: `-FLAIR %s`.

> T1_filesa list of items which are a pathlike object or string representing an existing file

>   Name of T1 file to process. Maps to a command-line argument: `-i %s...`.

> T2_filea pathlike object or string representing an existing file

>   Convert T2 image to orig directory. Maps to a command-line argument: `-T2 %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> big_ventriclesa boolean

>   For use in subjects with enlarged ventricles. Maps to a command-line argument: `-bigventricles`.

> brainstema boolean

>   Segment brainstem structures. Maps to a command-line argument: `-brainstem-structures`.

> directive‘all’ or ‘autorecon1’ or ‘autorecon2’ or ‘autorecon2-volonly’ or ‘autorecon2-perhemi’ or ‘autorecon2-inflate1’ or ‘autorecon2-cp’ or ‘autorecon2-wm’ or ‘autorecon3’ or ‘autorecon3-T2pial’ or ‘autorecon-pial’ or ‘autorecon-hemi’ or ‘localGI’ or ‘qcache’

>   Process directive. Maps to a command-line argument: `-%s` (position: 0). (Nipype default value: `all`)

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> experta pathlike object or string representing an existing file

>   Set parameters using expert file. Maps to a command-line argument: `-expert %s`.

> flagsa list of items which are a unicode string

>   Additional parameters. Maps to a command-line argument: `%s`.

> hemi‘lh’ or ‘rh’

>   Hemisphere to process. Maps to a command-line argument: `-hemi %s`.

> hippocampal_subfields_T1a boolean

>   Segment hippocampal subfields using input T1 scan. Maps to a command-line argument: `-hippocampal-subfields-T1`.

> hippocampal_subfields_T2a tuple of the form: (a pathlike object or string representing an existing file, a unicode string)

>   Segment hippocampal subfields using T2 scan, identified by ID (may be combined with hippocampal_subfields_T1). Maps to a command-line argument: `-hippocampal-subfields-T2 %s %s`.

> hiresa boolean

>   Conform to minimum voxel size (for voxels < 1mm). Maps to a command-line argument: `-hires`.

> mpragea boolean

>   Assume scan parameters are MGH MP-RAGE protocol, which produces darker gray matter. Maps to a command-line argument: `-mprage`.

> mri_aparc2asega unicode string

>   Flags to pass to mri_aparc2aseg commands. Mutually exclusive with inputs: `expert`.

> mri_ca_labela unicode string

>   Flags to pass to mri_ca_label commands. Mutually exclusive with inputs: `expert`.

> mri_ca_normalizea unicode string

>   Flags to pass to mri_ca_normalize commands. Mutually exclusive with inputs: `expert`.

> mri_ca_registera unicode string

>   Flags to pass to mri_ca_register commands. Mutually exclusive with inputs: `expert`.

> mri_edit_wm_with_asega unicode string

>   Flags to pass to mri_edit_wm_with_aseg commands. Mutually exclusive with inputs: `expert`.

> mri_em_registera unicode string

>   Flags to pass to mri_em_register commands. Mutually exclusive with inputs: `expert`.

> mri_filla unicode string

>   Flags to pass to mri_fill commands. Mutually exclusive with inputs: `expert`.

> mri_maska unicode string

>   Flags to pass to mri_mask commands. Mutually exclusive with inputs: `expert`.

> mri_normalizea unicode string

>   Flags to pass to mri_normalize commands. Mutually exclusive with inputs: `expert`.

> mri_pretessa unicode string

>   Flags to pass to mri_pretess commands. Mutually exclusive with inputs: `expert`.

> mri_remove_necka unicode string

>   Flags to pass to mri_remove_neck commands. Mutually exclusive with inputs: `expert`.

> mri_segmenta unicode string

>   Flags to pass to mri_segment commands. Mutually exclusive with inputs: `expert`.

> mri_segstatsa unicode string

>   Flags to pass to mri_segstats commands. Mutually exclusive with inputs: `expert`.

> mri_tessellatea unicode string

>   Flags to pass to mri_tessellate commands. Mutually exclusive with inputs: `expert`.

> mri_watersheda unicode string

>   Flags to pass to mri_watershed commands. Mutually exclusive with inputs: `expert`.

> mris_anatomical_statsa unicode string

>   Flags to pass to mris_anatomical_stats commands. Mutually exclusive with inputs: `expert`.

> mris_ca_labela unicode string

>   Flags to pass to mris_ca_label commands. Mutually exclusive with inputs: `expert`.

> mris_fix_topologya unicode string

>   Flags to pass to mris_fix_topology commands. Mutually exclusive with inputs: `expert`.

> mris_inflatea unicode string

>   Flags to pass to mri_inflate commands. Mutually exclusive with inputs: `expert`.

> mris_make_surfacesa unicode string

>   Flags to pass to mris_make_surfaces commands. Mutually exclusive with inputs: `expert`.

> mris_registera unicode string

>   Flags to pass to mris_register commands. Mutually exclusive with inputs: `expert`.

> mris_smootha unicode string

>   Flags to pass to mri_smooth commands. Mutually exclusive with inputs: `expert`.

> mris_spherea unicode string

>   Flags to pass to mris_sphere commands. Mutually exclusive with inputs: `expert`.

> mris_surf2vola unicode string

>   Flags to pass to mris_surf2vol commands. Mutually exclusive with inputs: `expert`.

> mrisp_painta unicode string

>   Flags to pass to mrisp_paint commands. Mutually exclusive with inputs: `expert`.

> openmpan integer (int or long)

>   Number of processors to use in parallel. Maps to a command-line argument: `-openmp %d`.

> parallela boolean

>   Enable parallel execution. Maps to a command-line argument: `-parallel`.

> subject_ida unicode string

>   Subject name. Maps to a command-line argument: `-subjid %s`. (Nipype default value: `recon_all`)

> subjects_dira pathlike object or string representing an existing directory

>   Path to subjects directory. Maps to a command-line argument: `-sd %s`.

> talairacha unicode string

>   Flags to pass to talairach commands. Mutually exclusive with inputs: `expert`.

> use_FLAIRa boolean

>   Use FLAIR image to refine the pial surface. Maps to a command-line argument: `-FLAIRpial`. Mutually exclusive with inputs: `use_T2`.

> use_T2a boolean

>   Use T2 image to refine the pial surface. Maps to a command-line argument: `-T2pial`. Mutually exclusive with inputs: `use_FLAIR`.

> xopts‘use’ or ‘clean’ or ‘overwrite’

>   Use, delete or overwrite existing expert options file. Maps to a command-line argument: `-xopts-%s`.

> BA_statsa list of items which are a pathlike object or string representing an existing file

>   Brodmann Area statistics files.

> T1a pathlike object or string representing an existing file

>   Intensity normalized whole-head volume.

> annota list of items which are a pathlike object or string representing an existing file

>   Surface annotation files.

> aparc_a2009s_statsa list of items which are a pathlike object or string representing an existing file

>   Aparc a2009s parcellation statistics files.

> aparc_asega list of items which are a pathlike object or string representing an existing file

>   Aparc parcellation projected into aseg volume.

> aparc_statsa list of items which are a pathlike object or string representing an existing file

>   Aparc parcellation statistics files.

> area_piala list of items which are a pathlike object or string representing an existing file

>   Mean area of triangles each vertex on the pial surface is associated with.

> asega pathlike object or string representing an existing file

>   Volumetric map of regions from automatic segmentation.

> aseg_statsa list of items which are a pathlike object or string representing an existing file

>   Automated segmentation statistics file.

> avg_curva list of items which are a pathlike object or string representing an existing file

>   Average atlas curvature, sampled to subject.

> braina pathlike object or string representing an existing file

>   Intensity normalized brain-only volume.

> brainmaska pathlike object or string representing an existing file

>   Skull-stripped (brain-only) volume.

> curva list of items which are a pathlike object or string representing an existing file

>   Maps of surface curvature.

> curv_piala list of items which are a pathlike object or string representing an existing file

>   Curvature of pial surface.

> curv_statsa list of items which are a pathlike object or string representing an existing file

>   Curvature statistics files.

> entorhinal_exvivo_statsa list of items which are a pathlike object or string representing an existing file

>   Entorhinal exvivo statistics files.

> filleda pathlike object or string representing an existing file

>   Subcortical mass volume.

> graymida list of items which are a pathlike object or string representing an existing file

>   Graymid/midthickness surface meshes.

> inflateda list of items which are a pathlike object or string representing an existing file

>   Inflated surface meshes.

> jacobian_whitea list of items which are a pathlike object or string representing an existing file

>   Distortion required to register to spherical atlas.

> labela list of items which are a pathlike object or string representing an existing file

>   Volume and surface label files.

> norma pathlike object or string representing an existing file

>   Normalized skull-stripped volume.

> nua pathlike object or string representing an existing file

>   Non-uniformity corrected whole-head volume.

> origa pathlike object or string representing an existing file

>   Base image conformed to Freesurfer space.

> piala list of items which are a pathlike object or string representing an existing file

>   Gray matter/pia mater surface meshes.

> rawavga pathlike object or string representing an existing file

>   Volume formed by averaging input images.

> ribbona list of items which are a pathlike object or string representing an existing file

>   Volumetric maps of cortical ribbons.

> smoothwma list of items which are a pathlike object or string representing an existing file

>   Smoothed original surface meshes.

> spherea list of items which are a pathlike object or string representing an existing file

>   Spherical surface meshes.

> sphere_rega list of items which are a pathlike object or string representing an existing file

>   Spherical registration file.

> subject_ida unicode string

>   Subject name for whom to retrieve data.

> subjects_dira pathlike object or string representing an existing directory

>   Freesurfer subjects directory.

> sulca list of items which are a pathlike object or string representing an existing file

>   Surface maps of sulcal depth.

> thicknessa list of items which are a pathlike object or string representing an existing file

>   Surface maps of cortical thickness.

> volumea list of items which are a pathlike object or string representing an existing file

>   Surface maps of cortical volume.

> whitea list of items which are a pathlike object or string representing an existing file

>   White/gray matter surface meshes.

> wma pathlike object or string representing an existing file

>   Segmented white-matter volume.

> wmparca pathlike object or string representing an existing file

>   Aparc parcellation projected into subcortical white matter.

> wmparc_statsa list of items which are a pathlike object or string representing an existing file

>   White matter parcellation statistics file.

> property ReconAll.cmdline

>   command plus any arguments (args) validates arguments and generates command line

> ReconAll.force_run = False
> property ReconAll.version

>   interfaces should implement a version property

## Resample

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_convert`.

> Use FreeSurfer mri_convert to up or down-sample image files

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> resampler = freesurfer.Resample()
>     >>> resampler.inputs.in_file = 'structural.nii'
>     >>> resampler.inputs.resampled_file = 'resampled.nii'
>     >>> resampler.inputs.voxel_size = (2.1, 2.1, 2.1)
>     >>> resampler.cmdline
>     'mri_convert -vs 2.10 2.10 2.10 -i structural.nii -o resampled.nii'

> in_filea pathlike object or string representing an existing file

>   File to resample. Maps to a command-line argument: `-i %s` (position: -2).

> voxel_sizea tuple of the form: (a float, a float, a float)

>   Triplet of output voxel sizes. Maps to a command-line argument: `-vs %.2f %.2f %.2f`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> resampled_filea pathlike object or string representing a file

>   Output filename. Maps to a command-line argument: `-o %s` (position: -1).

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> resampled_filea pathlike object or string representing an existing file

>   Output filename.

## RobustRegister

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_robust_register`.

> Perform intramodal linear registration (translation and rotation) using robust statistics.

> Examples

>     >>> from nipype.interfaces.freesurfer import RobustRegister
>     >>> reg = RobustRegister()
>     >>> reg.inputs.source_file = 'structural.nii'
>     >>> reg.inputs.target_file = 'T1.nii'
>     >>> reg.inputs.auto_sens = True
>     >>> reg.inputs.init_orient = True
>     >>> reg.cmdline
>     'mri_robust_register --satit --initorient --lta .../structural_robustreg.lta --mov structural.nii --dst T1.nii'

> References

> Reuter, M, Rosas, HD, and Fischl, B, (2010). Highly Accurate Inverse

>   Consistent Registration: A Robust Approach. Neuroimage 53(4) 1181-96.

> auto_sensa boolean

>   Auto-detect good sensitivity. Maps to a command-line argument: `--satit`. Mutually exclusive with inputs: `outlier_sens`.

> outlier_sensa float

>   Set outlier sensitivity explicitly. Maps to a command-line argument: `--sat %.4f`. Mutually exclusive with inputs: `auto_sens`.

> source_filea pathlike object or string representing an existing file

>   Volume to be registered. Maps to a command-line argument: `--mov %s`.

> target_filea pathlike object or string representing an existing file

>   Target volume for the registration. Maps to a command-line argument: `--dst %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> est_int_scalea boolean

>   Estimate intensity scale (recommended for unnormalized images). Maps to a command-line argument: `--iscale`.

> force_doublea boolean

>   Use double-precision intensities. Maps to a command-line argument: `--doubleprec`.

> force_floata boolean

>   Use float intensities. Maps to a command-line argument: `--floattype`.

> half_sourcea boolean or a pathlike object or string representing a file

>   Write source volume mapped to halfway space. Maps to a command-line argument: `--halfmov %s`.

> half_source_xfma boolean or a pathlike object or string representing a file

>   Write transform from source to halfway space. Maps to a command-line argument: `--halfmovlta %s`.

> half_targa boolean or a pathlike object or string representing a file

>   Write target volume mapped to halfway space. Maps to a command-line argument: `--halfdst %s`.

> half_targ_xfma boolean or a pathlike object or string representing a file

>   Write transform from target to halfway space. Maps to a command-line argument: `--halfdstlta %s`.

> half_weightsa boolean or a pathlike object or string representing a file

>   Write weights volume mapped to halfway space. Maps to a command-line argument: `--halfweights %s`.

> high_iterationsan integer (int or long)

>   Max # of times on highest resolution. Maps to a command-line argument: `--highit %d`.

> in_xfm_filea pathlike object or string representing an existing file

>   Use initial transform on source. Maps to a command-line argument: `--transform`.

> init_orienta boolean

>   Use moments for initial orient (recommended for stripped brains). Maps to a command-line argument: `--initorient`.

> iteration_thresha float

>   Stop iterations when below threshold. Maps to a command-line argument: `--epsit %.3f`.

> least_squaresa boolean

>   Use least squares instead of robust estimator. Maps to a command-line argument: `--leastsquares`.

> mask_sourcea pathlike object or string representing an existing file

>   Image to mask source volume with. Maps to a command-line argument: `--maskmov %s`.

> mask_targeta pathlike object or string representing an existing file

>   Image to mask target volume with. Maps to a command-line argument: `--maskdst %s`.

> max_iterationsan integer (int or long)

>   Maximum # of times on each resolution. Maps to a command-line argument: `--maxit %d`.

> no_inita boolean

>   Skip transform init. Maps to a command-line argument: `--noinit`.

> no_multia boolean

>   Work on highest resolution. Maps to a command-line argument: `--nomulti`.

> out_reg_filea bool or None or a pathlike object or string representing a file

>   Registration file; either True or filename. Maps to a command-line argument: `--lta %s`. (Nipype default value: `True`)

> outlier_limita float

>   Set maximal outlier limit in satit. Maps to a command-line argument: `--wlimit %.3f`.

> registered_filea boolean or a pathlike object or string representing a file

>   Registered image; either True or filename. Maps to a command-line argument: `--warp %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> subsample_threshan integer (int or long)

>   Subsample if dimension is above threshold size. Maps to a command-line argument: `--subsample %d`.

> trans_onlya boolean

>   Find 3 parameter translation only. Maps to a command-line argument: `--transonly`.

> weights_filea boolean or a pathlike object or string representing a file

>   Weights image to write; either True or filename. Maps to a command-line argument: `--weights %s`.

> write_vo2voxa boolean

>   Output vox2vox matrix (default is RAS2RAS). Maps to a command-line argument: `--vox2vox`.

> half_sourcea pathlike object or string representing an existing file

>   Source image mapped to halfway space.

> half_source_xfma pathlike object or string representing an existing file

>   Transform file to map source image to halfway space.

> half_targa pathlike object or string representing an existing file

>   Target image mapped to halfway space.

> half_targ_xfma pathlike object or string representing an existing file

>   Transform file to map target image to halfway space.

> half_weightsa pathlike object or string representing an existing file

>   Weights image mapped to halfway space.

> out_reg_filea pathlike object or string representing an existing file

>   Output registration file.

> registered_filea pathlike object or string representing an existing file

>   Output image with registration applied.

> weights_filea pathlike object or string representing an existing file

>   Image of weights used.

## SegmentCC

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_cc`.

> This program segments the corpus callosum into five separate labels in the subcortical segmentation volume ‘aseg.mgz’. The divisions of the cc are equally spaced in terms of distance along the primary eigendirection (pretty much the long axis) of the cc. The lateral extent can be changed with the -T <thickness> parameter, where <thickness> is the distance off the midline (so -T 1 would result in the who CC being 3mm thick). The default is 2 so it’s 5mm thick. The aseg.stats values should be volume.

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> SegmentCC_node = freesurfer.SegmentCC()
>     >>> SegmentCC_node.inputs.in_file = "aseg.mgz"
>     >>> SegmentCC_node.inputs.in_norm = "norm.mgz"
>     >>> SegmentCC_node.inputs.out_rotation = "cc.lta"
>     >>> SegmentCC_node.inputs.subject_id = "test"
>     >>> SegmentCC_node.cmdline
>     'mri_cc -aseg aseg.mgz -o aseg.auto.mgz -lta cc.lta test'

> in_filea pathlike object or string representing an existing file

>   Input aseg file to read from subjects directory. Maps to a command-line argument: `-aseg %s`.

> in_norma pathlike object or string representing an existing file

>   Required undocumented input {subject}/mri/norm.mgz.

> out_rotationa pathlike object or string representing a file

>   Global filepath for writing rotation lta. Maps to a command-line argument: `-lta %s`.

> subject_ida string

>   Subject name. Maps to a command-line argument: `%s` (position: -1). (Nipype default value: `subject_id`)

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> copy_inputsa boolean

>   If running as a node, set this to True.This will copy the input files to the node directory.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> out_filea pathlike object or string representing a file

>   Filename to write aseg including CC. Maps to a command-line argument: `-o %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing a file

>   Output segmentation uncluding corpus collosum.

> out_rotationa pathlike object or string representing a file

>   Output lta rotation file.

> SegmentCC.aggregate_outputs(runtime=None, needed_outputs=None)

>   Collate expected outputs and apply output traits validation.

> SegmentCC.run(**inputs)

>   Execute this interface.

>   This interface will not raise an exception if runtime.returncode is non-zero.

>   Parameters

>     - cwd (specify a folder where the interface should be run) –

>     - inputs (allows the interface settings to be updated) –

>   Returns

>     results – A copy of the instance that was executed, provenance information and, if successful, results

>   Return type

>     `nipype.interfaces.base.support.InterfaceResult`

## SegmentWM

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_segment`.

> This program segments white matter from the input volume. The input volume should be normalized such that white matter voxels are ~110-valued, and the volume is conformed to 256^3.

> Examples

>     >>> from nipype.interfaces import freesurfer
>     >>> SegmentWM_node = freesurfer.SegmentWM()
>     >>> SegmentWM_node.inputs.in_file = "norm.mgz"
>     >>> SegmentWM_node.inputs.out_file = "wm.seg.mgz"
>     >>> SegmentWM_node.cmdline
>     'mri_segment norm.mgz wm.seg.mgz'

> in_filea pathlike object or string representing an existing file

>   Input file for SegmentWM. Maps to a command-line argument: `%s` (position: -2).

> out_filea pathlike object or string representing a file

>   File to be written as output for SegmentWM. Maps to a command-line argument: `%s` (position: -1).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing a file

>   Output white matter segmentation.

## Smooth

Link to code

> Bases: FSCommand

> Wrapped executable: `mris_volsmooth`.

> Use FreeSurfer mris_volsmooth to smooth a volume

> This function smoothes cortical regions on a surface and non-cortical regions in volume.

> Note

> Cortical voxels are mapped to the surface (3D->2D) and then the smoothed values from the surface are put back into the volume to fill the cortical ribbon. If data is smoothed with this algorithm, one has to be careful about how further processing is interpreted.

> Examples

>     >>> from nipype.interfaces.freesurfer import Smooth
>     >>> smoothvol = Smooth(in_file='functional.nii', smoothed_file = 'foo_out.nii', reg_file='register.dat', surface_fwhm=10, vol_fwhm=6)
>     >>> smoothvol.cmdline
>     'mris_volsmooth --i functional.nii --reg register.dat --o foo_out.nii --fwhm 10.000000 --vol-fwhm 6.000000'

> in_filea pathlike object or string representing an existing file

>   Source volume. Maps to a command-line argument: `--i %s`.

> num_itersa long integer >= 1

>   Number of iterations instead of fwhm. Maps to a command-line argument: `--niters %d`. Mutually exclusive with inputs: `surface_fwhm`.

> reg_filea pathlike object or string representing an existing file

>   Registers volume to surface anatomical . Maps to a command-line argument: `--reg %s`.

> surface_fwhma floating point number >= 0.0

>   Surface FWHM in mm. Maps to a command-line argument: `--fwhm %f`. Mutually exclusive with inputs: `num_iters`. Requires inputs: `reg_file`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> proj_fraca float

>   Project frac of thickness a long surface normal. Maps to a command-line argument: `--projfrac %s`. Mutually exclusive with inputs: `proj_frac_avg`.

> proj_frac_avga tuple of the form: (a float, a float, a float)

>   Average a long normal min max delta. Maps to a command-line argument: `--projfrac-avg %.2f %.2f %.2f`. Mutually exclusive with inputs: `proj_frac`.

> smoothed_filea pathlike object or string representing a file

>   Output volume. Maps to a command-line argument: `--o %s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> vol_fwhma floating point number >= 0.0

>   Volume smoothing outside of surface. Maps to a command-line argument: `--vol-fwhm %f`.

> smoothed_filea pathlike object or string representing an existing file

>   Smoothed input volume.

## SynthesizeFLASH

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_synthesize`.

> Synthesize a FLASH acquisition from T1 and proton density maps.

> Examples

>     >>> from nipype.interfaces.freesurfer import SynthesizeFLASH
>     >>> syn = SynthesizeFLASH(tr=20, te=3, flip_angle=30)
>     >>> syn.inputs.t1_image = 'T1.mgz'
>     >>> syn.inputs.pd_image = 'PD.mgz'
>     >>> syn.inputs.out_file = 'flash_30syn.mgz'
>     >>> syn.cmdline
>     'mri_synthesize 20.00 30.00 3.000 T1.mgz PD.mgz flash_30syn.mgz'

> flip_anglea float

>   Flip angle (in degrees). Maps to a command-line argument: `%.2f` (position: 3).

> pd_imagea pathlike object or string representing an existing file

>   Image of proton density values. Maps to a command-line argument: `%s` (position: 6).

> t1_imagea pathlike object or string representing an existing file

>   Image of T1 values. Maps to a command-line argument: `%s` (position: 5).

> tea float

>   Echo time (in msec). Maps to a command-line argument: `%.3f` (position: 4).

> tra float

>   Repetition time (in msec). Maps to a command-line argument: `%.2f` (position: 2).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> fixed_weightinga boolean

>   Use a fixed weighting to generate optimal gray/white contrast. Maps to a command-line argument: `-w` (position: 1).

> out_filea pathlike object or string representing a file

>   Image to write. Maps to a command-line argument: `%s`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> out_filea pathlike object or string representing an existing file

>   Synthesized FLASH acquisition.

## UnpackSDICOMDir

Link to code

> Bases: FSCommand

> Wrapped executable: `unpacksdcmdir`.

> Use unpacksdcmdir to convert dicom files

> Call unpacksdcmdir -help from the command line to see more information on using this command.

> Examples

>     >>> from nipype.interfaces.freesurfer import UnpackSDICOMDir
>     >>> unpack = UnpackSDICOMDir()
>     >>> unpack.inputs.source_dir = '.'
>     >>> unpack.inputs.output_dir = '.'
>     >>> unpack.inputs.run_info = (5, 'mprage', 'nii', 'struct')
>     >>> unpack.inputs.dir_structure = 'generic'
>     >>> unpack.cmdline
>     'unpacksdcmdir -generic -targ . -run 5 mprage nii struct -src .'

> configa pathlike object or string representing an existing file

>   Specify unpacking rules in file. Maps to a command-line argument: `-cfg %s`. Mutually exclusive with inputs: `run_info`, `config`, `seq_config`.

> run_infoa tuple of the form: (an integer (int or long), a unicode string, a unicode string, a unicode string)

>   Runno subdir format name : spec unpacking rules on cmdline. Maps to a command-line argument: `-run %d %s %s %s`. Mutually exclusive with inputs: `run_info`, `config`, `seq_config`.

> seq_configa pathlike object or string representing an existing file

>   Specify unpacking rules based on sequence. Maps to a command-line argument: `-seqcfg %s`. Mutually exclusive with inputs: `run_info`, `config`, `seq_config`.

> source_dira pathlike object or string representing an existing directory

>   Directory with the DICOM files. Maps to a command-line argument: `-src %s`.

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> dir_structure‘fsfast’ or ‘generic’

>   Unpack to specified directory structures. Maps to a command-line argument: `-%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> log_filea pathlike object or string representing an existing file

>   Explicilty set log file. Maps to a command-line argument: `-log %s`.

> no_info_dumpa boolean

>   Do not create infodump file. Maps to a command-line argument: `-noinfodump`.

> no_unpack_erra boolean

>   Do not try to unpack runs with errors. Maps to a command-line argument: `-no-unpackerr`.

> output_dira pathlike object or string representing a directory

>   Top directory into which the files will be unpacked. Maps to a command-line argument: `-targ %s`.

> scan_onlya pathlike object or string representing an existing file

>   Only scan the directory and put result in file. Maps to a command-line argument: `-scanonly %s`.

> spm_zeropadan integer (int or long)

>   Set frame number zero padding width for SPM. Maps to a command-line argument: `-nspmzeropad %d`.

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

## WatershedSkullStrip

Link to code

> Bases: FSCommand

> Wrapped executable: `mri_watershed`.

> This program strips skull and other outer non-brain tissue and produces the brain volume from T1 volume or the scanned volume.

> The “watershed” segmentation algorithm was used to dertermine the intensity values for white matter, grey matter, and CSF. A force field was then used to fit a spherical surface to the brain. The shape of the surface fit was then evaluated against a previously derived template.

> The default parameters are: -w 0.82 -b 0.32 -h 10 -seedpt -ta -wta

> (Segonne 2004)

> Examples

>     >>> from nipype.interfaces.freesurfer import WatershedSkullStrip
>     >>> skullstrip = WatershedSkullStrip()
>     >>> skullstrip.inputs.in_file = "T1.mgz"
>     >>> skullstrip.inputs.t1 = True
>     >>> skullstrip.inputs.transform = "transforms/talairach_with_skull.lta"
>     >>> skullstrip.inputs.out_file = "brainmask.auto.mgz"
>     >>> skullstrip.cmdline
>     'mri_watershed -T1 transforms/talairach_with_skull.lta T1.mgz brainmask.auto.mgz'

> in_filea pathlike object or string representing an existing file

>   Input volume. Maps to a command-line argument: `%s` (position: -2).

> out_filea pathlike object or string representing a file

>   Output volume. Maps to a command-line argument: `%s` (position: -1). (Nipype default value: `brainmask.auto.mgz`)

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> brain_atlasa pathlike object or string representing an existing file

>   Maps to a command-line argument: `-brain_atlas %s` (position: -4).

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> subjects_dira pathlike object or string representing an existing directory

>   Subjects directory.

> t1a boolean

>   Specify T1 input volume (T1 grey value = 110). Maps to a command-line argument: `-T1`.

> transforma pathlike object or string representing a file

>   Undocumented. Maps to a command-line argument: `%s` (position: -3).

> out_filea pathlike object or string representing a file

>   Skull stripped brain volume.