fsleyes.profiles.profilemap¶
This module is used by the Profile and ProfileManager
classes.
It defines a few dictionaries which define the profile type to use for each
ViewPanel type, temporary mouse/keyboard interaction modes, and
alternate mode handlers for the profiles contained in the profiles package.
This dictionary is used by the |
|
This dictionary is used by the |
|
The |
|
The |
-
fsleyes.profiles.profilemap.profiles= {<class 'fsleyes.views.orthopanel.OrthoPanel'>: ['view', 'edit', 'crop'], <class 'fsleyes.views.lightboxpanel.LightBoxPanel'>: ['view'], <class 'fsleyes.views.timeseriespanel.TimeSeriesPanel'>: ['view'], <class 'fsleyes.views.histogrampanel.HistogramPanel'>: ['view'], <class 'fsleyes.views.powerspectrumpanel.PowerSpectrumPanel'>: ['view'], <class 'fsleyes.views.scene3dpanel.Scene3DPanel'>: ['view']}¶ This dictionary is used by the
ProfileManagerto figure out which profiles are available for eachViewPanel. They are added as options to theViewPanel.profileproperty.
-
fsleyes.profiles.profilemap.profileHandlers= {(<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'view'): <class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>, (<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'edit'): <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>, (<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'crop'): <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>, (<class 'fsleyes.views.lightboxpanel.LightBoxPanel'>, 'view'): <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>, (<class 'fsleyes.views.timeseriespanel.TimeSeriesPanel'>, 'view'): <class 'fsleyes.profiles.timeseriesprofile.TimeSeriesProfile'>, (<class 'fsleyes.views.histogrampanel.HistogramPanel'>, 'view'): <class 'fsleyes.profiles.histogramprofile.HistogramProfile'>, (<class 'fsleyes.views.powerspectrumpanel.PowerSpectrumPanel'>, 'view'): <class 'fsleyes.profiles.plotprofile.PlotProfile'>, (<class 'fsleyes.views.scene3dpanel.Scene3DPanel'>, 'view'): <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>}¶ This dictionary is used by the
ProfileManagerclass to figure out whichProfilesub-class to create for a givenViewPanelinstance and profile identifier.
-
fsleyes.profiles.profilemap.tempModeMap= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: OrderedDict([(('nav', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('nav', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('nav', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'slice'), (('nav', (<MagicMock name='mock.WXK_CONTROL' id='281473461813984'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'bricon')]), <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>: OrderedDict([(('sel', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'slice'), (('desel', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'slice'), (('selint', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'slice'), (('fill', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'slice'), (('sel', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('desel', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('selint', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('fill', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('sel', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('desel', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('selint', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('fill', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('sel', (<MagicMock name='mock.WXK_CONTROL' id='281473461813984'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'chsize'), (('desel', (<MagicMock name='mock.WXK_CONTROL' id='281473461813984'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'chsize'), (('selint', (<MagicMock name='mock.WXK_CONTROL' id='281473461813984'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'chthres'), (('selint', (<MagicMock name='mock.WXK_ALT' id='281473462081616'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'chrad')]), <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>: OrderedDict([(('crop', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'nav'), (('crop', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('crop', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('crop', (<MagicMock name='mock.WXK_CONTROL' id='281473461813984'>, <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>)), 'slice')]), <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>: OrderedDict([(('view', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom')]), <class 'fsleyes.profiles.timeseriesprofile.TimeSeriesProfile'>: OrderedDict([(('panzoom', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'volume')]), <class 'fsleyes.profiles.histogramprofile.HistogramProfile'>: OrderedDict([(('panzoom', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'overlayRange')]), <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>: OrderedDict([(('rotate', <MagicMock name='mock.WXK_CONTROL' id='281473461813984'>), 'zoom'), (('rotate', <MagicMock name='mock.WXK_ALT' id='281473462081616'>), 'pan'), (('rotate', <MagicMock name='mock.WXK_SHIFT' id='281473462089136'>), 'pick')])}¶ The
tempModeMapdictionary defines temporary modes, for eachProfilesub-class which, when in a given mode, can be accessed with a keyboard modifer (e.g. Control, Shift, etc). For example, a temporary mode map of:('view', wx.WXK_SHIFT) : 'zoom'
states that when the
Profileis in'view'mode, and the shift key is held down, theProfileshould temporarily switch to'zoom'mode.
-
fsleyes.profiles.profilemap.altHandlerMap= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: OrderedDict([(('nav', 'LeftMouseDown'), ('nav', 'LeftMouseDrag')), (('nav', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('nav', 'RightMouseDown'), ('zoom', 'RightMouseDown')), (('nav', 'RightMouseDrag'), ('zoom', 'RightMouseDrag')), (('nav', 'RightMouseUp'), ('zoom', 'RightMouseUp')), (('slice', 'LeftMouseDown'), ('pick', 'LeftMouseDown')), (('slice', 'LeftMouseDrag'), ('pick', 'LeftMouseDrag')), (('slice', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('slice', 'RightMouseDown'), ('zoom', 'RightMouseDown')), (('slice', 'RightMouseDrag'), ('zoom', 'RightMouseDrag')), (('slice', 'RightMouseUp'), ('zoom', 'RightMouseUp')), (('zoom', 'RightMouseDown'), ('zoom', 'RightMouseDrag')), (('zoom', 'LeftMouseDown'), ('nav', 'LeftMouseDown')), (('zoom', 'LeftMouseDrag'), ('nav', 'LeftMouseDrag')), (('zoom', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('pick', 'LeftMouseDown'), ('pick', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>: OrderedDict([(('sel', 'Char'), ('nav', 'Char')), (('desel', 'Char'), ('nav', 'Char')), (('selint', 'Char'), ('nav', 'Char')), (('fill', 'Char'), ('nav', 'Char')), (('sel', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('sel', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('sel', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('desel', 'RightMouseDown'), ('sel', 'LeftMouseDown')), (('desel', 'RightMouseDrag'), ('sel', 'LeftMouseDrag')), (('desel', 'RightMouseUp'), ('sel', 'LeftMouseUp')), (('fill', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('fill', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('fill', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('selint', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('selint', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('selint', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('desel', 'MouseMove'), ('sel', 'MouseMove')), (('sel', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('desel', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('selint', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>: OrderedDict([(('crop', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>: OrderedDict([(('view', 'LeftMouseDown'), ('view', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>: OrderedDict([(('rotate', 'MiddleMouseDown'), ('pan', 'LeftMouseDown')), (('rotate', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('rotate', 'MiddleMouseUp'), ('pan', 'LeftMouseUp'))])}¶ The
altHandlerMapdictionary defines alternate handlers for a given mode and event type. Entries in this dictionary allow aProfilesub-class to define a handler for a single mode and event type, but to re-use that handler for other modes and event types. For example, the following alternate handler mapping:('zoom', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))
states that when the
Profileis in'zoom'mode, and aMiddleMouseDragevent occurs, theLeftMouseDraghandler for the'pan'mode should be called.Note
Event bindings defined in the
altHandlerMaptake precdence over the event bindings defined in theProfilesub-class. So you can use thealtHandlerMapto override the default behaviour of aProfile.
-
fsleyes.profiles.profilemap.fallbackHandlerMap= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: {('pick', 'LeftMouseDown'): ('nav', 'LeftMouseDown'), ('pick', 'LeftMouseDrag'): ('nav', 'LeftMouseDrag')}}¶ The
fallbackHandlerMapdictionary defines handlers for a given mode and event type which will be called if the handler for that mode/event type returns a value ofFalse, indicating that it has not been handled.