Two Slicer3DPlotter renders side by side in the same plot? #925
-
So I stumbled onto Slicer3DPlotter and it is brilliant. I love it, but I am wondering if there is a way to have two interactive renders in the same plot. My application is that I am training deep learning surrogate models to predict micromechanical simulation outputs given some input volume, and Slicer3DPlotter works great to visualize stress fields. What I want to do is plot the target stress field right next to the output mask from the model. Having the histograms up there together is great for comparisons. Is this possible? Also is it possible for the icons of the Slicer3DPlotter objects to be set to a third separate volume (the input into the simulation and surrogate model) for both renders? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi @daniel-a-diaz
Then try: from vedo import dataurl, Volume, Text2D, Arrow, Sphere
from vedo.applications import Slicer3DPlotter
from vedo.pyplot import histogram
vol = Volume(dataurl + "embryo.slc")
plt = Slicer3DPlotter(
vol,
cmaps=("gist_ncar_r", "jet", "Spectral_r", "hot_r", "bone_r"),
shape=(1,2),
sharecam=False,
bg="white",
bg2="lightblue",
)
# Can now add any other object to the Plotter scene:
histo = histogram(vol, bins=12, logscale=True).as2d(pos="top-left", scale=0.5)
plt += histo
plt += Arrow([120,120,120], [200,200,200])
plt += Text2D('Mouse Embryo', pos='top-center', font="Theemim", bg='yellow')
plt.at(1)
plt += Sphere().linewidth(1)
plt.show()
plt.at(0).reset_camera()
plt.interactive()
plt.close() Note that for multiple renderers only 3D sliders are available (a current limitation). |
Beta Was this translation helpful? Give feedback.
-
Oh I see, the two should have independent sliders or the same for both? |
Beta Was this translation helpful? Give feedback.
Hi @daniel-a-diaz
you can add any object to
Slicer3DPlotter
because it is a normalPlotter
object:Then try: