.. AUTO-GENERATED FILE -- DO NOT EDIT!

workflows.fmri.spm.preprocess
=============================


.. module:: nipype.workflows.fmri.spm.preprocess


.. _nipype.workflows.fmri.spm.preprocess.create_spm_preproc:

:func:`create_spm_preproc`
--------------------------

`Link to code <http://github.com/nipy/nipype/tree/99796c15f2e157774a3f54f878fdd06ad981a80b/nipype/workflows/fmri/spm/preprocess.py#L15>`_



Create an spm preprocessing workflow with freesurfer registration and
artifact detection.

The workflow realigns and smooths and registers the functional images with
the subject's freesurfer space.

Example
~~~~~~~

>>> preproc = create_spm_preproc()
>>> preproc.base_dir = '.'
>>> preproc.inputs.inputspec.fwhm = 6
>>> preproc.inputs.inputspec.subject_id = 's1'
>>> preproc.inputs.inputspec.subjects_dir = '.'
>>> preproc.inputs.inputspec.functionals = ['f3.nii', 'f5.nii']
>>> preproc.inputs.inputspec.norm_threshold = 1
>>> preproc.inputs.inputspec.zintensity_threshold = 3

Inputs::

     inputspec.functionals : functional runs use 4d nifti
     inputspec.subject_id : freesurfer subject id
     inputspec.subjects_dir : freesurfer subjects dir
     inputspec.fwhm : smoothing fwhm
     inputspec.norm_threshold : norm threshold for outliers
     inputspec.zintensity_threshold : intensity threshold in z-score

Outputs::

     outputspec.realignment_parameters : realignment parameter files
     outputspec.smoothed_files : smoothed functional files
     outputspec.outlier_files : list of outliers
     outputspec.outlier_stats : statistics of outliers
     outputspec.outlier_plots : images of outliers
     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
~~~~~

.. graphviz::

	digraph preproc{

	  label="preproc";

	  preproc_inputspec[label="inputspec (utility)"];

	  preproc_realign[label="realign (spm)"];

	  preproc_artdetect[label="artdetect (rapidart)"];

	  preproc_smooth[label="smooth (spm)"];

	  preproc_outputspec[label="outputspec (utility)"];

	  preproc_inputspec -> preproc_realign;

	  preproc_inputspec -> preproc_artdetect;

	  preproc_inputspec -> preproc_artdetect;

	  preproc_inputspec -> preproc_smooth;

	  preproc_realign -> preproc_outputspec;

	  preproc_realign -> preproc_artdetect;

	  preproc_realign -> preproc_artdetect;

	  preproc_realign -> preproc_smooth;

	  subgraph cluster_preproc_getmask {

	      label="getmask";

	    preproc_getmask_inputspec[label="inputspec (utility)"];

	    preproc_getmask_fssource[label="fssource (io)"];

	    preproc_getmask_register[label="register (freesurfer)"];

	    preproc_getmask_threshold[label="threshold (freesurfer)"];

	    preproc_getmask_transform[label="transform (freesurfer)"];

	    preproc_getmask_threshold2[label="threshold2 (freesurfer)"];

	    preproc_getmask_outputspec[label="outputspec (utility)"];

	    preproc_getmask_inputspec -> preproc_getmask_fssource;

	    preproc_getmask_inputspec -> preproc_getmask_fssource;

	    preproc_getmask_inputspec -> preproc_getmask_transform;

	    preproc_getmask_inputspec -> preproc_getmask_transform;

	    preproc_getmask_inputspec -> preproc_getmask_register;

	    preproc_getmask_inputspec -> preproc_getmask_register;

	    preproc_getmask_inputspec -> preproc_getmask_register;

	    preproc_getmask_inputspec -> preproc_getmask_register;

	    preproc_getmask_fssource -> preproc_getmask_threshold;

	    preproc_getmask_register -> preproc_getmask_transform;

	    preproc_getmask_register -> preproc_getmask_outputspec;

	    preproc_getmask_register -> preproc_getmask_outputspec;

	    preproc_getmask_threshold -> preproc_getmask_transform;

	    preproc_getmask_transform -> preproc_getmask_threshold2;

	    preproc_getmask_threshold2 -> preproc_getmask_outputspec;

	  }

	  preproc_artdetect -> preproc_outputspec;

	  preproc_artdetect -> preproc_outputspec;

	  preproc_artdetect -> preproc_outputspec;

	  preproc_smooth -> preproc_outputspec;

	  preproc_getmask_outputspec -> preproc_outputspec;

	  preproc_getmask_outputspec -> preproc_outputspec;

	  preproc_getmask_outputspec -> preproc_outputspec;

	  preproc_getmask_outputspec -> preproc_artdetect;

	  preproc_realign -> preproc_getmask_inputspec;

	  preproc_inputspec -> preproc_getmask_inputspec;

	  preproc_inputspec -> preproc_getmask_inputspec;

	}


.. _nipype.workflows.fmri.spm.preprocess.create_DARTEL_template:

:func:`create_DARTEL_template`
------------------------------

`Link to code <http://github.com/nipy/nipype/tree/99796c15f2e157774a3f54f878fdd06ad981a80b/nipype/workflows/fmri/spm/preprocess.py#L224>`_



Create a vbm workflow that generates DARTEL-based template


Example
~~~~~~~

>>> preproc = create_DARTEL_template()
>>> preproc.inputs.inputspec.structural_files = [os.path.abspath('s1.nii'), os.path.abspath('s3.nii')]
>>> preproc.inputs.inputspec.template_prefix = 'Template'
>>> preproc.run() # doctest: +SKIP

Inputs::

     inputspec.structural_files : structural data to be used to create templates
     inputspec.template_prefix : prefix for dartel template

Outputs::

     outputspec.template_file : DARTEL template
     outputspec.flow_fields : warps from input struct files to the template


.. _nipype.workflows.fmri.spm.preprocess.create_vbm_preproc:

:func:`create_vbm_preproc`
--------------------------

`Link to code <http://github.com/nipy/nipype/tree/99796c15f2e157774a3f54f878fdd06ad981a80b/nipype/workflows/fmri/spm/preprocess.py#L131>`_



Create a vbm workflow that generates DARTEL-based warps to MNI space

Based on: http://www.fil.ion.ucl.ac.uk/~john/misc/VBMclass10.pdf

Example
~~~~~~~

>>> preproc = create_vbm_preproc()
>>> preproc.inputs.inputspec.fwhm = 8
>>> preproc.inputs.inputspec.structural_files = [os.path.abspath('s1.nii'), os.path.abspath('s3.nii')]
>>> preproc.inputs.inputspec.template_prefix = 'Template'
>>> preproc.run() # doctest: +SKIP

Inputs::

     inputspec.structural_files : structural data to be used to create templates
     inputspec.fwhm: single of triplet for smoothing when normalizing to MNI space
     inputspec.template_prefix : prefix for dartel template

Outputs::

     outputspec.normalized_files : normalized gray matter files
     outputspec.template_file : DARTEL template
     outputspec.icv : intracranial volume (cc - assuming dimensions in mm)

