question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Depth mapping not working on jupyterlab3

See original GitHub issue

Describe the bug, what’s wrong, and what you expected.

I have tried running the following example and I get the following error. While this example does not include the off_screen = True parameter I included it within show() but still get an error

Steps to reproduce the bug.

 import pyvista as pv
from pyvista import examples

# Load an interesting example of geometry
mesh = examples.load_random_hills()

# Establish geometry within a pv.Plotter()
p = pv.Plotter()
p.add_mesh(mesh, color=True)
p.store_image = True  # permit image caching after plotter is closed
p.show()

zval = p.get_image_depth() 

System Information

--------------------------------------------------------------------------`
AttributeError                            Traceback (most recent call last)
Input In [13], in <cell line: 1>()
----> 1 zval = p.get_image_depth()

File C:\Python\Miniconda\envs\test_3d\lib\site-packages\pyvista\plotting\plotting.py:3488, in BasePlotter.get_image_depth(self, fill_value, reset_camera_clipping_range)
   3485         zval[self._image_depth_null] = fill_value
   3486     return zval
-> 3488 self._check_rendered()
   3489 self._check_has_ren_win()
   3491 # Ensure points in view are within clipping range of renderer?

File C:\Python\Miniconda\envs\test_3d\lib\site-packages\pyvista\plotting\plotting.py:1241, in BasePlotter._check_rendered(self)
   1239 """Check if the render window has been shown and raise an exception if not."""
   1240 if not self._rendered:
-> 1241     raise AttributeError(
   1242         '\nThis plotter has not yet been set up and rendered '
   1243         'with ``show()``.\n'
   1244         'Consider setting ``off_screen=True`` 
   1245         'for off screen rendering.\n'
   1246     )

AttributeError: 
This plotter has not yet been set up and rendered with ``show()`
Consider setting ``off_screen=True`` for off screen rendering. '

Screenshots

No response

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mlloberacommented, Jul 8, 2022

Great thanks!! I tried this and something weird happened. If I run it without the off_screen parameter I get the popup window and when I quit it, I get z-values as expected. However, when I try with off_screen = True all I get is nan.

1reaction
akaszynskicommented, Jul 8, 2022

Can you try with off_screen=True set on the Plotter?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DepthMap setImage not working - Agisoft Metashape
DepthMap setImage not working. ... I try to moddify depth maps for all cameras in the chunk. My principle workflow for a given...
Read more >
Extension Developer Guide - JupyterLab Documentation
JupyterLab automatically deduplicates the entire dependency tree between source extensions when it rebuilds itself during a source extension installation.
Read more >
How to show Plotly figures in JupyterLab 3+? - Stack Overflow
After some more research it appears jupyter lab 3 is not currently compatible with plotly. They are currently working on it.
Read more >
How to use the brand new DEPTH MAP tool in Davinci ...
Check out SCANS Nvidia Studio Systems here : https://bit.ly/SCANNVIDIAStudioNVIDIA: @NVIDIAGeForceUKSCAN: @SCANComputers☕☕☕ SAY THANKS ...
Read more >
DaVinci Resolve 18 - Depth Map and Surface Tracker Tutorial
Resolve 18 is out! In this video we are demonstrating how to use the new Surface Tracker and Depth Map effects. If you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found