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:
OrthoFrame |
Convenience class for displaying an OrthoPanel in a standalone frame. |
OrthoDialog |
Convenience class for displaying an OrthoPanel in a (possibly modal) dialog window. |
-
class
fsleyes.views.orthopanel.
OrthoPanel
(parent, overlayList, displayCtx, frame)¶ 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 following interaction profiles are defined for use with the
OrthoPanel
(see theViewPanel
for an overview of profiles):view
Viewing/navigation, using the OrthoViewProfile
.edit
Simple editing of Image
overlays, using theOrthoEditProfile
(see also theeditor
package).crop
Allows the user to crop an Image
overlay.Actions and control panels
The
OrthoPanel
adds a few extra actions to those provided by theCanvasPanel
class:toggleEditMode
Toggles the ViewPanel.profile
between'view'
and'edit'
.toggleCropMode
Toggles the ViewPanel.profile
between'view'
and'crop'
.toggleEditTransformPanel
Shows/hides an EditTransformPanel
.toggleEditPanel
Shows/hides an OrthoEditSettingsPanel
.toggleOrthoToolBar
Shows/hides an OrthoToolBar
.resetDisplay
Calls OrthoViewProfile.resetDisplay()
.centreCursor
Calls OrthoViewProfile.centreCursor()
.centreCursorWorld
Calls OrthoViewProfile.centreCursorWorld()
.toggleCursor
Toggles the value of SceneOpts.showCursor
.toggleLabels
Toggles the value of OrthoOpts.showLabels
.toggleXCanvas
Toggles the value of OrthoOpts.showXCanvas
.toggleYCanvas
Toggles the value of OrthoOpts.showYCanvas
.toggleZCanvas
Toggles the value of OrthoOpts.showZCanvas
.-
__init__
(parent, overlayList, displayCtx, frame)¶ Create an
OrthoPanel
.Parameters: - parent – The
wx
parent. - overlayList – An
OverlayList
instance. - displayCtx – A
DisplayContext
instance. - displayCtx – A
FSLeyesFrame
instance.
- parent – The
-
destroy
()¶ Must be called when this
OrthoPanel
is closed.Removes listeners from the
DisplayContext
andOverlayList
instances, destroys each of the threeSliceCanvas
panels, and callsCanvasPanel.destroy()
.
-
toggleOrthoToolBar
()¶ Shows/hides an
OrthoToolBar
. SeeViewPanel.togglePanel()
.
-
toggleEditMode
()¶ Toggles the
ViewPanel.profile
between'view'
and'edit'
. See__profileChanged()
.
-
toggleCropMode
()¶ Toggles the
ViewPanel.profile
between'view'
and'crop'
. See__profileChanged()
.
-
toggleEditTransformPanel
()¶ Shows/hides an
EditTransformPanel
. SeeViewPanel.togglePanel()
.
-
toggleEditPanel
(floatPane=False)¶ Shows/hides an
OrthoEditSettingsPanel
. SeeViewPanel.togglePanel()
.
-
pearsonCorrelation
()¶ Executes a
PearsonCorrelateAction
.
-
resetDisplay
()¶
-
centreCursor
()¶
-
centreCursorWorld
()¶
-
toggleCursor
()¶ Toggles the value of
SceneOpts.showCursor
.
-
toggleLabels
()¶ Toggles the value of
OrthoOpts.showLabels
.
-
toggleXCanvas
()¶ Toggles the value of
OrthoOpts.showXCanvas
.
-
toggleYCanvas
()¶ Toggles the value of
OrthoOpts.showYCanvas
.
-
toggleZCanvas
()¶ Toggles the value of
OrthoOpts.showZCanvas
.
-
getActions
()¶ Overrides
ActionProvider.getActions()
. Returns all of theactions
that are defined on thisOrthoPanel
.
-
getTools
()¶ Returns a list of methods to be added to the
FSLeyesFrame
Tools menu forOrthoPanel
views.
-
getGLCanvases
()¶ Returns all of the
SliceCanvas
instances contained within thisOrthoPanel
.
-
getXCanvas
()¶ Returns the
SliceCanvas
instance displaying the X axis.
-
getYCanvas
()¶ Returns the
SliceCanvas
instance displaying the Y axis.
-
getZCanvas
()¶ Returns the
SliceCanvas
instance displaying the Z axis.
-
_OrthoPanel__addEditMenu
()¶ Called by
__profleChanged()
when theViewPanel.profile
is changed to'edit'
. Adds a menu to theFSLeyesFrame
.
-
_OrthoPanel__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.
-
_OrthoPanel__onResize
(ev)¶ Called whenever the panel is resized. Makes sure that the
SliceCanvas
panels andText
annotations are drawn correctly.
-
_OrthoPanel__overlayListChanged
(*a)¶ Called when the
OverlayList
orDisplayContext.selectedOverlay
is changed. Enables/disables various action methods based on the currently selected overlay.
-
_OrthoPanel__profileChanged
(*a)¶ Called when the
ViewPanel.profile
changes. If'edit'
mode has been enabled,OrthEditToolBar
andOrthEditActionToolBar
toolbars are added as control panels, and an “edit” menu is added to theFSLeyesFrame
(if there is one).
-
_OrthoPanel__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.
-
_OrthoPanel__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.
-
_OrthoPanel__removeEditMenu
()¶ Called by
__profleChanged()
when theViewPanel.profile
is changed from'edit'
. If an edit menut has previously been added to theFSLeyesFrame
, it is removed.
-
_OrthoPanel__toggleCanvas
(*a)¶ Called when any of the
OrthoOpts.showXCanvas
,OrthoOpts.showYCanvas
, orOrthoOpts.showZCanvas
properties are changed.Shows/hides each of the
SliceCanvas
panels accordingly.
-
__module__
= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.
OrthoFrame
(parent, overlayList, displayCtx, title=None)¶ Bases:
__main__.MockClass
Convenience class for displaying an
OrthoPanel
in a standalone frame.-
__init__
(parent, overlayList, displayCtx, title=None)¶ Create an
OrthoFrame
.Parameters: - parent – A
wx
parent object. - overlayList – An
OverlayList
instance. - displayCtx – A
DisplayContext
instance. - title – Dialog title.
- parent – A
-
__module__
= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.
OrthoDialog
(parent, overlayList, displayCtx, title=None, style=None)¶ Bases:
__main__.MockClass
Convenience class for displaying an
OrthoPanel
in a (possibly modal) dialog window.-
__init__
(parent, overlayList, displayCtx, title=None, style=None)¶ 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
.
- parent – A
-
__module__
= 'fsleyes.views.orthopanel'¶
-