Hello,
Three questions regarding Makie layout of IntervalSlider and Slider.
- On the left side of the above image, I would like to have a :grey10 background for the IntervalSlider and Slider as in the Textbox. However, if I include the code
axis_controls_panel =
Axis(
controls_grid_layout[:,1],
backgroundcolor = :grey10)
hidedecorations!.(axis_controls_panel)
in the code fragment below, the :grey10 background does not display and the sliders become unresponsive. How to do this correctly?
-
How can I add a custom label to both the IntervalSlider and Slider above and left-justified for each widget: “Window Width” and “Window Centre” in this case?
-
How can I display as text the current value pair of IntervalSlider and the current value of Slider immediately below each widget and centred?
[The new Makie documentation looks good and the comprehensive layout tutorial was helpful in refactoring my code.]
Code fragment:
# Figure for GLMakie display
noto_sans = assetpath("fonts", "NotoSans-Regular.ttf")
figure = Figure(
backgroundcolor = :black,
resolution = (1920, 1040),
font = noto_sans)
# Top level grid layout
top_level_grid_layout = figure[1:2, 1:3] = GridLayout()
# Control panel grid layout
control_panel_grid_layout = top_level_grid_layout[1:2, 1] = GridLayout()
text_panel_grid_layout = control_panel_grid_layout[1, 1] = GridLayout()
controls_grid_layout = control_panel_grid_layout[2, 1] = GridLayout()
# Display grid layout
displays_grid_layout = top_level_grid_layout[1:2, 2:3] = GridLayout()
# 3D image volume
volume_grid_layout = displays_grid_layout[1, 1] = GridLayout()
# 2D image slice planes
axial_grid_layout = displays_grid_layout[1, 2] = GridLayout()
sagittal_grid_layout = displays_grid_layout[2, 1] = GridLayout()
coronal_grid_layout = displays_grid_layout[2, 2] = GridLayout()
#
# Control Panel display
#
# Infomation text box
axis_text_panel =
Axis(
text_panel_grid_layout[1,1],
backgroundcolor = :grey10)
hidedecorations!.(axis_text_panel)
# Patient data
patient_string = string("a set of concatenated patient info")
# Image acquisition data
acquisition_string = string("a set of concatenated acquisition info")
display_string = string(
patient_string,
acquisition_string)
Textbox(
text_panel_grid_layout[1, 1],
bordercolor = :gray10,
bordercolor_focused = :gray10,
bordercolor_hover = :gray10,
boxcolor = :gray10,
boxcolor_focused = :gray10,
boxcolor_hover = :gray10,
cursorcolor = :gray10,
halign = :center,
displayed_string = display_string,
stored_string = display_string,
textcolor = :gray80,
textpadding = (16, 16, 16, 16),
space = :data,
valign = :top)
# Control widgets
#=
axis_controls_panel =
Axis(
controls_grid_layout[:,1],
backgroundcolor = :grey10)
hidedecorations!.(axis_controls_panel)
=#
interval_slider_window_width =
IntervalSlider(
controls_grid_layout[1, 1],
range = LinRange(voxel_scalar_min:1.0:voxel_scalar_max),
startvalues = (voxel_scalar_min, voxel_scalar_max),
color_active = :orangered2,
linewidth = 10.0)
slider_window_centre =
Slider(
controls_grid_layout[2, 1],
color_active = :orangered2,
linewidth = 10.0,
range = LinRange(voxel_scalar_min:1.0:voxel_scalar_max),
startvalue = window_centre)
# To do: connect the above sliders
Box(controls_grid_layout[3, 1], color = :black)