Skip to content

Commit fbb0d46

Browse files
committed
Merge pull request #980 from miykael/master
HTML structure format corrections for example scripts
2 parents 6db1161 + 297c495 commit fbb0d46

19 files changed

+56
-40
lines changed

examples/dmri_camino_dti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
============
99
1010
This script, camino_dti_tutorial.py, demonstrates the ability to perform basic diffusion analysis
11-
in a Nipype pipeline.
11+
in a Nipype pipeline::
1212
1313
python dmri_camino_dti.py
1414

examples/dmri_connectivity.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
This script, connectivity_tutorial.py, demonstrates the ability to perform connectivity mapping
1111
using Nipype for pipelining, Freesurfer for Reconstruction / Parcellation, Camino for tensor-fitting
12-
and tractography, and the Connectome Mapping Toolkit (CMTK) for connectivity analysis.
12+
and tractography, and the Connectome Mapping Toolkit (CMTK) for connectivity analysis::
1313
1414
python connectivity_tutorial.py
1515
@@ -26,9 +26,9 @@
2626
2727
* http://db.tt/1vx4vLeP
2828
29-
Along with Camino (http://web4.cs.ucl.ac.uk/research/medic/camino/pmwiki/pmwiki.php?n=Main.HomePage),
30-
Camino-Trackvis (http://www.nitrc.org/projects/camino-trackvis/), FSL (http://www.fmrib.ox.ac.uk/fsl/),
31-
and Freesurfer (http://surfer.nmr.mgh.harvard.edu/), you must also have the Connectome File Format
29+
Along with `Camino <http://web4.cs.ucl.ac.uk/research/medic/camino/pmwiki/pmwiki.php?n=Main.HomePage>`_,
30+
`Camino-Trackvis <http://www.nitrc.org/projects/camino-trackvis/>`_, `FSL <http://www.fmrib.ox.ac.uk/fsl/>`_,
31+
and `Freesurfer <http://surfer.nmr.mgh.harvard.edu/>`_, you must also have the Connectome File Format
3232
library installed as well as the Connectome Mapper.
3333
3434
These are written by Stephan Gerhard and can be obtained from:
@@ -583,7 +583,7 @@ def select_aparc_annot(list_of_files):
583583
connectivity.write_graph(format='eps')
584584

585585
"""
586-
The output CFF file of this pipeline can be loaded in the Connectome Viewer (http://www.cmtk.org)
586+
The output CFF file of this pipeline can be loaded in the `Connectome Viewer <http://www.cmtk.org>`_.
587587
After loading the network into memory it can be examined in 3D or as a connectivity matrix
588588
using the default scripts produced by the Code Oracle.
589589
To compare networks, one must use the MergeCNetworks interface to merge two networks into

examples/dmri_connectivity_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
This script, connectivity_tutorial_advanced.py, demonstrates the ability to perform connectivity mapping
1111
using Nipype for pipelining, Freesurfer for Reconstruction / Segmentation, MRtrix for spherical deconvolution
12-
and tractography, and the Connectome Mapping Toolkit (CMTK) for further parcellation and connectivity analysis.
12+
and tractography, and the Connectome Mapping Toolkit (CMTK) for further parcellation and connectivity analysis::
1313
1414
python connectivity_tutorial_advanced.py
1515

examples/dmri_fsl_dti.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
"""
3-
===============
4-
dMRI [DTI, FSL]
5-
===============
3+
==============
4+
dMRI: DTI, FSL
5+
==============
66
77
A pipeline example that uses several interfaces to perform analysis on
88
diffusion weighted images using FSL FDT tools.

examples/dmri_group_connectivity_camino.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
This script, dmri_group_connectivity_camino.py, runs group-based connectivity analysis using
1010
the dmri.camino.connectivity_mapping Nipype workflow. Further detail on the processing can be
11-
found in :doc:`dmri_connectivity`. This tutorial can be run using:
11+
found in :doc:`dmri_connectivity`. This tutorial can be run using::
1212
1313
python dmri_group_connectivity_camino.py
1414

examples/dmri_group_connectivity_mrtrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
This script, dmri_group_connectivity_mrtrix.py, runs group-based connectivity analysis using
1010
the dmri.mrtrix.connectivity_mapping Nipype workflow. Further detail on the processing can be
11-
found in :doc:`dmri_connectivity_advanced`. This tutorial can be run using:
11+
found in :doc:`dmri_connectivity_advanced`. This tutorial can be run using::
1212
1313
python dmri_group_connectivity_mrtrix.py
1414

examples/dmri_mrtrix_dti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
============
99
1010
This script, dmri_mrtrix_dti.py, demonstrates the ability to perform advanced diffusion analysis
11-
in a Nipype pipeline.
11+
in a Nipype pipeline::
1212
1313
python dmri_mrtrix_dti.py
1414

examples/dmri_tbss_nki.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
A pipeline to do a TBSS analysis on the NKI rockland sample data
1010
1111
"""
12+
1213
from nipype.workflows.dmri.fsl.dti import create_eddy_correct_pipeline
1314
from nipype.workflows.dmri.fsl.tbss import create_tbss_non_FA, create_tbss_all
1415

examples/fmri_ants_openfmri.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
=============================================
88
99
A growing number of datasets are available on `OpenfMRI <http://openfmri.org>`_.
10-
This script demonstrates how to use nipype to analyze a data set.
10+
This script demonstrates how to use nipype to analyze a data set::
1111
1212
python fmri_ants_openfmri.py --datasetdir ds107
1313
"""
@@ -47,19 +47,16 @@ def create_reg_workflow(name='registration'):
4747
4848
Parameters
4949
----------
50-
51-
::
52-
5350
name : name of workflow (default: 'registration')
5451
55-
Inputs::
52+
Inputs:
5653
5754
inputspec.source_files : files (filename or list of filenames to register)
5855
inputspec.mean_image : reference image to use
5956
inputspec.anatomical_image : anatomical image to coregister to
6057
inputspec.target_image : registration target
6158
62-
Outputs::
59+
Outputs:
6360
6461
outputspec.func2anat_transform : FLIRT transform
6562
outputspec.anat2target_transform : FLIRT+FNIRT transform
@@ -68,7 +65,6 @@ def create_reg_workflow(name='registration'):
6865
6966
Example
7067
-------
71-
7268
"""
7369

7470
register = pe.Workflow(name=name)
@@ -130,6 +126,7 @@ def create_reg_workflow(name='registration'):
130126
register.connect(inputnode, 'anatomical_image', mean2anatbbr, 'reference')
131127
register.connect(mean2anat, 'out_matrix_file',
132128
mean2anatbbr, 'in_matrix_file')
129+
133130
"""
134131
Convert the BBRegister transformation to ANTS ITK format
135132
"""
@@ -197,6 +194,7 @@ def create_reg_workflow(name='registration'):
197194
"""
198195
Transform the mean image. First to anatomical and then to target
199196
"""
197+
200198
warpmean = pe.Node(ants.ApplyTransforms(),
201199
name='warpmean')
202200
warpmean.inputs.input_image_type = 3
@@ -238,6 +236,10 @@ def create_reg_workflow(name='registration'):
238236

239237
return register
240238

239+
"""
240+
Get info for a given subject
241+
"""
242+
241243
def get_subjectinfo(subject_id, base_dir, task_id, model_id):
242244
"""Get info for a given subject
243245
@@ -291,6 +293,9 @@ def get_subjectinfo(subject_id, base_dir, task_id, model_id):
291293
TR = np.genfromtxt(os.path.join(base_dir, 'scan_key.txt'))[1]
292294
return run_ids[task_id - 1], conds[task_id - 1], TR
293295

296+
"""
297+
Analyzes an open fmri dataset
298+
"""
294299

295300
def analyze_openfmri_dataset(data_dir, subject=None, model_id=None,
296301
task_id=None, output_dir=None, subj_prefix='*',
@@ -621,6 +626,7 @@ def get_subs(subject_id, conds, model_id, task_id):
621626
"""
622627
Set processing parameters
623628
"""
629+
624630
preproc.inputs.inputspec.fwhm = fwhm
625631
gethighpass.inputs.hpcutoff = hpcutoff
626632
modelspec.inputs.high_pass_filter_cutoff = hpcutoff
@@ -634,6 +640,10 @@ def get_subs(subject_id, conds, model_id, task_id):
634640
datasink.inputs.base_directory = output_dir
635641
return wf
636642

643+
"""
644+
The following functions run the whole workflow.
645+
"""
646+
637647
if __name__ == '__main__':
638648
import argparse
639649
defstr = ' (default %(default)s)'

examples/fmri_nipy_glm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
fMRI: NiPy GLM, SPM
77
===================
88
9-
109
The fmri_nipy_glm.py integrates several interfaces to perform a first level
1110
analysis on a two-subject data set. It is very similar to the spm_tutorial with
1211
the difference of using nipy for fitting GLM model and estimating contrasts.
13-
The tutorial can
14-
be found in the examples folder. Run the tutorial from inside the
15-
nipype tutorial directory:
12+
The tutorial can be found in the examples folder. Run the tutorial from inside
13+
the nipype tutorial directory::
1614
1715
python fmri_nipy_glm.py
1816
1917
"""
18+
2019
from nipype.interfaces.nipy.model import FitGLM, EstimateContrast
2120
from nipype.interfaces.nipy.preprocess import ComputeMask
2221

examples/fmri_openfmri.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
============================
88
99
A growing number of datasets are available on `OpenfMRI <http://openfmri.org>`_.
10-
This script demonstrates how to use nipype to analyze a data set.
10+
This script demonstrates how to use nipype to analyze a data set::
1111
1212
python fmri_openfmri.py --datasetdir ds107
1313
"""
@@ -421,6 +421,10 @@ def get_subs(subject_id, conds, model_id, task_id):
421421
datasink.inputs.base_directory = output_dir
422422
return wf
423423

424+
"""
425+
The following functions run the whole workflow.
426+
"""
427+
424428
if __name__ == '__main__':
425429
import argparse
426430
defstr = ' (default %(default)s)'

examples/fmri_slicer_coregistration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
=====================================
88
99
This is currently not working and will raise an exception in release 0.3. It
10-
will be fixed in a later release.
10+
will be fixed in a later release::
1111
1212
python fmri_slicer_coregistration.py
1313
1414
"""
15+
1516
#raise RuntimeWarning, 'Slicer not fully implmented'
1617
from nipype.interfaces.slicer import BRAINSFit, BRAINSResample
1718

1819

19-
2020
"""Import necessary modules from nipype."""
2121

2222
import nipype.interfaces.io as nio # Data i/o

examples/fmri_spm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
The fmri_spm.py integrates several interfaces to perform a first
1010
and second level analysis on a two-subject data set. The tutorial can
1111
be found in the examples folder. Run the tutorial from inside the
12-
nipype tutorial directory:
12+
nipype tutorial directory::
1313
1414
python fmri_spm.py
1515

examples/fmri_spm_auditory.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
Introduction
1010
============
1111
12-
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)
13-
using auditory dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/:
12+
The fmri_spm_auditory.py recreates the classical workflow described in the
13+
`SPM8 manual <http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf>`_ using auditory
14+
dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/::
1415
1516
python fmri_spm_auditory.py
1617
@@ -19,7 +20,8 @@
1920
import nipype.interfaces.io as nio # Data i/o
2021
import nipype.interfaces.spm as spm # spm
2122
import nipype.interfaces.fsl as fsl # fsl
22-
import nipype.interfaces.matlab as mlab # how to run matlabimport nipype.interfaces.fsl as fsl # fsl
23+
import nipype.interfaces.matlab as mlab # how to run matlab
24+
import nipype.interfaces.fsl as fsl # fsl
2325
import nipype.interfaces.utility as util # utility
2426
import nipype.pipeline.engine as pe # pypeline engine
2527
import nipype.algorithms.modelgen as model # model specification

examples/fmri_spm_dartel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
The fmri_spm_dartel.py integrates several interfaces to perform a first
1010
and second level analysis on a two-subject data set. The tutorial can
1111
be found in the examples folder. Run the tutorial from inside the
12-
nipype tutorial directory:
12+
nipype tutorial directory::
1313
1414
python fmri_spm_dartel.py
1515

examples/fmri_spm_face.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
Introduction
1010
============
1111
12-
The fmri_spm_face.py recreates the classical workflow described in the SPM8
13-
manual (http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf) using auditory dataset
14-
that can be downloaded from
15-
http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/face_rep_SPM5.html::
12+
The fmri_spm_face.py recreates the classical workflow described in the
13+
`SPM8 manual <http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf>`_ using face
14+
dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/::
1615
1716
python fmri_spm.py
1817
@@ -271,7 +270,7 @@ def makelist(item):
271270
from nipype.interfaces.base import Bunch
272271

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

277276
from scipy.io.matlab import loadmat

examples/fmri_spm_nested.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
The fmri_spm.py integrates several interfaces to perform a first
1010
and second level analysis on a two-subject data set. The tutorial can
1111
be found in the examples folder. Run the tutorial from inside the
12-
nipype tutorial directory:
12+
nipype tutorial directory::
1313
1414
python fmri_spm_nested.py
1515

examples/smri_freesurfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
================
66
77
This script, smri_freesurfer.py, demonstrates the ability to call reconall on
8-
a set of subjects and then make an average subject.
8+
a set of subjects and then make an average subject::
99
1010
python smri_freesurfer.py
1111

examples/tessellation_tutorial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Introduction
88
============
99
10-
This script, tessellation_tutorial.py, demonstrates the use of create_tessellation_flow from nipype.workflows.smri.freesurfer, and it can be run with:
10+
This script, tessellation_tutorial.py, demonstrates the use of create_tessellation_flow from nipype.workflows.smri.freesurfer, and it can be run with::
1111
1212
python tessellation_tutorial.py
1313
@@ -33,6 +33,7 @@
3333
3434
Import the necessary modules and workflow from nipype.
3535
"""
36+
3637
import nipype.pipeline.engine as pe # pypeline engine
3738
import nipype.interfaces.cmtk as cmtk
3839
import nipype.interfaces.io as nio # Data i/o

0 commit comments

Comments
 (0)