fsleyes.views.orthopanel
¶
This module provides the OrthoPanel
class, which displays a 2D
view of 3D overlays.
A couple of other classes are provided for convenience:
Convenience class for displaying an |
|
Convenience class for displaying an |
-
class
fsleyes.views.orthopanel.
OrthoPanel
(parent, overlayList, displayCtx, frame)[source]¶ Bases:
fsleyes.views.canvaspanel.CanvasPanel
The
OrthoPanel
class is a FSLeyes view which displays a 2D view of 3D overlays. TheOrthoPanel
is the primary point of user interaction in FSLeyes.Overview
An
OrthoPanel
contains threeSliceCanvas
panels, each of which provide a 2D view of the overlays in theOverlayList
along one axis. TheseSliceCanvas
instances can be accessed through thegetXCanvas()
,getYCanvas()
,getZCanvas()
, andgetGLCanvases()
methods.An
OrthoPanel
looks something like this:Anatomical labels
The
OrthoPanel
creates anOrthoLabels
instance, which manages the display of anatomical orientation labels on each of the threeSliceCanvas
instances.Display
The display of an
OrthoPanel
can be configured through all of the settings provided by theOrthoOpts
class. TheOrthoOpts
instance for a givenOrthoPanel
can be accessed via theCanvasPanel.sceneOpts()
method.Interaction
The
OrthoPanel
uses theOrthoViewProfile
to handle interaction with the user via the mouse and keyboard. Some control panels will activate other interaction profiles while they are open, such as:Simple editing of
Image
overlays, using theOrthoEditProfile
(see also theeditor
package).Allows the user to crop an
Image
overlay, using theOrthoCropProfile
.Allows the user to draw text and shapes on the
OrthoPanel
canvases, using theOrthoAnnotatePanel
.See the
ViewPanel
, and theprofiles
package for more information on interaction profiles.Actions and control panels
The
OrthoPanel
adds a few extra actions to those provided by theCanvasPanel
class:Shows/hides an
OrthoEditToolBar
.Toggles the value of
SceneOpts.showCursor
.Toggles the value of
OrthoOpts.showLabels
.Toggles the value of
OrthoOpts.showXCanvas
.Toggles the value of
OrthoOpts.showYCanvas
.Toggles the value of
OrthoOpts.showZCanvas
.-
controlOptions
(cpType)[source]¶ Returns some options to be used by
ViewPanel.togglePanel()
for certain control panel types.
-
static
defaultLayout
()[source]¶ Returns a list of control panel types to be added for the default ortho panel layout.
-
static
controlOrder
()[source]¶ Returns a list of control panel names, specifying the order in which they should appear in the FSLeyes ortho panel settings menu.
-
static
toolOrder
()[source]¶ Returns a list of tool names, specifying the order in which they should appear in the FSLeyes ortho panel settings menu.
-
__init__
(parent, overlayList, displayCtx, frame)[source]¶ Create an
OrthoPanel
.- Parameters
parent – The
wx
parent.overlayList – An
OverlayList
instance.displayCtx – A
DisplayContext
instance.displayCtx – A
FSLeyesFrame
instance.
-
destroy
()[source]¶ Must be called when this
OrthoPanel
is closed.Removes listeners from the
DisplayContext
andOverlayList
instances, destroys each of the threeSliceCanvas
panels, and callsCanvasPanel.destroy()
.
-
toggleEditMode
()[source]¶ Shows/hides an
OrthoEditToolBar
. This causes the interaction profile to be changed, and a call to__profileChanged()
, which makes a few other changes to the interface.
-
__profileChanged
(inst, topic, value)¶ Called when the interaction profile changes (see
ViewPanel.events()
). If entering or exiting edit mode, an edit menu is added/removed from the menu bar.
-
toggleCursor
()[source]¶ Toggles the value of
SceneOpts.showCursor
.
-
toggleLabels
()[source]¶ Toggles the value of
OrthoOpts.showLabels
.
-
toggleXCanvas
()[source]¶ Toggles the value of
OrthoOpts.showXCanvas
.
-
toggleYCanvas
()[source]¶ Toggles the value of
OrthoOpts.showYCanvas
.
-
toggleZCanvas
()[source]¶ Toggles the value of
OrthoOpts.showZCanvas
.
-
getActions
()[source]¶ Overrides
ActionProvider.getActions()
. Returns all of theactions
that are defined on thisOrthoPanel
.
-
getTools
()[source]¶ Returns a list of methods to be added to the
FSLeyesFrame
Tools menu forOrthoPanel
views.
-
getGLCanvases
()[source]¶ Returns all of the
SliceCanvas
instances contained within thisOrthoPanel
.
-
getXCanvas
()[source]¶ Returns the
SliceCanvas
instance displaying the X axis.
-
getYCanvas
()[source]¶ Returns the
SliceCanvas
instance displaying the Y axis.
-
getZCanvas
()[source]¶ Returns the
SliceCanvas
instance displaying the Z axis.
-
lastFocusedCanvas
()[source]¶ Return a reference to the
SliceCanvas
which most recently had focus. Will beNone
if called before any canvas gains focus.
-
__onCanvasFocus
(ev)¶ Called when any
SliceCanvas
gains focus. Updates the last focused canvas reference.
-
__addEditMenu
()¶ Called by
__profleChanged()
when theViewPanel.profile
is changed to'edit'
. Adds a menu to theFSLeyesFrame
.
-
__removeEditMenu
()¶ Called by
__profleChanged()
when theViewPanel.profile
is changed from'edit'
. If an edit menut has previously been added to theFSLeyesFrame
, it is removed.
-
__toggleCanvas
(*a)¶ Called when any of the
OrthoOpts.showXCanvas
,OrthoOpts.showYCanvas
, orOrthoOpts.showZCanvas
properties are changed.Shows/hides each of the
SliceCanvas
panels accordingly.
-
__radioOrientationChanged
(*a)¶ Called when the
DisplayContext.radioOrientation
orDisplayContext.displaySpace
property changes. Figures out if the left-right canvas axes need to be flipped, and does so if necessary.
-
__overlayListChanged
(*a)¶ Called when the
OverlayList
orDisplayContext.selectedOverlay
is changed. Enables/disables various action methods based on the currently selected overlay.
-
__onResize
(ev)¶ Called whenever the panel is resized. Makes sure that the
SliceCanvas
panels andText
annotations are drawn correctly.
-
__calcCanvasSizes
(*a)¶ Sets the size for each displayed
SliceCanvas
.The minimum/maximum size of each canvas is fixed so that they are scaled proportionally to each other, thus preserving the aspect ratio. The :mod:~fsl.utils.layout` module is used to perform the canvas size calculation.
-
__refreshLayout
(*a, **kwa)¶ Called when the
OrthoOpts.layout
property changes, or the canvas layout needs to be refreshed. Updates the layout accordingly.- Parameters
refresh – Must be passed as a keyword argument. If
True
(the default), thisOrthoPanel
is refreshed.
-
__module__
= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.
OrthoFrame
(parent, overlayList, displayCtx, title=None)[source]¶ Bases:
__main__.docbuilder.run.<locals>.MockClass
Convenience class for displaying an
OrthoPanel
in a standalone frame.-
__init__
(parent, overlayList, displayCtx, title=None)[source]¶ Create an
OrthoFrame
.- Parameters
parent – A
wx
parent object.overlayList – An
OverlayList
instance.displayCtx – A
DisplayContext
instance.title – Dialog title.
-
__module__
= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.
OrthoDialog
(parent, overlayList, displayCtx, title=None, style=None)[source]¶ Bases:
__main__.docbuilder.run.<locals>.MockClass
Convenience class for displaying an
OrthoPanel
in a (possibly modal) dialog window.-
__init__
(parent, overlayList, displayCtx, title=None, style=None)[source]¶ Create an
OrthoDialog
.- Parameters
parent – A
wx
parent object.overlayList – An
OverlayList
instance.displayCtx – A
DisplayContext
instance.title – Dialog title.
style – Dialog style - defaults to
wx.DEFAULT_DIALOG_STYLE
.
-
__module__
= 'fsleyes.views.orthopanel'¶
-