Open hanjiahe1999 opened 2 weeks ago
Have a look at examples/basic/sliders*.py
from vedo import *
settings.default_font = "Calco"
def slider_func(widget, event):
value = widget.value
lego = vol.legosurface(vmin=20, vmax=value, boundary=False)
if lego.ncells:
lego.cmap('seismic', vmin=0, vmax=value).add_scalarbar()
# lego.linewidth(0).lighting('off').alpha(0.5)
lego.name = "LegoSurface"
plt.remove("LegoSurface").add(lego)
plt.render()
vol = Volume(dataurl+'embryo.tif')
vol.crop(back=0.50) # crop 50% from neg. y
plt = Plotter()
plt.add_slider(
slider_func,
xmin=0,
xmax=127,
value=100,
pos="bottom-left",
title="value",
# delayed=True,
)
plt += Axes(vol)
plt.show(viewup='z').close()
When I study this case, I want to try to add a slider to control the Lego display range. Do you have any good suggestions?
Thank you for your help!!