Skip to content
Snippets Groups Projects
Commit bb863bd0 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Started documenting controls package. Removed package level controls

imports, and removed most dependencies on existence of controls/views
package level imports.
parent 4ed44311
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# #
# __init__.py - # __init__.py - FSLeyes control panels.
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
"""The ``controls`` package is the home of all *FSLeyes controls*, as
described in the :mod:`~fsl.fsleyes` package documentation.
from atlaspanel import AtlasPanel
from overlaydisplaypanel import OverlayDisplayPanel
from overlaylistpanel import OverlayListPanel
from locationpanel import LocationPanel
from lookuptablepanel import LookupTablePanel
from timeserieslistpanel import TimeSeriesListPanel
from timeseriescontrolpanel import TimeSeriesControlPanel
from histogramlistpanel import HistogramListPanel
from histogramcontrolpanel import HistogramControlPanel
from clusterpanel import ClusterPanel
from canvassettingspanel import CanvasSettingsPanel
from overlayinfopanel import OverlayInfoPanel
from shellpanel import ShellPanel
from orthotoolbar import OrthoToolBar Every control panel is a sub-class of either the :class:`.FSLEyesPanel` or
from orthoedittoolbar import OrthoEditToolBar :class:`.FSLEyesToolBar`, and each panel allows the user to control some
from lightboxtoolbar import LightBoxToolBar aspect of either the specific :class:`.ViewPanel` that the control panel is
from overlaydisplaytoolbar import OverlayDisplayToolBar embedded within, or some general aspect of *FSLeyes*.
The following control panels currently exist:
.. autosummary::
:nosignatures:
~fsl.fsleyes.controls.atlaspanel.AtlasPanel
~fsl.fsleyes.controls.canvassettingspanel.CanvasSettingsPanel
~fsl.fsleyes.controls.clusterpanel.ClusterPanel
~fsl.fsleyes.controls.histogramcontrolpanel.HistogramControlPanel
~fsl.fsleyes.controls.histogramlistpanel.HistogramListPanel
~fsl.fsleyes.controls.lightboxtoolbar.LightBoxToolBar
~fsl.fsleyes.controls.locationpanel.LocationPanel
~fsl.fsleyes.controls.lookuptablepanel.LookupTablePanel
~fsl.fsleyes.controls.orthoedittoolbar.OrthoEditToolBar
~fsl.fsleyes.controls.orthotoolbar.OrthoToolBar
~fsl.fsleyes.controls.overlaydisplaypanel.OverlayDisplayPanel
~fsl.fsleyes.controls.overlayinfopanel.OverlayInfoPanel
~fsl.fsleyes.controls.overlaylistpanel.OverlayListPanel
~fsl.fsleyes.controls.shellpanel.ShellPanel
~fsl.fsleyes.controls.timeseriescontrolpanel.TimeSeriesControlPanel
~fsl.fsleyes.controls.timeserieslistpanel.TimeSeriesListPanel
"""
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
"""The ``views`` package contains a collection of :class:`FSLEyesPanel` """The ``views`` package is the home of all *FSLeyes views*, as described in
sub-classes which provide a view of the overlays in an :class:`.OverlayList`. the :mod:`~fsl.fsleyes` package documentation. It contains a collection of
:class:`FSLEyesPanel` sub-classes which provide a view of the overlays in an
:class:`.OverlayList`. The :class:`.ViewPanel` is the base-class for all
views.
This package is the home of all *FSLeyes views*, as described in the
:mod:`~fsl.fsleyes` package documentation. The :class:`.ViewPanel` is the
base-class for all views.
A package-level convenience function, :func:`listViewPanels`, is provided to A package-level convenience function, :func:`listViewPanels`, is provided to
allow dynamic lookup of all :class:`.ViewPanel` sub-classes. The following allow dynamic lookup of all :class:`.ViewPanel` sub-classes. The following
......
...@@ -21,13 +21,21 @@ import matplotlib.image as mplimg ...@@ -21,13 +21,21 @@ import matplotlib.image as mplimg
import props import props
import fsl.fsleyes.fsleyes_parseargs as fsleyes_parseargs import fsl.fsleyes.fsleyes_parseargs as fsleyes_parseargs
import fsl.utils.dialog as fsldlg import fsl.utils.dialog as fsldlg
import fsl.utils.settings as fslsettings import fsl.utils.settings as fslsettings
import fsl.data.image as fslimage import fsl.data.image as fslimage
import fsl.data.strings as strings import fsl.data.strings as strings
import fsl.fsleyes.displaycontext as displayctx import fsl.fsleyes.displaycontext as displayctx
import fsl.fsleyes.controls as fslcontrols import fsl.fsleyes.controls.overlaylistpanel as overlaylistpanel
import fsl.fsleyes.controls.overlayinfopanel as overlayinfopanel
import fsl.fsleyes.controls.atlaspanel as atlaspanel
import fsl.fsleyes.controls.overlaydisplaytoolbar as overlaydisplaytoolbar
import fsl.fsleyes.controls.locationpanel as locationpanel
import fsl.fsleyes.controls.clusterpanel as clusterpanel
import fsl.fsleyes.controls.lookuptablepanel as lookuptablepanel
import fsl.fsleyes.controls.shellpanel as shellpanel
import colourbarpanel import colourbarpanel
import viewpanel import viewpanel
...@@ -209,32 +217,32 @@ class CanvasPanel(viewpanel.ViewPanel): ...@@ -209,32 +217,32 @@ class CanvasPanel(viewpanel.ViewPanel):
('screenshot', self.screenshot), ('screenshot', self.screenshot),
('showCommandLineArgs', self.showCommandLineArgs), ('showCommandLineArgs', self.showCommandLineArgs),
('toggleOverlayList', lambda *a: self.togglePanel( ('toggleOverlayList', lambda *a: self.togglePanel(
fslcontrols.OverlayListPanel, overlaylistpanel.OverlayListPanel,
location=wx.BOTTOM)), location=wx.BOTTOM)),
('toggleOverlayInfo', lambda *a: self.togglePanel( ('toggleOverlayInfo', lambda *a: self.togglePanel(
fslcontrols.OverlayInfoPanel, overlayinfopanel.OverlayInfoPanel,
location=wx.RIGHT)), location=wx.RIGHT)),
('toggleAtlasPanel', lambda *a: self.togglePanel( ('toggleAtlasPanel', lambda *a: self.togglePanel(
fslcontrols.AtlasPanel, atlaspanel.AtlasPanel,
location=wx.BOTTOM)), location=wx.BOTTOM)),
('toggleDisplayProperties', lambda *a: self.togglePanel( ('toggleDisplayProperties', lambda *a: self.togglePanel(
fslcontrols.OverlayDisplayToolBar, overlaydisplaytoolbar.OverlayDisplayToolBar,
viewPanel=self)), viewPanel=self)),
('toggleLocationPanel', lambda *a: self.togglePanel( ('toggleLocationPanel', lambda *a: self.togglePanel(
fslcontrols.LocationPanel, locationpanel.LocationPanel,
location=wx.BOTTOM)), location=wx.BOTTOM)),
('toggleClusterPanel', lambda *a: self.togglePanel( ('toggleClusterPanel', lambda *a: self.togglePanel(
fslcontrols.ClusterPanel, clusterpanel.ClusterPanel,
location=wx.TOP)), location=wx.TOP)),
('toggleLookupTablePanel', lambda *a: self.togglePanel( ('toggleLookupTablePanel', lambda *a: self.togglePanel(
fslcontrols.LookupTablePanel, lookuptablepanel.LookupTablePanel,
location=wx.TOP))] location=wx.TOP))]
actionz += extraActions.items() actionz += extraActions.items()
actionz += [ actionz += [
('toggleShell', lambda *a: self.togglePanel( ('toggleShell', lambda *a: self.togglePanel(
fslcontrols.ShellPanel, shellpanel.ShellPanel,
self.getSceneOptions(), self.getSceneOptions(),
location=wx.BOTTOM))] location=wx.BOTTOM))]
......
...@@ -26,11 +26,12 @@ import numpy as np ...@@ -26,11 +26,12 @@ import numpy as np
import props import props
import fsl.data.image as fslimage import fsl.data.image as fslimage
import fsl.data.strings as strings import fsl.data.strings as strings
import fsl.utils.dialog as fsldlg import fsl.utils.dialog as fsldlg
import fsl.fsleyes.controls as fslcontrols import fsl.fsleyes.controls.histogramcontrolpanel as histogramcontrolpanel
import plotpanel import fsl.fsleyes.controls.histogramlistpanel as histogramlistpanel
import plotpanel
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -118,7 +119,9 @@ class HistogramPanel(plotpanel.PlotPanel): ...@@ -118,7 +119,9 @@ class HistogramPanel(plotpanel.PlotPanel):
actionz = { actionz = {
'toggleHistogramList' : self.toggleHistogramList, 'toggleHistogramList' : self.toggleHistogramList,
'toggleHistogramControl' : lambda *a: self.togglePanel( 'toggleHistogramControl' : lambda *a: self.togglePanel(
fslcontrols.HistogramControlPanel, self, location=wx.TOP) histogramcontrolpanel.HistogramControlPanel,
self,
location=wx.TOP)
} }
plotpanel.PlotPanel.__init__( plotpanel.PlotPanel.__init__(
...@@ -223,7 +226,9 @@ class HistogramPanel(plotpanel.PlotPanel): ...@@ -223,7 +226,9 @@ class HistogramPanel(plotpanel.PlotPanel):
"""Shows/hides a :class:`.HistogramListPanel`. See the """Shows/hides a :class:`.HistogramListPanel`. See the
:meth:`.ViewPanel.togglePanel` method. :meth:`.ViewPanel.togglePanel` method.
""" """
self.togglePanel(fslcontrols.HistogramListPanel, self, location=wx.TOP) self.togglePanel(histogramlistpanel.HistogramListPanel,
self,
location=wx.TOP)
def __dataSeriesChanged(self, *a): def __dataSeriesChanged(self, *a):
...@@ -235,7 +240,7 @@ class HistogramPanel(plotpanel.PlotPanel): ...@@ -235,7 +240,7 @@ class HistogramPanel(plotpanel.PlotPanel):
'maxval', 'maxval',
len(self.dataSeries) - 1) len(self.dataSeries) - 1)
listPanel = self.getPanel(fslcontrols.HistogramListPanel) listPanel = self.getPanel(histogramlistpanel.HistogramListPanel)
if listPanel is None: if listPanel is None:
self.selectedSeries = 0 self.selectedSeries = 0
......
...@@ -33,14 +33,15 @@ import wx ...@@ -33,14 +33,15 @@ import wx
import numpy as np import numpy as np
import props import props
import plotpanel import plotpanel
import fsl.data.featimage as fslfeatimage import fsl.data.featimage as fslfeatimage
import fsl.data.image as fslimage import fsl.data.image as fslimage
import fsl.fsleyes.displaycontext as fsldisplay import fsl.fsleyes.displaycontext as fsldisplay
import fsl.fsleyes.colourmaps as fslcmaps import fsl.fsleyes.colourmaps as fslcmaps
import fsl.fsleyes.controls as fslcontrols import fsl.fsleyes.controls.timeseriescontrolpanel as timeseriescontrolpanel
import fsl.fsleyes.controls.timeserieslistpanel as timeserieslistpanel
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -777,9 +778,13 @@ class TimeSeriesPanel(plotpanel.PlotPanel): ...@@ -777,9 +778,13 @@ class TimeSeriesPanel(plotpanel.PlotPanel):
actionz = { actionz = {
'toggleTimeSeriesList' : lambda *a: self.togglePanel( 'toggleTimeSeriesList' : lambda *a: self.togglePanel(
fslcontrols.TimeSeriesListPanel, self, location=wx.TOP), timeserieslistpanel.TimeSeriesListPanel,
self,
location=wx.TOP),
'toggleTimeSeriesControl' : lambda *a: self.togglePanel( 'toggleTimeSeriesControl' : lambda *a: self.togglePanel(
fslcontrols.TimeSeriesControlPanel, self, location=wx.TOP) timeseriescontrolpanel.TimeSeriesControlPanel,
self,
location=wx.TOP)
} }
plotpanel.PlotPanel.__init__( plotpanel.PlotPanel.__init__(
......
...@@ -167,9 +167,10 @@ def interface(parent, args, ctx): ...@@ -167,9 +167,10 @@ def interface(parent, args, ctx):
:returns: the :class:`.FSLEyesFrame` that was created. :returns: the :class:`.FSLEyesFrame` that was created.
""" """
import wx import wx
import fsl.fsleyes.frame as fsleyesframe import fsl.fsleyes.frame as fsleyesframe
import fsl.fsleyes.views as views import fsl.fsleyes.views.orthopanel as op
import fsl.fsleyes.views.lightboxpanel as lbp
overlayList, displayCtx, splashFrame = ctx overlayList, displayCtx, splashFrame = ctx
...@@ -183,8 +184,8 @@ def interface(parent, args, ctx): ...@@ -183,8 +184,8 @@ def interface(parent, args, ctx):
# Otherwise, we add the scene # Otherwise, we add the scene
# specified by the user # specified by the user
if args.scene == 'ortho': frame.addViewPanel(views.OrthoPanel) if args.scene == 'ortho': frame.addViewPanel(op .OrthoPanel)
elif args.scene == 'lightbox': frame.addViewPanel(views.LightBoxPanel) elif args.scene == 'lightbox': frame.addViewPanel(lbp.LightBoxPanel)
# The viewPanel is assumed to be a CanvasPanel # The viewPanel is assumed to be a CanvasPanel
# (i.e. either OrthoPanel or LightBoxPanel) # (i.e. either OrthoPanel or LightBoxPanel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment