How to use the vedo.Plane 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 / brainrender / atlases / atlas.py View on Github external
norm = self._space.plane_normals[plane]

        # Get plane width and height
        idx_pair = (
            axes_pairs[plane]
            if plane is not None
            else axes_pairs["horizontal"]
        )
        wh = [float(np.diff(self._root_bounds[i])) * 1.2 for i in idx_pair]
        if sx is None:
            sx = wh[0]
        if sy is None:
            sy = wh[1]

        # return plane
        return Plane(pos=pos, normal=norm, sx=sx, sy=sy, c=color, alpha=alpha)
github BrancoLab / BrainRender / brainrender / scene.py View on Github external
:param plane: either a string with the name of one of 
                the predifined planes ['sagittal', 'coronal', 'horizontal'] 
                or an instance of the Plane class from vedo.shapes
        """
        if isinstance(plane, (list, tuple)):
            planes = plane.copy()
        else:
            planes = [plane]

        actors = []
        for plane in planes:
            if isinstance(plane, str):
                plane = self.atlas.get_plane_at_point(plane=plane, **kwargs)
            else:
                if not isinstance(plane, Plane):
                    raise ValueError(
                        "The plane arguments should either be a Plane actor or"
                        + "a string with the name of predefined planes."
                        + f" Not: {plane.__type__}"
                    )
            actors.append(plane)
        self.add_actor(*actors)
        return return_list_smart(actors)
github BrancoLab / BrainRender / brainrender / scene.py View on Github external
planes = [plane]

        if actors is None:
            actors = self.actors
        else:
            if not isinstance(actors, (list, tuple)):
                actors = [actors]

        # Loop over each plane
        to_return = []
        for plane in planes:
            # Get the plane actor
            if isinstance(plane, str):
                plane = self.atlas.get_plane_at_point(plane=plane, **kwargs)
            else:
                if not isinstance(plane, Plane):
                    raise ValueError(
                        "The plane arguments should either be a Plane actor or"
                        + "a string with the name of predefined planes."
                        + f" Not: {plane.__type__}"
                    )

            # Show plane
            if showplane:
                self.add_actor(plane)

            # Cut actors
            for actor in actors:
                if actor is None:
                    continue

                try:
github BrancoLab / BrainRender / brainrender / atlases / base.py View on Github external
norm = self._space.plane_normals[plane]

        # Get plane width and height
        idx_pair = (
            axes_pairs[plane]
            if plane is not None
            else axes_pairs["horizontal"]
        )
        wh = [float(np.diff(self._root_bounds[i])) * 1.2 for i in idx_pair]
        if sx is None:
            sx = wh[0]
        if sy is None:
            sy = wh[1]

        # return plane
        return Plane(pos=pos, normal=norm, sx=sx, sy=sy, c=color, alpha=alpha)

vedo

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

MIT
Latest version published 3 months ago

Package Health Score

78 / 100
Full package analysis