Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-specified colormap in PointsDensity #325

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions brainrender/actors/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,20 @@ def __init__(

class PointsDensity(Actor):
def __init__(
self, data, name=None, dims=(40, 40, 40), radius=None, **kwargs
self,
data,
name=None,
dims=(40, 40, 40),
radius=None,
colors="Dark2",
**kwargs,
):
"""
Creates a Volume actor showing the 3d density of a set
of points.

:param data: np.ndarray, Nx3 array with cell coordinates
:param colors: str, matplotlib colormap


from vedo:
Expand All @@ -140,7 +147,7 @@ def __init__(
volume = (
vPoints(data)
.density(dims=dims, radius=radius, **kwargs)
.cmap("Dark2")
.cmap(colors)
.alpha([0, 0.9])
.mode(1)
) # returns a vedo Volume
Expand Down
Loading