GithubHelp home page GithubHelp logo

Comments (6)

GuillaumeFavelier avatar GuillaumeFavelier commented on June 11, 2024

First off it's called off_screen but there might be a better name for it. AFAIK, except if VTK itself is built to support this feature (for example osmesa: https://discourse.vtk.org/t/offscreen-rendering-opening-window/1660/2, https://discourse.vtk.org/t/black-image-when-using-offscreen-rendering-inside-qt-application/3935), a "screen" will be needed. This screen can be virtual that's why our CIs on Linux use xvfb for instance.

So off_screen=True in pyvistaqt is more about "rendering without opening a window". Also from my experience, this mode has limitations but I can investigate further if necessary.

Now back on your question, I don't quite understand the link between off_screen and view_isometric. The latter just set the default camera parameters. Those can be modified exactly like the vanilla Plotter in PyVista by playing with the camera attribute. Do you have an issue with it?

from pyvistaqt.

szsdk avatar szsdk commented on June 11, 2024

So off_screen=True in pyvistaqt is more about "rendering without opening a window". Also from my experience, this mode has limitations but I can investigate further if necessary.

Now, I have a better understanding about the off_screen flag. In the beginning, The update method of BasePlotter

https://github.com/pyvista/pyvista/blob/fbb8570ebd942cdb82a0602daf78a8dff9e2c972/pyvista/plotting/plotting.py#L1166-L1180

gives me a wrong idea that off_screen is used for avoiding rendering. And this is why I found it a little bit strange when I saw view_isometric triggers a rendering at

https://github.com/pyvista/pyvista/blob/fbb8570ebd942cdb82a0602daf78a8dff9e2c972/pyvista/plotting/plotting.py#L836-L843

from pyvistaqt.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 11, 2024

Good catch.

So when off_screen=True, the update() function is disabled because it depends on an internal attribute called self.iren (of type vtkRenderWindowInteractor) which is not initialized. This is arguably the limitation I'm talking about in mne-tools/mne-python#8602 (comment).

But the rendering window itself (attribute self.ren_win of type vtkRenderWindow) can still be used for rendering.

I hope what I say is not too confusing, sorry for going into details.

from pyvistaqt.

szsdk avatar szsdk commented on June 11, 2024

Thanks for your detailed explanation. I am doing some development on a remote server. Sadly, My Mac does not cooperate well with it. And I cannot make pyvistaqt work through ssh. So I hope I could run some off screen test at least. But now it seems to be another died end. So according to your link, there would be a big refactor of pysitaqt?

from pyvistaqt.

szsdk avatar szsdk commented on June 11, 2024

Please feel free to close this issue.

from pyvistaqt.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 11, 2024

So according to your link, there would be a big refactor of pysitaqt?

No this part is not related to pyvistaqt sorry 😅

from pyvistaqt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.