pymaid.shorten_name

pymaid.shorten_name(x, max_len=30)[source]

Shorten a neuron name by iteratively removing non-essential bits.

Prioritises generic -> tracer -> nickname -> type information when removing until target length is reached. This works best if neuron name follows this convention:

{type} {generic} {nickname} {tracers}
Parameters
  • x (str | CatmaidNeuron) – Neuron name.

  • max_len (int, optional) – Max length of shortened name.

Returns

shortened name

Return type

str

Examples

>>> pymaid.shorten_name('AD1b2#7 3080184 Dust World JJ PS', 30)
'AD1b2#7 Dust World [..]'