Skip to content

Commit 45be08c

Browse files
committed
correcting docstrings of the utils file
1 parent ef802fd commit 45be08c

File tree

1 file changed

+68
-10
lines changed

1 file changed

+68
-10
lines changed

nipype/interfaces/fsl/utils.py

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class Merge(FSLCommand):
159159
160160
Examples
161161
--------
162+
162163
>>> from nipype.interfaces.fsl import Merge
163164
>>> merger = Merge()
164165
>>> merger.inputs.in_files = ['functional2.nii', 'functional3.nii']
@@ -169,6 +170,8 @@ class Merge(FSLCommand):
169170
>>> merger.inputs.tr = 2.25
170171
>>> merger.cmdline
171172
'fslmerge -tr functional2_merged.nii.gz functional2.nii functional3.nii 2.25'
173+
174+
172175
"""
173176

174177
_cmd = 'fslmerge'
@@ -223,6 +226,7 @@ class ExtractROI(FSLCommand):
223226
extract voxels 10 to 12 inclusive you would specify 10 and 3 (not
224227
10 and 12).
225228
229+
226230
Examples
227231
--------
228232
@@ -232,6 +236,8 @@ class ExtractROI(FSLCommand):
232236
... t_size=1)
233237
>>> fslroi.cmdline == 'fslroi %s bar.nii 0 1' % anatfile
234238
True
239+
240+
235241
"""
236242

237243
_cmd = 'fslroi'
@@ -249,8 +255,10 @@ def _list_outputs(self):
249255
by running the interface. Some files are always generated, others
250256
depending on which ``inputs`` options are set.
251257
258+
252259
Returns
253260
-------
261+
254262
outputs : Bunch object
255263
Bunch object containing all possible files generated by
256264
interface object.
@@ -301,6 +309,7 @@ def _list_outputs(self):
301309
302310
Returns
303311
-------
312+
304313
outputs : Bunch object
305314
Bunch object containing all possible files generated by
306315
interface object.
@@ -338,9 +347,9 @@ class ImageMathsOutputSpec(TraitedSpec):
338347

339348
class ImageMaths(FSLCommand):
340349
"""Use FSL fslmaths command to allow mathematical manipulation of images
341-
342350
`FSL info <http://www.fmrib.ox.ac.uk/fslcourse/lectures/practicals/intro/index.htm#fslutils>`_
343351
352+
344353
Examples
345354
--------
346355
@@ -350,6 +359,8 @@ class ImageMaths(FSLCommand):
350359
... out_file='foo_maths.nii')
351360
>>> maths.cmdline == 'fslmaths %s -add 5 foo_maths.nii' % anatfile
352361
True
362+
363+
353364
"""
354365
input_spec = ImageMathsInputSpec
355366
output_spec = ImageMathsOutputSpec
@@ -465,8 +476,9 @@ class ImageStatsOutputSpec(TraitedSpec):
465476

466477
class ImageStats(FSLCommand):
467478
"""Use FSL fslstats command to calculate stats from images
479+
`FSL info
480+
<http://www.fmrib.ox.ac.uk/fslcourse/lectures/practicals/intro/index.htm#fslutils>`_
468481
469-
`FSL info <http://www.fmrib.ox.ac.uk/fslcourse/lectures/practicals/intro/index.htm#fslutils>`_
470482
471483
Examples
472484
--------
@@ -477,6 +489,7 @@ class ImageStats(FSLCommand):
477489
>>> stats.cmdline == 'fslstats %s -M'%funcfile
478490
True
479491
492+
480493
"""
481494
input_spec = ImageStatsInputSpec
482495
output_spec = ImageStatsOutputSpec
@@ -543,9 +556,11 @@ class AvScale(FSLCommand):
543556
544557
Examples
545558
--------
546-
avscale = AvScale()
547-
avscale.inputs.mat_file = 'flirt.mat'
548-
res = avscale.run() # doctest: +SKIP
559+
560+
>>> avscale = AvScale()
561+
>>> avscale.inputs.mat_file = 'flirt.mat'
562+
>>> res = avscale.run() # doctest: +SKIP
563+
549564
550565
"""
551566
input_spec = AvScaleInputSpec
@@ -634,8 +649,10 @@ class Overlay(FSLCommand):
634649
""" Use FSL's overlay command to combine background and statistical images
635650
into one volume
636651
652+
637653
Examples
638654
--------
655+
639656
>>> from nipype.interfaces import fsl
640657
>>> combine = fsl.Overlay()
641658
>>> combine.inputs.background_image = 'mean_func.nii.gz'
@@ -645,6 +662,7 @@ class Overlay(FSLCommand):
645662
>>> combine.inputs.show_negative_stats = True
646663
>>> res = combine.run() #doctest: +SKIP
647664
665+
648666
"""
649667
_cmd = 'overlay'
650668
input_spec = OverlayInputSpec
@@ -745,8 +763,10 @@ class SlicerOutputSpec(TraitedSpec):
745763
class Slicer(FSLCommand):
746764
"""Use FSL's slicer command to output a png image from a volume.
747765
766+
748767
Examples
749768
--------
769+
750770
>>> from nipype.interfaces import fsl
751771
>>> from nipype.testing import example_data
752772
>>> slice = fsl.Slicer()
@@ -755,6 +775,7 @@ class Slicer(FSLCommand):
755775
>>> slice.inputs.image_width = 750
756776
>>> res = slice.run() #doctest: +SKIP
757777
778+
758779
"""
759780
_cmd = 'slicer'
760781
input_spec = SlicerInputSpec
@@ -835,13 +856,15 @@ class PlotTimeSeries(FSLCommand):
835856
836857
Examples
837858
--------
859+
838860
>>> import nipype.interfaces.fsl as fsl
839861
>>> plotter = fsl.PlotTimeSeries()
840862
>>> plotter.inputs.in_file = 'functional.par'
841863
>>> plotter.inputs.title = 'Functional timeseries'
842864
>>> plotter.inputs.labels = ['run1', 'run2']
843865
>>> plotter.run() #doctest: +SKIP
844866
867+
845868
"""
846869
_cmd = "fsl_tsplot"
847870
input_spec = PlotTimeSeriesInputSpec
@@ -915,23 +938,28 @@ class PlotMotionParams(FSLCommand):
915938
"""Use fsl_tsplot to plot the estimated motion parameters from a realignment
916939
program.
917940
941+
918942
Examples
919943
--------
944+
920945
>>> import nipype.interfaces.fsl as fsl
921946
>>> plotter = fsl.PlotMotionParams()
922947
>>> plotter.inputs.in_file = 'functional.par'
923948
>>> plotter.inputs.in_source = 'fsl'
924949
>>> plotter.inputs.plot_type = 'rotations'
925950
>>> res = plotter.run() #doctest: +SKIP
926951
952+
927953
Notes
928954
-----
955+
929956
The 'in_source' attribute determines the order of columns that are expected
930957
in the source file. FSL prints motion parameters in the order rotations,
931958
translations, while SPM prints them in the opposite order. This interface
932959
should be able to plot timecourses of motion parameters generated from other
933960
sources as long as they fall under one of these two patterns. For more
934961
flexibilty, see the :class:`fsl.PlotTimeSeries` interface.
962+
935963
"""
936964
_cmd = 'fsl_tsplot'
937965
input_spec = PlotMotionParamsInputSpec
@@ -1024,13 +1052,16 @@ class ConvertXFM(FSLCommand):
10241052
10251053
Examples
10261054
--------
1055+
10271056
>>> import nipype.interfaces.fsl as fsl
10281057
>>> invt = fsl.ConvertXFM()
10291058
>>> invt.inputs.in_file = "flirt.mat"
10301059
>>> invt.inputs.invert_xfm = True
10311060
>>> invt.inputs.out_file = 'flirt_inv.mat'
10321061
>>> invt.cmdline
10331062
'convert_xfm -omat flirt_inv.mat -inverse flirt.mat'
1063+
1064+
10341065
"""
10351066

10361067
_cmd = "convert_xfm"
@@ -1134,11 +1165,13 @@ class PowerSpectrum(FSLCommand):
11341165
11351166
Examples
11361167
--------
1168+
11371169
>>> from nipype.interfaces import fsl
11381170
>>> pspec = fsl.PowerSpectrum()
11391171
>>> pspec.inputs.in_file = 'functional.nii'
11401172
>>> res = pspec.run() # doctest: +SKIP
11411173
1174+
11421175
"""
11431176

11441177
_cmd = 'fslpspec'
@@ -1189,10 +1222,13 @@ class SigLoss(FSLCommand):
11891222
11901223
Examples
11911224
--------
1225+
11921226
>>> sigloss = SigLoss()
11931227
>>> sigloss.inputs.in_file = "phase.nii"
11941228
>>> sigloss.inputs.echo_time = 0.03
11951229
>>> res = sigloss.run() # doctest: +SKIP
1230+
1231+
11961232
"""
11971233
input_spec = SigLossInputSpec
11981234
output_spec = SigLossOuputSpec
@@ -1226,8 +1262,10 @@ class Reorient2Std(FSLCommand):
12261262
"""fslreorient2std is a tool for reorienting the image to match the
12271263
approximate orientation of the standard template images (MNI152).
12281264
1265+
12291266
Examples
12301267
--------
1268+
12311269
>>> reorient = Reorient2Std()
12321270
>>> reorient.inputs.in_file = "functional.nii"
12331271
>>> res = reorient.run() # doctest: +SKIP
@@ -1310,7 +1348,9 @@ class InvWarpOutputSpec(TraitedSpec):
13101348

13111349

13121350
class InvWarp(FSLCommand):
1313-
"""Use FSL Invwarp to inverse a FNIRT warp
1351+
"""
1352+
Use FSL Invwarp to invert a FNIRT warp
1353+
13141354
13151355
Examples
13161356
--------
@@ -1322,6 +1362,8 @@ class InvWarp(FSLCommand):
13221362
>>> invwarp.cmdline
13231363
'invwarp --out=struct2mni_inverse.nii.gz --ref=anatomical.nii --warp=struct2mni.nii'
13241364
>>> res = invwarp.run() # doctest: +SKIP
1365+
1366+
13251367
"""
13261368

13271369
input_spec = InvWarpInputSpec
@@ -1390,13 +1432,16 @@ class ComplexOuputSpec(TraitedSpec):
13901432

13911433
class Complex(FSLCommand):
13921434
"""fslcomplex is a tool for converting complex data
1435+
13931436
Examples
13941437
--------
1438+
13951439
>>> cplx = Complex()
13961440
>>> cplx.inputs.complex_in_file = "complex.nii"
13971441
>>> cplx.real_polar = True
13981442
>>> res = cplx.run() # doctest: +SKIP
13991443
1444+
14001445
"""
14011446
_cmd = 'fslcomplex'
14021447
input_spec = ComplexInputSpec
@@ -1524,7 +1569,8 @@ class WarpUtils(FSLCommand):
15241569
to convert field->coefficients, coefficients->field, coefficients->other_coefficients etc
15251570
15261571
1527-
Examples::
1572+
Examples
1573+
--------
15281574
15291575
>>> from nipype.interfaces.fsl import WarpUtils
15301576
>>> warputils = WarpUtils()
@@ -1535,6 +1581,8 @@ class WarpUtils(FSLCommand):
15351581
>>> warputils.cmdline # doctest: +ELLIPSIS
15361582
'fnirtfileutils --in=warpfield.nii --outformat=spline --ref=T1.nii --warpres=10.0000,10.0000,10.0000 --out=warpfield_coeffs.nii.gz'
15371583
>>> res = invwarp.run() # doctest: +SKIP
1584+
1585+
15381586
"""
15391587

15401588
input_spec = WarpUtilsInputSpec
@@ -1649,7 +1697,8 @@ class ConvertWarp(FSLCommand):
16491697
for combining multiple transforms into one.
16501698
16511699
1652-
Examples::
1700+
Examples
1701+
--------
16531702
16541703
>>> from nipype.interfaces.fsl import ConvertWarp
16551704
>>> warputils = ConvertWarp()
@@ -1659,6 +1708,8 @@ class ConvertWarp(FSLCommand):
16591708
>>> warputils.cmdline # doctest: +ELLIPSIS
16601709
'convertwarp --ref=T1.nii --rel --warp1=warpfield.nii --out=T1_concatwarp.nii.gz'
16611710
>>> res = invwarp.run() # doctest: +SKIP
1711+
1712+
16621713
"""
16631714

16641715
input_spec = ConvertWarpInputSpec
@@ -1701,7 +1752,8 @@ class WarpPoints(CommandLine):
17011752
.. Note:: transformation of TrackVis trk files is not yet implemented
17021753
17031754
1704-
Examples::
1755+
Examples
1756+
--------
17051757
17061758
>>> from nipype.interfaces.fsl import WarpPoints
17071759
>>> warppoints = WarpPoints()
@@ -1713,6 +1765,8 @@ class WarpPoints(CommandLine):
17131765
>>> warppoints.cmdline # doctest: +ELLIPSIS
17141766
'img2imgcoord -mm -dest T1.nii -src epi.nii -warp warpfield.nii surf.txt'
17151767
>>> res = invwarp.run() # doctest: +SKIP
1768+
1769+
17161770
"""
17171771

17181772
input_spec = WarpPointsInputSpec
@@ -1858,7 +1912,9 @@ class WarpPointsToStd(WarpPoints):
18581912
18591913
.. Note:: transformation of TrackVis trk files is not yet implemented
18601914
1861-
Examples::
1915+
1916+
Examples
1917+
--------
18621918
18631919
>>> from nipype.interfaces.fsl import WarpPointsToStd
18641920
>>> warppoints = WarpPointsToStd()
@@ -1870,6 +1926,8 @@ class WarpPointsToStd(WarpPoints):
18701926
>>> warppoints.cmdline # doctest: +ELLIPSIS
18711927
'img2stdcoord -mm -img T1.nii -std mni.nii -warp warpfield.nii surf.txt'
18721928
>>> res = invwarp.run() # doctest: +SKIP
1929+
1930+
18731931
"""
18741932

18751933
input_spec = WarpPointsToStdInputSpec

0 commit comments

Comments
 (0)