Home · Quickstart · Documentation · About · Nipy

# workflows.smri.freesurfer.utils

## `create_get_stats_flow()`

Link to code

Retrieves stats from labels

### Parameters

name : string
  name of workflow
withreg : boolean
  indicates whether to register source to label

### Example

Inputs:

    inputspec.source_file : reference image for mask generation
    inputspec.label_file : label file from which to get ROIs

    (optionally with registration)
    inputspec.reg_file : bbreg file (assumes reg from source to label
    inputspec.inverse : boolean whether to invert the registration
    inputspec.subjects_dir : freesurfer subjects directory

Outputs:

    outputspec.stats_file : stats file

### Graph

## `create_getmask_flow()`

Link to code

Registers a source file to freesurfer space and create a brain mask in source space

Requires fsl tools for initializing registration

### Parameters

name : string
  name of workflow
dilate_mask : boolean
  indicates whether to dilate mask or not

### Example

    >>> getmask = create_getmask_flow()
    >>> getmask.inputs.inputspec.source_file = 'mean.nii'
    >>> getmask.inputs.inputspec.subject_id = 's1'
    >>> getmask.inputs.inputspec.subjects_dir = '.'
    >>> getmask.inputs.inputspec.contrast_type = 't2'

Inputs:

    inputspec.source_file : reference image for mask generation
    inputspec.subject_id : freesurfer subject id
    inputspec.subjects_dir : freesurfer subjects directory
    inputspec.contrast_type : MR contrast of reference image

Outputs:

    outputspec.mask_file : binary mask file in reference image space
    outputspec.reg_file : registration file that maps reference image to
                          freesurfer space
    outputspec.reg_cost : cost of registration (useful for detecting misalignment)

### Graph

## `create_tessellation_flow()`

Link to code

Tessellates the input subject’s aseg.mgz volume and returns the surfaces for each region in stereolithic (.stl) format

### Example

    >>> from nipype.workflows.smri.freesurfer import create_tessellation_flow
    >>> tessflow = create_tessellation_flow()
    >>> tessflow.inputs.inputspec.subject_id = 'subj1'
    >>> tessflow.inputs.inputspec.subjects_dir = '.'
    >>> tessflow.inputs.inputspec.lookup_file = 'FreeSurferColorLUT.txt'
    >>> tessflow.run()

Inputs:

    inputspec.subject_id : freesurfer subject id
    inputspec.subjects_dir : freesurfer subjects directory
    inputspec.lookup_file : lookup file from freesurfer directory

Outputs:

    outputspec.meshes : output region meshes in (by default) stereolithographic (.stl) format

### Graph

## `copy_file()`

Link to code

Create a function to copy a file that can be modified by a following node without changing the original file.

## `copy_files()`

Link to code

Create a function to copy a file that can be modified by a following node without changing the original file

## `get_aparc_aseg()`

Link to code

Return the aparc+aseg.mgz file

## `getdefaultconfig()`

Link to code

## `mkdir_p()`

Link to code