Skip to content

Commit

Permalink
fix voxel2gfx
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 4, 2024
1 parent f2ee7ae commit 48edd23
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions octarine_navis_plugin/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,23 @@ def mesh2gfx(neuron, neuron_color, object_id, **kwargs):

def voxel2gfx(neuron, neuron_color, object_id, **kwargs):
"""Convert voxels (i.e. VoxelNeuron) to pygfx visuals."""
vol = oc.visuals.volume2gfx(
neuron,
vols = oc.visuals.volume2gfx(
neuron.grid,
color=neuron_color,
spacing=neuron.units_xyz.magnitude,
offset=neuron.offset,
)

# Add custom attributes
vol._object_type = "neuron"
vol._neuron_part = "neurites"
vol._neuron_id = neuron.id
vol._name = str(getattr(neuron, "name", neuron.id))
vol._object_id = object_id
vol._object = neuron

return [vol]
for vol in vols:
vol._object_type = "neuron"
vol._neuron_part = "neurites"
vol._neuron_id = neuron.id
vol._name = str(getattr(neuron, "name", neuron.id))
vol._object_id = object_id
vol._object = neuron

return vols


def skeleton2gfx(neuron, neuron_color, object_id, **kwargs):
Expand Down

0 comments on commit 48edd23

Please sign in to comment.