How to use the vedo.settings.notebookBackend function in vedo

To help you get started, we’ve selected a few vedo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / tests / test_scene.py View on Github external
def test_scene_creation_notebook():
    settings.notebookBackend = "k3d"
    Scene()
    settings.notebookBackend = None
github BrancoLab / BrainRender / tests / test_scene.py View on Github external
def test_scene_creation_notebook():
    settings.notebookBackend = "k3d"
    Scene()
    settings.notebookBackend = None
github BrancoLab / BrainRender / brainrender / render.py View on Github external
- 'folder' -> str, path to folder where to save screenshots
                        - 'name' -> str, filename to prepend to screenshots files
                        - 'format' -> str, 'png', 'svg' or 'jpg'
                        - scale -> float, values > 1 yield higher resultion screenshots
            :param use_default_key_bindings: if True the defualt keybindings from vedo are used, otherwise
                            a custom function that can be used to take screenshots with the parameter above. 
        """
        # Setup a few rendering options
        self.verbose = verbose
        self.display_inset = (
            display_inset
            if display_inset is not None
            else brainrender.DISPLAY_INSET
        )

        if vedosettings.notebookBackend == "k3d":
            self.jupyter = True
        else:
            self.jupyter = False

        if self.display_inset and self.jupyter:
            print(
                "Setting 'display_inset' to False as this feature is not \
                            available in juputer notebooks"
            )
            self.display_inset = False

        # Camera parameters
        self.camera = get_scene_camera(camera, self.atlas)

        # Create vedo plotter
        self.plotter = Plotter(**get_scene_plotter_settings(self.jupyter))
github BrancoLab / BrainRender / brainrender / render.py View on Github external
def export_for_web(self, filepath="brexport.html"):
        """
            This function is used to export a brainrender scene
            for hosting it online. It saves an html file that can
            be opened in a web browser to show an interactive brainrender scene
        """
        if not filepath.endswith(".html"):
            raise ValueError("Filepath should point to a .html file")

        # prepare settings
        vedosettings.notebookBackend = "k3d"

        # Create new plotter and save to file
        plt = Plotter()
        plt.add(self.actors)
        plt = plt.show(interactive=False)
        plt.camera[-2] = -1

        print(
            "Ready for exporting. Exporting scenes with many actors might require a few minutes"
        )
        with open(filepath, "w") as fp:
            fp.write(plt.get_snapshot())

        print(
            f"The brainrender scene has been exported for web. The results are saved at {filepath}"
        )
github BrancoLab / BrainRender / brainrender / render.py View on Github external
plt.add(self.actors)
        plt = plt.show(interactive=False)
        plt.camera[-2] = -1

        print(
            "Ready for exporting. Exporting scenes with many actors might require a few minutes"
        )
        with open(filepath, "w") as fp:
            fp.write(plt.get_snapshot())

        print(
            f"The brainrender scene has been exported for web. The results are saved at {filepath}"
        )

        # Reset settings
        vedosettings.notebookBackend = None
        self.jupyter = False

vedo

A python module for scientific analysis and visualization of 3D objects and point clouds based on VTK and Numpy.

MIT
Latest version published 6 months ago

Package Health Score

71 / 100
Full package analysis

Similar packages