navis-org / pymaid

Python library to interface with CATMAID servers. Fully interoperable with navis.
https://pymaid.readthedocs.io/en/latest/
GNU General Public License v3.0
24 stars 11 forks source link

Neuron label #237

Closed clbarnes closed 1 year ago

clbarnes commented 1 year ago

Resolves #236

Example usage

from pymaid.neuron_label import NeuronLabeller, SkeletonId, NeuronName, Annotations, ThinNeuron

labeller = NeuronLabeller(
    [SkeletonId(), NeuronName(), Annotations(annotator_name="me"), Annotations(annotated_with="my useful annotation")],
    "%1 (%0) personal:%2 annotations:%3{ | }"
)

skid = 1234567
nrn = ThinNeuron(skid)  # only holds the info needed by the labeller, and fetches it lazily

print(labeller.label(nrn))
>>> neuron name (1234567) personal:myfirstann, mysecondann annotations:thing | another thing | and another