How to use the vedo.shapes.Tube 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 / ABA / aba_utils.py View on Github external
"Need to pass eiteher a filepath or data argument to parse_streamline"
        )

    # create actors for streamlines
    lines = []
    if len(data["lines"]) == 1:
        try:
            lines_data = data["lines"][0]
        except KeyError:
            lines_data = data["lines"]["0"]
    else:
        lines_data = data["lines"]
    for line in lines_data:
        points = [[l["x"], l["y"], l["z"]] for l in line]
        lines.append(
            shapes.Tube(
                points,
                r=radius,
                c=color,
                alpha=alpha,
                res=brainrender.STREAMLINES_RESOLUTION,
            )
        )

    coords = []
    if show_injection_site:
        if len(data["injection_sites"]) == 1:
            try:
                injection_data = data["injection_sites"][0]
            except KeyError:
                injection_data = data["injection_sites"]["0"]
        else:
github BrancoLab / BrainRender / brainrender / atlases / mouse.py View on Github external
# represent injection site as sphere
            if display_injection_volume:
                actors.append(
                    shapes.Sphere(
                        pos=t["injection-coordinates"],
                        c=color,
                        r=brainrender.INJECTION_VOLUME_SIZE
                        * t["injection-volume"],
                        alpha=brainrender.TRACTO_ALPHA,
                    )
                )

            points = [p["coord"] for p in t["path"]]
            actors.append(
                shapes.Tube(
                    points,
                    r=brainrender.TRACTO_RADIUS,
                    c=color,
                    alpha=alpha,
                    res=brainrender.TRACTO_RES,
                )
            )

        return actors
github BrancoLab / BrainRender / brainrender / atlases / aba.py View on Github external
actors.append(
                    shapes.Sphere(
                        pos=t["injection-coordinates"],
                        c=color,
                        r=brainrender.INJECTION_VOLUME_SIZE
                        * t["injection-volume"],
                        alpha=brainrender.TRACTO_ALPHA,
                    )
                )
                actors[-1].name = (
                    str(t["injection-coordinates"]) + "_injection"
                )

            points = [p["coord"] for p in t["path"]]
            actors.append(
                shapes.Tube(
                    points,
                    r=brainrender.TRACTO_RADIUS,
                    c=color,
                    alpha=alpha,
                    res=brainrender.TRACTO_RES,
                )
            )
            actors[-1].name = str(t["injection-coordinates"]) + "_tractography"

        return actors
github BrancoLab / BrainRender / brainrender / atlases / celegans.py View on Github external
try:
            data = cs.skeletons_data[neuron]
        except:
            print(f"No skeleton data found for {neuron}")
            return None

        # Create an actor for each neuron's branch and then merge
        actors = []
        for branch in data["branches"]:
            coords = [data["coordinates"][str(p)] for p in branch]

            # Just like for synapses we need to adjust the coordinates to match the .obj files
            # coords are x z -y
            adjusted_coords = [(c[0], c[2], -c[1]) for c in coords]
            actors.append(
                Tube(
                    adjusted_coords,
                    r=cs.skeleton_radius,
                    res=NEURON_RESOLUTION,
                )
            )

        return merge(*actors)

vedo

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

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis

Similar packages