-
Hi I am new to vedo. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi, the Try out this: from vedo import dataurl, Volume, Text2D, Axes, Video
from vedo.applications import Slicer3DPlotter
filename = dataurl+'embryo.slc'
vol = Volume(filename)
plt = Slicer3DPlotter(
vol,
bg='white', bg2='lightblue',
cmaps=("gist_ncar_r","jet","Spectral_r","hot_r","bone_r"),
useSlider3D=False,
axes=0,
interactive=False,
)
axes = Axes(
xrange=vol.xbounds(),
yrange=vol.ybounds(),
zrange=vol.zbounds(),
xtitle="Y-axis",
ytitle="Z-axis",
ztitle="X-axis",
xyGrid=False,
)
#Can now add any other object to the Plotter scene:
plt += axes
plt += Text2D(f'File: {filename}')
vid = Video("slicing_volume.mp4", duration=5) # on windows this might not work
# extract the sliders
sld1, sld2, sld3 = plt.sliders
for i in range(200):
widget, func = sld1
widget.GetRepresentation().SetValue(i)
func(widget, "")
plt.camera.Azimuth(0.1) # optional
plt.render()
vid.addFrame()
vid.close()
plt.interactive().close() slicing_volume.mp4 |
Beta Was this translation helpful? Give feedback.
-
yes About the crashing, you may try with the latest dev-version and/or with the spyder IDE? About saving the file... if it doesn't work on windows I have no other solution than screen-grabbing or creating a series of screenshots in the loop with |
Beta Was this translation helpful? Give feedback.
-
Uhm sorry I'm not sure I understand what the problem is.. what if you add instead: |
Beta Was this translation helpful? Give feedback.
yes
About the crashing, you may try with the latest dev-version
pip install -U git+https://github.com/marcomusy/vedo.git
and/or with the spyder IDE?
About saving the file... if it doesn't work on windows I have no other solution than screen-grabbing or creating a series of screenshots in the loop with
plt.screenshot(f"image_{i}.png")
and then merging them with some external software.