Closed snownontrace closed 3 months ago
Thanks! I have just updated the isosurface2.py example, which should provide the functionality you asked for.
pip install -U git+https://github.com/marcomusy/vedo.git
Thank you so much for your rapid response! I am puzzled by that in each pair of the touching object, one of them get a flat surface that seems to be from the cap method, while the other one gets an indented concaved surface. For example, between blobs 3 and 10, blob 10 got a flat cap, while blob 3 got a concaved surface. It would be more natural to think the boundary here should be assigned to both blobs. This seems to originate from isosurface_discrete, since the label assignment was already there when I check the mesh with wireframe style (blob 10 had an opening there).
When internal_boundaries is set True, the iso_discrete.celldata['BoundaryLabels'] does contain sufficient information for my purpose. Thank you so much!
This dev version seems to introduce some bugs in plotter:
plotter = Plotter(bg=video_bg, size=video_size, offscreen=True)
plotter.add(msh)
plotter.show() # important to set the camera at the right position
plotter.zoom(initial_zoom)
plotter.camera.Azimuth(90)
video = Video(video_file_name, duration=video_duration, fps=video_fps)
video.action(elevation=(0, 0), azimuth=(-90, 270))
video.close() # merge all the recorded frames and write to disk
Gives the following error:
File "C:\Users\wangs6\AppData\Local\miniforge3\envs\vedo\Lib\site-packages\vedo\file_io.py", line 2026, in action
plt.render()
File "C:\Users\wangs6\AppData\Local\miniforge3\envs\vedo\Lib\site-packages\vedo\plotter.py", line 1125, in render
if self._cocoa_process_events and self.interactor.GetInitialized():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'GetInitialized'
Reverting the installation to stable release fixed the issue.
That is strange..! Try with this latest dev.
Hi Marco, thanks so much for the quick update! With the latest dev it no longer errors out, but when the objects rotate, the closest and furthest parts were cut out. In other words, the default depth of view was shallower. See below for a comparison with plotter behavior with vedo-2024.5.2 (left) or vedo-2024.5.2-dev09 (right):
Oh, what if you call
plotter.reset_clipping_range()
I tried adding it right before calling Video, but it remains clipped.
plotter = Plotter(bg=video_bg, size=video_size, offscreen=True)
plotter.add(msh)
plotter.show() # important to set the camera at the right position
plotter.zoom(initial_zoom)
plotter.camera.Azimuth(90)
plotter.reset_clipping_range()
video = Video(video_file_name, duration=video_duration, fps=video_fps)
video.action(elevation=(0, 0), azimuth=(-90, 270))
video.close() # merge all the recorded frames and write to disk
Thanks Shaohe for reporting, I just pushed a change to the screenshot()
method I hope it fixes the issue.
Problem solved! Thanks again for fixing this so quickly.
Thanks for making this wonderful library! I noticed that the mesh generated using isosurface_discrete from a 3D segmented image does not cover the touching objects. As a result, surface area calculation of each labeled object is underestimated. Is there a way to add a feature to enable watertight mesh around each object?