diff --git a/.gitignore b/.gitignore index 0d20b6487c61e7d1bde93acf4a14b7a89083a16d..47ce7658f59a904a4e1cdb7884e009e13ecbe6fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.pyc +apidoc/html +doc/html diff --git a/apidoc/conf.py b/apidoc/conf.py index aa4fc355cc7af1a584b8d32e3ae0181d1268ee41..1222bd83c3db0038e6c191e7f80a40c0d60e6a66 100644 --- a/apidoc/conf.py +++ b/apidoc/conf.py @@ -12,8 +12,11 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os +import sys +import datetime + +date = datetime.date.today() # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -53,7 +56,7 @@ master_doc = 'index' # General information about the project. project = u'fslpy' -copyright = u'2015, Paul McCarthy, FMRIB Centre' +copyright = u'{}, Paul McCarthy, FMRIB Centre'.format(date.year) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -274,7 +277,7 @@ texinfo_documents = [ epub_title = u'FSLpy' epub_author = u'Paul McCarthy' epub_publisher = u'Paul McCarthy' -epub_copyright = u'2014, Paul McCarthy' +epub_copyright = u'{}, Paul McCarthy'.format(date.year) # The basename for the epub file. It defaults to the project name. #epub_basename = u'FSLpy' diff --git a/apidoc/fsl.fsleyes.controls.histogramlistpanel.rst b/apidoc/fsl.fsleyes.controls.histogramlistpanel.rst deleted file mode 100644 index f12eb50a5956073a5aa88d43bc7cf9587174db2c..0000000000000000000000000000000000000000 --- a/apidoc/fsl.fsleyes.controls.histogramlistpanel.rst +++ /dev/null @@ -1,7 +0,0 @@ -fsl.fsleyes.controls.histogramlistpanel module -============================================== - -.. automodule:: fsl.fsleyes.controls.histogramlistpanel - :members: - :undoc-members: - :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.arbp.parse.rst b/apidoc/fsl.fsleyes.gl.shaders.arbp.parse.rst new file mode 100644 index 0000000000000000000000000000000000000000..1200ec387d2ab8042b4bf10d23cdf9047ee46084 --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.arbp.parse.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.arbp.parse module +======================================== + +.. automodule:: fsl.fsleyes.gl.shaders.arbp.parse + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.arbp.program.rst b/apidoc/fsl.fsleyes.gl.shaders.arbp.program.rst new file mode 100644 index 0000000000000000000000000000000000000000..ee526d7340f2ac718b060404e011244c7bbc4a94 --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.arbp.program.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.arbp.program module +========================================== + +.. automodule:: fsl.fsleyes.gl.shaders.arbp.program + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.arbp.rst b/apidoc/fsl.fsleyes.gl.shaders.arbp.rst new file mode 100644 index 0000000000000000000000000000000000000000..4fb7281b1ef83335c3ba8f3078abbbdd1a542150 --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.arbp.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.arbp package +=================================== + +.. automodule:: fsl.fsleyes.gl.shaders.arbp + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.glsl.parse.rst b/apidoc/fsl.fsleyes.gl.shaders.glsl.parse.rst new file mode 100644 index 0000000000000000000000000000000000000000..860befb0e952706af3179a9fef35b1bdb13bdcfc --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.glsl.parse.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.glsl.parse module +======================================== + +.. automodule:: fsl.fsleyes.gl.shaders.glsl.parse + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.glsl.program.rst b/apidoc/fsl.fsleyes.gl.shaders.glsl.program.rst new file mode 100644 index 0000000000000000000000000000000000000000..11658d5333ec72fc5ca4fd8363c23d2ac2a67858 --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.glsl.program.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.glsl.program module +========================================== + +.. automodule:: fsl.fsleyes.gl.shaders.glsl.program + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.gl.shaders.glsl.rst b/apidoc/fsl.fsleyes.gl.shaders.glsl.rst new file mode 100644 index 0000000000000000000000000000000000000000..873e342f39259a861e4cf467c2d2cd362fd72284 --- /dev/null +++ b/apidoc/fsl.fsleyes.gl.shaders.glsl.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.gl.shaders.glsl package +=================================== + +.. automodule:: fsl.fsleyes.gl.shaders.glsl + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.plotting.dataseries.rst b/apidoc/fsl.fsleyes.plotting.dataseries.rst new file mode 100644 index 0000000000000000000000000000000000000000..ecf1cbbf156fa3f872eaf44a9b726699e04535b7 --- /dev/null +++ b/apidoc/fsl.fsleyes.plotting.dataseries.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.plotting.dataseries module +====================================== + +.. automodule:: fsl.fsleyes.plotting.dataseries + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.plotting.histogramseries.rst b/apidoc/fsl.fsleyes.plotting.histogramseries.rst new file mode 100644 index 0000000000000000000000000000000000000000..7929299e22c9155647c76033c7e23d85167b797e --- /dev/null +++ b/apidoc/fsl.fsleyes.plotting.histogramseries.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.plotting.histogramseries module +=========================================== + +.. automodule:: fsl.fsleyes.plotting.histogramseries + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.controls.timeserieslistpanel.rst b/apidoc/fsl.fsleyes.plotting.powerspectrumseries.rst similarity index 50% rename from apidoc/fsl.fsleyes.controls.timeserieslistpanel.rst rename to apidoc/fsl.fsleyes.plotting.powerspectrumseries.rst index 66a53a50d3914100609f6b33ec41664163f1d518..608aa1dde21110a64c118523e320d32e9fdcaefc 100644 --- a/apidoc/fsl.fsleyes.controls.timeserieslistpanel.rst +++ b/apidoc/fsl.fsleyes.plotting.powerspectrumseries.rst @@ -1,7 +1,7 @@ -fsl.fsleyes.controls.timeserieslistpanel module +fsl.fsleyes.plotting.powerspectrumseries module =============================================== -.. automodule:: fsl.fsleyes.controls.timeserieslistpanel +.. automodule:: fsl.fsleyes.plotting.powerspectrumseries :members: :undoc-members: :show-inheritance: diff --git a/apidoc/fsl.fsleyes.plotting.rst b/apidoc/fsl.fsleyes.plotting.rst new file mode 100644 index 0000000000000000000000000000000000000000..a3c143ffae2a04e782758285b3751d378fe354e4 --- /dev/null +++ b/apidoc/fsl.fsleyes.plotting.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.plotting package +============================ + +.. automodule:: fsl.fsleyes.plotting + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.plotting.timeseries.rst b/apidoc/fsl.fsleyes.plotting.timeseries.rst new file mode 100644 index 0000000000000000000000000000000000000000..13f64f3c535b74275e8ac4aba9929ed26f9ed548 --- /dev/null +++ b/apidoc/fsl.fsleyes.plotting.timeseries.rst @@ -0,0 +1,7 @@ +fsl.fsleyes.plotting.timeseries module +====================================== + +.. automodule:: fsl.fsleyes.plotting.timeseries + :members: + :undoc-members: + :show-inheritance: diff --git a/apidoc/fsl.fsleyes.profiles.lightboxeditprofile.rst b/apidoc/fsl.fsleyes.profiles.lightboxeditprofile.rst deleted file mode 100644 index bf8147bf8658aa84917d576e903eabbe65355b8d..0000000000000000000000000000000000000000 --- a/apidoc/fsl.fsleyes.profiles.lightboxeditprofile.rst +++ /dev/null @@ -1,7 +0,0 @@ -fsl.fsleyes.profiles.lightboxeditprofile module -=============================================== - -.. automodule:: fsl.fsleyes.profiles.lightboxeditprofile - :members: - :undoc-members: - :show-inheritance: diff --git a/apidoc/index.rst b/apidoc/index.rst index 00af35bc0f786173923d6397850a7bec300d06dd..b95355d9069bffb111605a54d667c50fdf2cf8fe 100644 --- a/apidoc/index.rst +++ b/apidoc/index.rst @@ -13,4 +13,15 @@ fsl.fsleyes -This is the ``fslpy`` package. +This is the ``fslpy`` API documentation. + + +Building the documentation +-------------------------- + +These pages have been built with the following commands (assuming that we +are starting in the ``fslpy`` root directory):: + + cd apidoc + rm -rf html + sphinx-build . html diff --git a/fsl/fsleyes/actions/__init__.py b/fsl/fsleyes/actions/__init__.py index 4cea8ced3e0c48f7502932fec878f9fee270213f..9cb1758e94395fcdfd2a1ca3b54a0d955db989de 100644 --- a/fsl/fsleyes/actions/__init__.py +++ b/fsl/fsleyes/actions/__init__.py @@ -14,7 +14,7 @@ performed, enabled and disabled, and may be bound to a GUI menu item or button. The :class:`ActionProvider` class represents some entity which can perform one or more actions. As the :class:`.FSLEyesPanel` class derives from :class:`ActionProvider` pretty much everything in FSLEyes is an -:classf:`ActionProvider`. +:class:`ActionProvider`. The :func:`action` and :func:`toggleAction` functions are intended to be used diff --git a/fsl/fsleyes/colourmaps.py b/fsl/fsleyes/colourmaps.py index 0de096d153bc725bf73b03776a7f47e2afaa846a..90daf9f2c5e0a778a14676dcf43695887b549bc5 100644 --- a/fsl/fsleyes/colourmaps.py +++ b/fsl/fsleyes/colourmaps.py @@ -997,7 +997,7 @@ class LookupTable(props.HasProperties): def getByName(self, name): """Returns the :class:`LutLabel` instance associated with the given - ``name``, or ``None`` if there is no ``LutLabel`. The name comparison + ``name``, or ``None`` if there is no ``LutLabel``. The name comparison is case-insensitive. """ name = name.lower() diff --git a/fsl/fsleyes/controls/clusterpanel.py b/fsl/fsleyes/controls/clusterpanel.py index e30e737f3af855e8bc5ed87a11dc3e91eba88291..77f8a5f2a9aad6daddb7cd409d3816e53b7efc6b 100644 --- a/fsl/fsleyes/controls/clusterpanel.py +++ b/fsl/fsleyes/controls/clusterpanel.py @@ -318,7 +318,7 @@ class ClusterPanel(fslpanel.FSLEyesPanel): .. note:: This method assumes that the given ``overlay`` is an :class:`.Image` which has the same voxel dimensions as, and shares the the same world coordinate system as the - ``featImage``. + ``featImage``. :arg overlay: The overlay for which clusters are currently being diff --git a/fsl/fsleyes/controls/overlaydisplaytoolbar.py b/fsl/fsleyes/controls/overlaydisplaytoolbar.py index bf8d6c0fb08f807929f2d1e49812d0b7f42f83c9..72ad90ea988a8c9dd0b0c11d344e00fae8382dbe 100644 --- a/fsl/fsleyes/controls/overlaydisplaytoolbar.py +++ b/fsl/fsleyes/controls/overlaydisplaytoolbar.py @@ -50,14 +50,14 @@ class OverlayDisplayToolBar(fsltoolbar.FSLEyesToolBar): .. autosummary:: :nosignatures: - __makeDisplayTools - __makeVolumeOptsTools - __makeMaskOptsTools - __makeLabelOptsTools - __makeVectorOptsTools - __makeRGBVectorOptsTools - __makeLineVectorOptsTools - __makeModelOptsTools + _OverlayDisplayToolBar__makeDisplayTools + _OverlayDisplayToolBar__makeVolumeOptsTools + _OverlayDisplayToolBar__makeMaskOptsTools + _OverlayDisplayToolBar__makeLabelOptsTools + _OverlayDisplayToolBar__makeVectorOptsTools + _OverlayDisplayToolBar__makeRGBVectorOptsTools + _OverlayDisplayToolBar__makeLineVectorOptsTools + _OverlayDisplayToolBar__makeModelOptsTools """ def __init__(self, parent, overlayList, displayCtx, viewPanel): diff --git a/fsl/fsleyes/gl/gl21/gllinevector_funcs.py b/fsl/fsleyes/gl/gl21/gllinevector_funcs.py index a523ef183e0747ec650cee9c9e99b24fb56982a4..890f688563c1447888fd12f24627828e94175378 100644 --- a/fsl/fsleyes/gl/gl21/gllinevector_funcs.py +++ b/fsl/fsleyes/gl/gl21/gllinevector_funcs.py @@ -40,7 +40,7 @@ log = logging.getLogger(__name__) def init(self): """Compiles and configures the vertex/fragment shaders used to render the ``GLLineVector`` via calls to :func:`compileShaders` and - :func:`updateShaderState. + :func:`updateShaderState`. """ self.shader = None diff --git a/fsl/fsleyes/gl/glvector.py b/fsl/fsleyes/gl/glvector.py index 94dab3d867790c130559a9c17f7ace5e0aed040b..3574a7bc22851c81d2aa8eadc29c8a30943053ae 100644 --- a/fsl/fsleyes/gl/glvector.py +++ b/fsl/fsleyes/gl/glvector.py @@ -622,8 +622,8 @@ class GLVector(globject.GLImageObject): def preDraw(self): """Must be called by subclass implementations. - Ensures that all of the textures used by this ``GLVector``are bound to - their corresponding texture units. + Ensures that all of the textures used by this ``GLVector`` are bound + to their corresponding texture units. """ self.imageTexture .bindTexture(gl.GL_TEXTURE0) diff --git a/fsl/fsleyes/gl/shaders/arbp/__init__.py b/fsl/fsleyes/gl/shaders/arbp/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..089e5688eb0670957a5f84d88122b912e2b3796e 100644 --- a/fsl/fsleyes/gl/shaders/arbp/__init__.py +++ b/fsl/fsleyes/gl/shaders/arbp/__init__.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# +# __init__.py - ARB vertex/fragment program management. +# +# Author: Paul McCarthy <pauldmccarthy@gmail.com> +# +"""The ``arbp`` package is the home of the :class:`.ARBPShader` class, a class +which may be used to manage OpenGL ``ARB_vertex_program`` and +``ARB_fragment_program`` shader programs. The :class:`.ARBPShader` class is +defined in the :mod:`.program` module, and uses some functions defined in the +:mod:`.parse` module. + +See also the :mod:`.glsl` package. +""" diff --git a/fsl/fsleyes/gl/shaders/arbp/parse.py b/fsl/fsleyes/gl/shaders/arbp/parse.py index 3228117b3392bc787a15565b9e2b38e12e9a31fe..418ce7e42ce661b698a4a93be8e27e02fc54c72a 100644 --- a/fsl/fsleyes/gl/shaders/arbp/parse.py +++ b/fsl/fsleyes/gl/shaders/arbp/parse.py @@ -54,7 +54,7 @@ from a 3D image texture:: And the corresponding fragment program, which looks up the voxel value -and colours the fragment accordingly: +and colours the fragment accordingly:: !!ARBfp1.0 diff --git a/fsl/fsleyes/gl/shaders/arbp/program.py b/fsl/fsleyes/gl/shaders/arbp/program.py index fa762ece8e15c3279daeda2be2ddddced59506da..c11c9e17166e12c76d595f803ef376095041b064 100644 --- a/fsl/fsleyes/gl/shaders/arbp/program.py +++ b/fsl/fsleyes/gl/shaders/arbp/program.py @@ -211,8 +211,8 @@ class ARBPShader(object): """Sets the value of the specified vertex program parameter. .. note:: It is assumed that the value is either a sequence of length - 4 (for vector parameters), or a ``numpy`` array of shape ``(n, 4)`` - (for matrix parameters). + 4 (for vector parameters), or a ``numpy`` array of shape + ``(n, 4)`` (for matrix parameters). """ pos = self.vertParamPositions[name] diff --git a/fsl/fsleyes/gl/shaders/glsl/__init__.py b/fsl/fsleyes/gl/shaders/glsl/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..60c05774d63113953f801b54a8ef5d4781abb854 100644 --- a/fsl/fsleyes/gl/shaders/glsl/__init__.py +++ b/fsl/fsleyes/gl/shaders/glsl/__init__.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +# +# __init__.py - GLSL shader program management. +# +# Author: Paul McCarthy <pauldmccarthy@gmail.com> +# +"""The ``glsl`` package is the home of the :class:`.GLSLShader` class, a class +which may be used to manage GLSL shader programs. The :class:`.GLSLShader` +class is defined in the :mod:`.program` module, and uses some functions +defined in the :mod:`.parse` module. + +See also the :mod:`.arbp` package. +""" diff --git a/fsl/fsleyes/gl/shaders/glsl/parse.py b/fsl/fsleyes/gl/shaders/glsl/parse.py index 0fd381abf68723c20b8dd702554926c2e5f9004c..7fff5d14d908988a6455e18f6961473ebc1e2fe0 100644 --- a/fsl/fsleyes/gl/shaders/glsl/parse.py +++ b/fsl/fsleyes/gl/shaders/glsl/parse.py @@ -111,10 +111,11 @@ STRUCT = pp.Literal("struct").suppress() def getDeclarations(code): """Get all declarations prefixed with a storage qualifier. - Code example - ------------ - uniform lowp vec4 fg_color = vec4(1), - bg_color = vec4(vec3(0),1); + *Code example* + + :: + uniform lowp vec4 fg_color = vec4(1), + bg_color = vec4(vec3(0),1); """ # Callable expression diff --git a/fsl/fsleyes/gl/shaders/glsl/program.py b/fsl/fsleyes/gl/shaders/glsl/program.py index 9e3c381c7533743cdea4c0b05c02d1026ca46184..a21ab663087759ccd45e69f284e3c4609cf752d9 100644 --- a/fsl/fsleyes/gl/shaders/glsl/program.py +++ b/fsl/fsleyes/gl/shaders/glsl/program.py @@ -4,7 +4,7 @@ # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # -"""This module provides he :class:`GLSLShader` class, which encapsulates +"""This module provides the :class:`GLSLShader` class, which encapsulates a GLSL shader program comprising a vertex shader and a fragment shader. """ @@ -232,7 +232,7 @@ class GLSLShader(object): def destroy(self): - """Deletes all GL resources managed by this ``GLSLShader`. """ + """Deletes all GL resources managed by this ``GLSLShader``. """ gl.glDeleteProgram(self.program) for buf in self.buffers.values(): diff --git a/fsl/fsleyes/plotting/__init__.py b/fsl/fsleyes/plotting/__init__.py index 4372ba8ece7c9b39489686c9f4572b989a01fc05..101526f0aeb475ea1750f6c08c9f3eccd102c10d 100644 --- a/fsl/fsleyes/plotting/__init__.py +++ b/fsl/fsleyes/plotting/__init__.py @@ -6,7 +6,14 @@ # """The ``plotting`` package contains the :class:`.DataSeries` class, and all of its sub-classes. These classes are used by :class:`.PlotPanel` views -for plotting data. +for plotting data, and are defined in the following sub-modules: + +.. autosummary:: + + ~fsl.fsleyes.plotting.dataseries + ~fsl.fsleyes.plotting.timeseries + ~fsl.fsleyes.plotting.histogramseries + ~fsl.fsleyes.plotting.powerspectrumseries """ import dataseries diff --git a/fsl/fsleyes/plotting/powerspectrumseries.py b/fsl/fsleyes/plotting/powerspectrumseries.py index fa8aefdbe795fe142214e66506d2ba9dfb77845f..dc9daaecdf3b9c95063f8a418b3f03e331061f81 100644 --- a/fsl/fsleyes/plotting/powerspectrumseries.py +++ b/fsl/fsleyes/plotting/powerspectrumseries.py @@ -10,7 +10,7 @@ by the :class:`.PowerSpectrumPanel` for plotting power spectra. The following classes are provided: .. autosummary:: - :nosignature: + :nosignatures: PowerSpectrumSeries VoxelPowerSpectrumSeries diff --git a/fsl/fsleyes/plotting/timeseries.py b/fsl/fsleyes/plotting/timeseries.py index 5eefdb3880fa176218ba3191dff2788982d9f0d6..7b78d628fa412900a62f651f8ef8b6de06e68a71 100644 --- a/fsl/fsleyes/plotting/timeseries.py +++ b/fsl/fsleyes/plotting/timeseries.py @@ -13,7 +13,6 @@ are use by the :class:`.TimeSeriesPanel`. The following classes are provided: TimeSeries VoxelTimeSeries FEATTimeSeries - FEATModelTimeSeries FEATPartialFitTimeSeries FEATEVTimeSeries FEATResidualTimeSeries diff --git a/fsl/fsleyes/views/plotpanel.py b/fsl/fsleyes/views/plotpanel.py index 8350d1797a7bafb136657bd93e20ff645b977e51..a234b1d83486ea62f30910c72e3e2185e0606ea0 100644 --- a/fsl/fsleyes/views/plotpanel.py +++ b/fsl/fsleyes/views/plotpanel.py @@ -903,10 +903,11 @@ class OverlayPlotPanel(PlotPanel): property on the corresponding target. This method must therefore return a tuple containing: - - A :class:`.DataSeries` instance, or ``None`` if the overlay - is incompatible. - - A list of *target* instances. - * A list of *property names*. + + - A :class:`.DataSeries` instance, or ``None`` if the overlay + is incompatible. + - A list of *target* instances. + - A list of *property names*. The target and property name lists must have the same length. """ diff --git a/fsl/fsleyes/views/viewpanel.py b/fsl/fsleyes/views/viewpanel.py index fb514c61192477871348a5c2a5e8b93e4ae7222a..5c890174579ff3f3fc7a42c01fb842c1540498c6 100644 --- a/fsl/fsleyes/views/viewpanel.py +++ b/fsl/fsleyes/views/viewpanel.py @@ -69,7 +69,7 @@ class ViewPanel(fslpanel.FSLEyesPanel): **Programming interface** - The following methods are available on a ``Viewpanel` for programmatically + The following methods are available on a ``Viewpanel`` for programmatically controlling its display and layout: