diff --git a/fsl/fslview/gl/colourbarcanvas.py b/fsl/fslview/gl/colourbarcanvas.py index 4edfc9a0945e5ca43afd95b9d555fdf8f7a87cd7..e40548df8fb61510bc450b8c8a9a8d8a826ec17f 100644 --- a/fsl/fslview/gl/colourbarcanvas.py +++ b/fsl/fslview/gl/colourbarcanvas.py @@ -23,6 +23,7 @@ import numpy as np import props import fsl.utils.colourbarbitmap as cbarbmp +import fsl.fslview.strings as strings class ColourBarCanvas(props.HasProperties): @@ -41,15 +42,15 @@ class ColourBarCanvas(props.HasProperties): """A label to display under the centre of the colour bar.""" - orientation = props.Choice({ - 'horizontal' : 'Horizontal', - 'vertical' : 'Vertical'}) + orientation = props.Choice( + ('horizontal', 'vertical'), + labels=strings.labels['ColourBarCanvas', 'orientation', 'labels']) """Whether the colour bar should be vertical or horizontal. """ - labelSide = props.Choice({ - 'top-left' : 'Top / left', - 'bottom-right' : 'Bottom / right'}) + labelSide = props.Choice( + ('top-left', 'bottom-right'), + labels=strings.labels['ColourBarCanvas', 'labelSide', 'labels']) """Whether the colour bar labels should be on the top/left, or bottom/right of the colour bar (depending upon whether the colour bar orientation is horizontal/vertical). @@ -69,7 +70,7 @@ class ColourBarCanvas(props.HasProperties): for prop in ('cmap', 'vrange', 'label', 'orientation', 'labelSide'): self.addListener(prop, self._name, _update) - + def _initGL(self): """Called automatically by the OpenGL canvas target superclass (see diff --git a/fsl/fslview/layouts.py b/fsl/fslview/layouts.py index c5bb09e63822d568c1857d3efa5c7c18f6ffbdf1..3384b684884288ffcd5cf5d4e0a86973b9149965 100644 --- a/fsl/fslview/layouts.py +++ b/fsl/fslview/layouts.py @@ -66,6 +66,22 @@ CanvasPanelActionLayout = props.HGroup( wrap=True, showLabels=False) +CanvasPanelLayout = props.VGroup(( + props.Widget('zax', label=strings.labels[CanvasPanel, 'zax']), + props.Widget('syncImageOrder', label=strings.labels[CanvasPanel, 'syncImageOrder']), + props.Widget('syncLocation', label=strings.labels[CanvasPanel, 'syncLocation']), + props.Widget('syncVolume', label=strings.labels[CanvasPanel, 'syncVolume']), + props.Widget('colourBarLabelSide', label=strings.labels[CanvasPanel, 'colourBarLabelSide']), + props.Widget('colourBarLocation', label=strings.labels[CanvasPanel, 'colourBarLocation']))) + +LightBoxPanelLayout = props.VGroup(( + props.Widget('zax', label=strings.labels[CanvasPanel, 'zax']), + props.Widget('zoom', label=strings.labels[CanvasPanel, 'zoom']), + props.Widget('highlightSlice', label=strings.labels[CanvasPanel, 'highlightSlice']), + props.Widget('showCursor', label=strings.labels[CanvasPanel, 'showCursor']), + props.Widget('showGridLines', label=strings.labels[CanvasPanel, 'showGridLines']), + props.Widget('sliceSpacing', label=strings.labels[CanvasPanel, 'sliceSpacing']), + props.Widget('zrange', label=strings.labels[CanvasPanel, 'zrange']))) @@ -76,5 +92,6 @@ layouts = td.TypeDict({ ('OrthoViewProfile', 'actions') : OrthoViewProfileActionLayout, ('OrthoEditProfile', 'actions') : OrthoEditProfileActionLayout, - ('CanvasPanel', 'actions') : CanvasPanelActionLayout, + ('CanvasPanel', 'actions') : CanvasPanelActionLayout, + ('LightBoxPanel', 'props') : CanvasPanelActionLayout, }) diff --git a/fsl/fslview/strings.py b/fsl/fslview/strings.py index 7e5fdda3c355e4c598c4b2ef36453364a969083b..69e33dcb05333faa42374facbe2bde973b58077b 100644 --- a/fsl/fslview/strings.py +++ b/fsl/fslview/strings.py @@ -29,6 +29,8 @@ labels = td.TypeDict({ 'OpenStandardAction' : 'Add standard', 'LoadColourMapAction' : 'Load custom colour map', + ('Profile', 'mode') : 'Mode', + ('CanvasPanel', 'profile', 'view') : 'View', ('OrthoPanel', 'profile', 'edit') : 'Edit', @@ -39,7 +41,11 @@ labels = td.TypeDict({ ('CanvasPanel', 'toggleLocationPanel') : 'Show/hide location panel', ('CanvasPanel', 'toggleCanvasProperties') : 'Show/hide canvas properties', + ('CanvasPanel', 'colourBarLocation', 'labels') : ('Top', 'Bottom', 'Left', 'Right'), + ('ColourBarCanvas', 'orientation', 'labels') : ('Horizontal', 'Vertical'), + ('ColourBarCanvas', 'labelSide', 'labels') : ('Top / Left', 'Bottom / Right'), + ('CanvasPanel', 'zax') : 'Z axis', ('CanvasPanel', 'showCursor') : 'Show location cursor', ('CanvasPanel', 'syncLocation') : 'Sync location', ('CanvasPanel', 'syncImageOrder') : 'Sync image order', @@ -49,6 +55,11 @@ labels = td.TypeDict({ ('CanvasPanel', 'colourBarLocation') : 'Colour bar location', ('CanvasPanel', 'colourBarLabelSide') : 'Colour bar label side', + ('LightBoxPanel', 'highlightSlice') : 'Highlight slice', + ('LightBoxPanel', 'showGridLines') : 'Show grid lines', + ('LightBoxPanel', 'sliceSpacing') : 'Slice spacing', + ('LightBoxPanel', 'zrange') : 'Z range', + ('OrthoPanel', 'showXCanvas') : 'Show X canvas', ('OrthoPanel', 'showYCanvas') : 'Show Y canvas', ('OrthoPanel', 'showZCanvas') : 'Show Z canvas', @@ -121,8 +132,6 @@ labels = td.TypeDict({ ('OrthoEditProfile', 'createMaskFromSelection') : 'Create mask from selected region', ('OrthoEditProfile', 'createROIFromSelection') : 'Create ROI from selected region', - ('Profile', 'mode') : 'Mode', - ('OrthoEditProfile', 'selectionMode') : 'Selection mode', ('OrthoEditProfile', 'selectionSize') : 'Selection size', ('OrthoEditProfile', 'selectionIs3D') : '3D selection', diff --git a/fsl/fslview/views/canvaspanel.py b/fsl/fslview/views/canvaspanel.py index 7d7c4821b910d3597466b0bb3845e72891cec0f7..f56309ee0ddd5c32074147c67513e0d62baa1004 100644 --- a/fsl/fslview/views/canvaspanel.py +++ b/fsl/fslview/views/canvaspanel.py @@ -24,6 +24,7 @@ import wx import props import fsl.fslview.panel as fslpanel +import fsl.fslview.strings as strings import fsl.fslview.profiles as profiles import fsl.fslview.displaycontext as displayctx import fsl.fslview.controls.imagelistpanel as imagelistpanel @@ -160,7 +161,9 @@ class CanvasPanel(fslpanel.FSLViewPanel): zoom = props.Percentage(minval=10, maxval=1000, default=100, clamped=True) - colourBarLocation = props.Choice(('top', 'bottom', 'left', 'right')) + colourBarLocation = props.Choice( + ('top', 'bottom', 'left', 'right'), + labels=strings.labels['CanvasPanel', 'colourBarLocation', 'labels']) colourBarLabelSide = colourbarpanel.ColourBarPanel.labelSide