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.CanvasPanelThe
OrthoPanelclass is a FSLeyes view which displays a 2D view of 3D overlays. TheOrthoPanelis the primary point of user interaction in FSLeyes.Overview
An
OrthoPanelcontains threeSliceCanvaspanels, each of which provide a 2D view of the overlays in theOverlayListalong one axis. TheseSliceCanvasinstances can be accessed through thegetXCanvas(),getYCanvas(),getZCanvas(), andgetGLCanvases()methods.An
OrthoPanellooks something like this:
Anatomical labels
The
OrthoPanelcreates anOrthoLabelsinstance, which manages the display of anatomical orientation labels on each of the threeSliceCanvasinstances.Display
The display of an
OrthoPanelcan be configured through all of the settings provided by theOrthoOptsclass. TheOrthoOptsinstance for a givenOrthoPanelcan be accessed via theCanvasPanel.sceneOpts()method.Interaction
The following interaction profiles are defined for use with the
OrthoPanel(see theViewPanelfor an overview of profiles):viewViewing/navigation, using the
OrthoViewProfile.editSimple editing of
Imageoverlays, using theOrthoEditProfile(see also theeditorpackage).cropAllows the user to crop an
Imageoverlay.Actions and control panels
The
OrthoPaneladds a few extra actions to those provided by theCanvasPanelclass:Toggles the
ViewPanel.profilebetween'view'and'edit'.Toggles the
ViewPanel.profilebetween'view'and'crop'.Shows/hides an
EditTransformPanel.Shows/hides an
OrthoEditSettingsPanel.Shows/hides an
OrthoToolBar.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.-
__init__(parent, overlayList, displayCtx, frame)[source]¶ Create an
OrthoPanel.- Parameters
parent – The
wxparent.overlayList – An
OverlayListinstance.displayCtx – A
DisplayContextinstance.displayCtx – A
FSLeyesFrameinstance.
-
destroy()[source]¶ Must be called when this
OrthoPanelis closed.Removes listeners from the
DisplayContextandOverlayListinstances, destroys each of the threeSliceCanvaspanels, and callsCanvasPanel.destroy().
-
toggleOrthoToolBar()[source]¶ Shows/hides an
OrthoToolBar. SeeViewPanel.togglePanel().
-
toggleEditMode()[source]¶ Toggles the
ViewPanel.profilebetween'view'and'edit'. See__profileChanged().
-
toggleCropMode()[source]¶ Toggles the
ViewPanel.profilebetween'view'and'crop'. See__profileChanged().
-
toggleEditTransformPanel()[source]¶ Shows/hides an
EditTransformPanel. SeeViewPanel.togglePanel().
-
toggleEditPanel(floatPane=False)[source]¶ Shows/hides an
OrthoEditSettingsPanel. SeeViewPanel.togglePanel().
-
pearsonCorrelation()[source]¶ Executes a
PearsonCorrelateAction.
-
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 theactionsthat are defined on thisOrthoPanel.
-
getTools()[source]¶ Returns a list of methods to be added to the
FSLeyesFrameTools menu forOrthoPanelviews.
-
getGLCanvases()[source]¶ Returns all of the
SliceCanvasinstances contained within thisOrthoPanel.
-
getXCanvas()[source]¶ Returns the
SliceCanvasinstance displaying the X axis.
-
getYCanvas()[source]¶ Returns the
SliceCanvasinstance displaying the Y axis.
-
getZCanvas()[source]¶ Returns the
SliceCanvasinstance displaying the Z axis.
-
_OrthoPanel__addEditMenu()¶ Called by
__profleChanged()when theViewPanel.profileis 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
SliceCanvaspanels andTextannotations are drawn correctly.
-
_OrthoPanel__overlayListChanged(*a)¶ Called when the
OverlayListorDisplayContext.selectedOverlayis changed. Enables/disables various action methods based on the currently selected overlay.
-
_OrthoPanel__profileChanged(*a)¶ Called when the
ViewPanel.profilechanges. If'edit'mode has been enabled,OrthEditToolBarandOrthEditActionToolBartoolbars are added as control panels, and an “edit” menu is added to theFSLeyesFrame(if there is one).
-
_OrthoPanel__radioOrientationChanged(*a)¶ Called when the
DisplayContext.radioOrientationorDisplayContext.displaySpaceproperty 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.layoutproperty 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), thisOrthoPanelis refreshed.
-
_OrthoPanel__removeEditMenu()¶ Called by
__profleChanged()when theViewPanel.profileis 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.showZCanvasproperties are changed.Shows/hides each of the
SliceCanvaspanels accordingly.
-
__module__= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.OrthoFrame(parent, overlayList, displayCtx, title=None)[source]¶ Bases:
__main__.MockClassConvenience class for displaying an
OrthoPanelin a standalone frame.-
__init__(parent, overlayList, displayCtx, title=None)[source]¶ Create an
OrthoFrame.- Parameters
parent – A
wxparent object.overlayList – An
OverlayListinstance.displayCtx – A
DisplayContextinstance.title – Dialog title.
-
__module__= 'fsleyes.views.orthopanel'¶
-
-
class
fsleyes.views.orthopanel.OrthoDialog(parent, overlayList, displayCtx, title=None, style=None)[source]¶ Bases:
__main__.MockClassConvenience class for displaying an
OrthoPanelin a (possibly modal) dialog window.-
__init__(parent, overlayList, displayCtx, title=None, style=None)[source]¶ Create an
OrthoDialog.- Parameters
parent – A
wxparent object.overlayList – An
OverlayListinstance.displayCtx – A
DisplayContextinstance.title – Dialog title.
style – Dialog style - defaults to
wx.DEFAULT_DIALOG_STYLE.
-
__module__= 'fsleyes.views.orthopanel'¶
-