pymaid.neuron_label.NeuronLabeller¶
- class pymaid.neuron_label.NeuronLabeller(components: List[LabelComponent] | None = None, fmt='%0', trim_empty=True, remove_neighboring_duplicates=True)[source]¶
Class for calculating neurons’ labels, as used in the CATMAID frontend.
Create an object which can calculate labels for neurons based on some configuration.
- Parameters:
components (List[LabelComponent], optional) – The label components as used in CATMAID’s user settings. See SkeletonId, NeuronName, and Annotations. First component should be
SkeletonId()
for compatibility with CATMAID. If None (default), uses[SkeletonId()]
.fmt (str, optional) – Format string as used in CATMAID, by default
"%0"
.trim_empty (bool, optional) – Trim whitespace around components which evaluate to empty strings, by default True
remove_neighboring_duplicates (bool, optional) – Remove extra consecutive components which evaluate to the same value, by default True
- __init__(components: List[LabelComponent] | None = None, fmt='%0', trim_empty=True, remove_neighboring_duplicates=True)[source]¶
Create an object which can calculate labels for neurons based on some configuration.
- Parameters:
components (List[LabelComponent], optional) – The label components as used in CATMAID’s user settings. See SkeletonId, NeuronName, and Annotations. First component should be
SkeletonId()
for compatibility with CATMAID. If None (default), uses[SkeletonId()]
.fmt (str, optional) – Format string as used in CATMAID, by default
"%0"
.trim_empty (bool, optional) – Trim whitespace around components which evaluate to empty strings, by default True
remove_neighboring_duplicates (bool, optional) – Remove extra consecutive components which evaluate to the same value, by default True
Methods
__init__
([components, fmt, trim_empty, ...])Create an object which can calculate labels for neurons based on some configuration.
label
(nrn)Determine the label for the given neuron.