Skip to content

Commit c6219f9

Browse files
committed
Merge remote-tracking branch 'upstream' into nearest_node
2 parents f1f45b8 + 2a452c3 commit c6219f9

File tree

4 files changed

+381
-0
lines changed

4 files changed

+381
-0
lines changed

docs/source/api.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ Functions related to searching for neurons and fetching their 3D skeletons:
4848
pymaid.get_skeleton_change
4949
pymaid.get_skeleton_ids
5050

51+
52+
Neuron labels
53+
^^^^^^^^^^^^^
54+
55+
.. autosummary::
56+
:toctree: generated/
57+
58+
pymaid.neuron_label.NeuronLabeller
59+
pymaid.neuron_label.SkeletonId
60+
pymaid.neuron_label.NeuronName
61+
pymaid.neuron_label.Annotations
62+
pymaid.neuron_label.ThinNeuron
63+
5164
Annotations
5265
-----------
5366
Functions to fetch annotations:

docs/source/whats_new.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ What's new?
1010
* - Version
1111
- Date
1212
-
13+
* - Next
14+
- n/a
15+
- - :class:`pymaid.neuron_label.NeuronLabeller` added for labelling neurons
16+
like in the CATMAID frontend.
1317
* - 2.4.0
1418
- 27/05/23
1519
- - :func:`pymaid.get_annotation_graph` deprecated in favour of the new

pymaid/fetch/annotations.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ def filter_by_query(
8282
return filt
8383

8484

85+
@cache.wipe_and_retry
86+
def get_annotation_table(remote_instance=None):
87+
88+
remote_instance = utils._eval_remote_instance(remote_instance)
89+
90+
logger.debug("Retrieving list of annotations...")
91+
92+
remote_annotation_list_url = remote_instance._get_annotation_list()
93+
an_list = remote_instance.fetch(remote_annotation_list_url)
94+
95+
return pd.DataFrame.from_records(an_list["annotations"])
96+
97+
8598
@cache.wipe_and_retry
8699
def get_annotation_id(
87100
annotations, allow_partial=False, raise_not_found=True, remote_instance=None
@@ -106,6 +119,7 @@ def get_annotation_id(
106119
``{'annotation_name': 'annotation_id', ...}``
107120
108121
"""
122+
an_list = get_annotation_table()
109123
remote_instance = utils._eval_remote_instance(remote_instance)
110124

111125
logger.debug("Retrieving list of annotations...")

0 commit comments

Comments
 (0)