Skip to content

HTML structure format corrections for example scripts #980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/dmri_camino_dti.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
============

This script, camino_dti_tutorial.py, demonstrates the ability to perform basic diffusion analysis
in a Nipype pipeline.
in a Nipype pipeline::

python dmri_camino_dti.py

Expand Down
10 changes: 5 additions & 5 deletions examples/dmri_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

This script, connectivity_tutorial.py, demonstrates the ability to perform connectivity mapping
using Nipype for pipelining, Freesurfer for Reconstruction / Parcellation, Camino for tensor-fitting
and tractography, and the Connectome Mapping Toolkit (CMTK) for connectivity analysis.
and tractography, and the Connectome Mapping Toolkit (CMTK) for connectivity analysis::

python connectivity_tutorial.py

Expand All @@ -26,9 +26,9 @@

* http://db.tt/1vx4vLeP

Along with Camino (http://web4.cs.ucl.ac.uk/research/medic/camino/pmwiki/pmwiki.php?n=Main.HomePage),
Camino-Trackvis (http://www.nitrc.org/projects/camino-trackvis/), FSL (http://www.fmrib.ox.ac.uk/fsl/),
and Freesurfer (http://surfer.nmr.mgh.harvard.edu/), you must also have the Connectome File Format
Along with `Camino <http://web4.cs.ucl.ac.uk/research/medic/camino/pmwiki/pmwiki.php?n=Main.HomePage>`_,
`Camino-Trackvis <http://www.nitrc.org/projects/camino-trackvis/>`_, `FSL <http://www.fmrib.ox.ac.uk/fsl/>`_,
and `Freesurfer <http://surfer.nmr.mgh.harvard.edu/>`_, you must also have the Connectome File Format
library installed as well as the Connectome Mapper.

These are written by Stephan Gerhard and can be obtained from:
Expand Down Expand Up @@ -583,7 +583,7 @@ def select_aparc_annot(list_of_files):
connectivity.write_graph(format='eps')

"""
The output CFF file of this pipeline can be loaded in the Connectome Viewer (http://www.cmtk.org)
The output CFF file of this pipeline can be loaded in the `Connectome Viewer <http://www.cmtk.org>`_.
After loading the network into memory it can be examined in 3D or as a connectivity matrix
using the default scripts produced by the Code Oracle.
To compare networks, one must use the MergeCNetworks interface to merge two networks into
Expand Down
2 changes: 1 addition & 1 deletion examples/dmri_connectivity_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

This script, connectivity_tutorial_advanced.py, demonstrates the ability to perform connectivity mapping
using Nipype for pipelining, Freesurfer for Reconstruction / Segmentation, MRtrix for spherical deconvolution
and tractography, and the Connectome Mapping Toolkit (CMTK) for further parcellation and connectivity analysis.
and tractography, and the Connectome Mapping Toolkit (CMTK) for further parcellation and connectivity analysis::

python connectivity_tutorial_advanced.py

Expand Down
6 changes: 3 additions & 3 deletions examples/dmri_fsl_dti.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
"""
===============
dMRI [DTI, FSL]
===============
==============
dMRI: DTI, FSL
==============

A pipeline example that uses several interfaces to perform analysis on
diffusion weighted images using FSL FDT tools.
Expand Down
2 changes: 1 addition & 1 deletion examples/dmri_group_connectivity_camino.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This script, dmri_group_connectivity_camino.py, runs group-based connectivity analysis using
the dmri.camino.connectivity_mapping Nipype workflow. Further detail on the processing can be
found in :doc:`dmri_connectivity`. This tutorial can be run using:
found in :doc:`dmri_connectivity`. This tutorial can be run using::

python dmri_group_connectivity_camino.py

Expand Down
2 changes: 1 addition & 1 deletion examples/dmri_group_connectivity_mrtrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This script, dmri_group_connectivity_mrtrix.py, runs group-based connectivity analysis using
the dmri.mrtrix.connectivity_mapping Nipype workflow. Further detail on the processing can be
found in :doc:`dmri_connectivity_advanced`. This tutorial can be run using:
found in :doc:`dmri_connectivity_advanced`. This tutorial can be run using::

python dmri_group_connectivity_mrtrix.py

Expand Down
2 changes: 1 addition & 1 deletion examples/dmri_mrtrix_dti.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
============

This script, dmri_mrtrix_dti.py, demonstrates the ability to perform advanced diffusion analysis
in a Nipype pipeline.
in a Nipype pipeline::

python dmri_mrtrix_dti.py

Expand Down
1 change: 1 addition & 0 deletions examples/dmri_tbss_nki.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
A pipeline to do a TBSS analysis on the NKI rockland sample data

"""

from nipype.workflows.dmri.fsl.dti import create_eddy_correct_pipeline
from nipype.workflows.dmri.fsl.tbss import create_tbss_non_FA, create_tbss_all

Expand Down
24 changes: 17 additions & 7 deletions examples/fmri_ants_openfmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
=============================================

A growing number of datasets are available on `OpenfMRI <http://openfmri.org>`_.
This script demonstrates how to use nipype to analyze a data set.
This script demonstrates how to use nipype to analyze a data set::

python fmri_ants_openfmri.py --datasetdir ds107
"""
Expand Down Expand Up @@ -47,19 +47,16 @@ def create_reg_workflow(name='registration'):

Parameters
----------

::

name : name of workflow (default: 'registration')

Inputs::
Inputs:

inputspec.source_files : files (filename or list of filenames to register)
inputspec.mean_image : reference image to use
inputspec.anatomical_image : anatomical image to coregister to
inputspec.target_image : registration target

Outputs::
Outputs:

outputspec.func2anat_transform : FLIRT transform
outputspec.anat2target_transform : FLIRT+FNIRT transform
Expand All @@ -68,7 +65,6 @@ def create_reg_workflow(name='registration'):

Example
-------

"""

register = pe.Workflow(name=name)
Expand Down Expand Up @@ -130,6 +126,7 @@ def create_reg_workflow(name='registration'):
register.connect(inputnode, 'anatomical_image', mean2anatbbr, 'reference')
register.connect(mean2anat, 'out_matrix_file',
mean2anatbbr, 'in_matrix_file')

"""
Convert the BBRegister transformation to ANTS ITK format
"""
Expand Down Expand Up @@ -197,6 +194,7 @@ def create_reg_workflow(name='registration'):
"""
Transform the mean image. First to anatomical and then to target
"""

warpmean = pe.Node(ants.ApplyTransforms(),
name='warpmean')
warpmean.inputs.input_image_type = 3
Expand Down Expand Up @@ -238,6 +236,10 @@ def create_reg_workflow(name='registration'):

return register

"""
Get info for a given subject
"""

def get_subjectinfo(subject_id, base_dir, task_id, model_id):
"""Get info for a given subject

Expand Down Expand Up @@ -291,6 +293,9 @@ def get_subjectinfo(subject_id, base_dir, task_id, model_id):
TR = np.genfromtxt(os.path.join(base_dir, 'scan_key.txt'))[1]
return run_ids[task_id - 1], conds[task_id - 1], TR

"""
Analyzes an open fmri dataset
"""

def analyze_openfmri_dataset(data_dir, subject=None, model_id=None,
task_id=None, output_dir=None, subj_prefix='*',
Expand Down Expand Up @@ -621,6 +626,7 @@ def get_subs(subject_id, conds, model_id, task_id):
"""
Set processing parameters
"""

preproc.inputs.inputspec.fwhm = fwhm
gethighpass.inputs.hpcutoff = hpcutoff
modelspec.inputs.high_pass_filter_cutoff = hpcutoff
Expand All @@ -634,6 +640,10 @@ def get_subs(subject_id, conds, model_id, task_id):
datasink.inputs.base_directory = output_dir
return wf

"""
The following functions run the whole workflow.
"""

if __name__ == '__main__':
import argparse
defstr = ' (default %(default)s)'
Expand Down
7 changes: 3 additions & 4 deletions examples/fmri_nipy_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
fMRI: NiPy GLM, SPM
===================


The fmri_nipy_glm.py integrates several interfaces to perform a first level
analysis on a two-subject data set. It is very similar to the spm_tutorial with
the difference of using nipy for fitting GLM model and estimating contrasts.
The tutorial can
be found in the examples folder. Run the tutorial from inside the
nipype tutorial directory:
The tutorial can be found in the examples folder. Run the tutorial from inside
the nipype tutorial directory::

python fmri_nipy_glm.py

"""

from nipype.interfaces.nipy.model import FitGLM, EstimateContrast
from nipype.interfaces.nipy.preprocess import ComputeMask

Expand Down
6 changes: 5 additions & 1 deletion examples/fmri_openfmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
============================

A growing number of datasets are available on `OpenfMRI <http://openfmri.org>`_.
This script demonstrates how to use nipype to analyze a data set.
This script demonstrates how to use nipype to analyze a data set::

python fmri_openfmri.py --datasetdir ds107
"""
Expand Down Expand Up @@ -421,6 +421,10 @@ def get_subs(subject_id, conds, model_id, task_id):
datasink.inputs.base_directory = output_dir
return wf

"""
The following functions run the whole workflow.
"""

if __name__ == '__main__':
import argparse
defstr = ' (default %(default)s)'
Expand Down
4 changes: 2 additions & 2 deletions examples/fmri_slicer_coregistration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
=====================================

This is currently not working and will raise an exception in release 0.3. It
will be fixed in a later release.
will be fixed in a later release::

python fmri_slicer_coregistration.py

"""

#raise RuntimeWarning, 'Slicer not fully implmented'
from nipype.interfaces.slicer import BRAINSFit, BRAINSResample



"""Import necessary modules from nipype."""

import nipype.interfaces.io as nio # Data i/o
Expand Down
2 changes: 1 addition & 1 deletion examples/fmri_spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
The fmri_spm.py integrates several interfaces to perform a first
and second level analysis on a two-subject data set. The tutorial can
be found in the examples folder. Run the tutorial from inside the
nipype tutorial directory:
nipype tutorial directory::

python fmri_spm.py

Expand Down
8 changes: 5 additions & 3 deletions examples/fmri_spm_auditory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
Introduction
============

The fmri_spm_auditory.py recreates the classical workflow described in the SPM8 manual (http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf)
using auditory dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/:
The fmri_spm_auditory.py recreates the classical workflow described in the
`SPM8 manual <http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf>`_ using auditory
dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/::

python fmri_spm_auditory.py

Expand All @@ -19,7 +20,8 @@
import nipype.interfaces.io as nio # Data i/o
import nipype.interfaces.spm as spm # spm
import nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.matlab as mlab # how to run matlabimport nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.matlab as mlab # how to run matlab
import nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.utility as util # utility
import nipype.pipeline.engine as pe # pypeline engine
import nipype.algorithms.modelgen as model # model specification
Expand Down
2 changes: 1 addition & 1 deletion examples/fmri_spm_dartel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
The fmri_spm_dartel.py integrates several interfaces to perform a first
and second level analysis on a two-subject data set. The tutorial can
be found in the examples folder. Run the tutorial from inside the
nipype tutorial directory:
nipype tutorial directory::

python fmri_spm_dartel.py

Expand Down
9 changes: 4 additions & 5 deletions examples/fmri_spm_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
Introduction
============

The fmri_spm_face.py recreates the classical workflow described in the SPM8
manual (http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf) using auditory dataset
that can be downloaded from
http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/face_rep_SPM5.html::
The fmri_spm_face.py recreates the classical workflow described in the
`SPM8 manual <http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf>`_ using face
dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/::

python fmri_spm.py

Expand Down Expand Up @@ -271,7 +270,7 @@ def makelist(item):
from nipype.interfaces.base import Bunch

"""We're importing the onset times from a mat file (found on
http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/face_rep_SPM5.html
http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/)
"""

from scipy.io.matlab import loadmat
Expand Down
2 changes: 1 addition & 1 deletion examples/fmri_spm_nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
The fmri_spm.py integrates several interfaces to perform a first
and second level analysis on a two-subject data set. The tutorial can
be found in the examples folder. Run the tutorial from inside the
nipype tutorial directory:
nipype tutorial directory::

python fmri_spm_nested.py

Expand Down
2 changes: 1 addition & 1 deletion examples/smri_freesurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
================

This script, smri_freesurfer.py, demonstrates the ability to call reconall on
a set of subjects and then make an average subject.
a set of subjects and then make an average subject::

python smri_freesurfer.py

Expand Down
3 changes: 2 additions & 1 deletion examples/tessellation_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Introduction
============

This script, tessellation_tutorial.py, demonstrates the use of create_tessellation_flow from nipype.workflows.smri.freesurfer, and it can be run with:
This script, tessellation_tutorial.py, demonstrates the use of create_tessellation_flow from nipype.workflows.smri.freesurfer, and it can be run with::

python tessellation_tutorial.py

Expand All @@ -33,6 +33,7 @@

Import the necessary modules and workflow from nipype.
"""

import nipype.pipeline.engine as pe # pypeline engine
import nipype.interfaces.cmtk as cmtk
import nipype.interfaces.io as nio # Data i/o
Expand Down