Skip to content

Commit

Permalink
upload_neuron: deal with missing radii and confidences
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Apr 18, 2021
1 parent 7686ade commit d3be507
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions pymaid/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,18 @@ def upload_neuron(x, import_tags=False, import_annotations=False,
'with a given skeleton or neuron ID.')

node = x.nodes.iloc[0]
resp = add_node(coords=node[['x', 'y', 'z']].values,
parent_id=None,
radius=node.radius,
confidence=node.confidence if node.confidence else None,
remote_instance=remote_instance)

vars = dict(coords=node[['x', 'y', 'z']].values,
parent_id=None,
remote_instance=remote_instance)

if hasattr(node, 'confidence'):
vars['confidence'] = node.confidence if node.confidence else None

if hasattr(node, 'radius'):
vars['radius'] = node.radius

resp = add_node(**vars)

# If error is returned
if 'error' in resp:
Expand Down

0 comments on commit d3be507

Please sign in to comment.