import ipyvolume as ipv
import ipywidgets as widgets
import solara
fig = ipv.figure()
volume = ipv.examples.head(show=False, description="Patient X")
ipv.show()
slice_x = ipv.plot_plane('x', volume=volume, description="Slice X", description_color="black", icon="mdi-knife")
slice_y = ipv.plot_plane('y', volume=volume, description="Slice Y", description_color="black", icon="mdi-knife")
slice_z = ipv.plot_plane('z', volume=volume, description="Slice Z", description_color="black", icon="mdi-knife",
visible=False)
widgets.jslink((fig, 'slice_x'), (slice_x, 'x_offset'))
widgets.jslink((fig, 'slice_y'), (slice_y, 'y_offset'))
widgets.jslink((fig, 'slice_z'), (slice_z, 'z_offset'));
page = widgets.VBox([
solara.Markdown.widget(md_text="""
Press the scissors icon to use the slicing planes, or hold shift when you move the mouse.
*NOTE: currently not behaving as expected, and the key press of shift only gets registered after clicking
somewhere in the UI.*
"""),
ipv.gcc()
])