Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
coords[col_names[0]].values,
coords[col_names[1]].values,
coords[col_names[2]].values,
)
]
# Update color
if color_by_region:
color = self.atlas.get_colors_from_coordinates(coords)
elif color_by_metadata is not None:
color = get_cells_colors_from_metadata(
color_by_metadata, coords_df, color
)
# Create actors
spheres = shapes.Spheres(
coords, c=color, r=radius, res=res, alpha=alpha
)
self.actors.append(spheres)
if verbose:
print("Added {} cells to the scene".format(len(coords)))
return spheres
)
)
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:
injection_data = data["injection_sites"]
for inj in injection_data:
coords.append(list(inj.values()))
spheres = [shapes.Spheres(coords, r=brainrender.INJECTION_VOLUME_SIZE)]
else:
spheres = []
merged = merge(*lines, *spheres)
merged.color(color)
merged.alpha(alpha)
return [merged]