pymaid.time_machine¶
- pymaid.time_machine(x, target, inplace=False, remote_instance=None)[source]¶
Reverses time and make neurons young again!
Prunes a neuron back to it’s state at a given date. Here is what we can reverse:
Creation and deletion of nodes
Creation and deletion of connectors (and links)
Movement of nodes and connectors
Cuts and merges
Addition of node tags & annotations (even deleted ones)
Unfortunately time travel has not yet been perfected. We are oblivious to:
Removal of tags/annotations: i.e. we know when e.g. a tag was added and that it was subsequently removed at some point but not when.
- Parameters:
x (skeleton ID(s) | CatmaidNeuron | CatmaidNeuronList) – Neuron(s) to rejuvenate.
target (str | datetime-like | pandas.Timestamp) – Date or date + time to time-travel to. Must be parsable by
pandas.TimeStamp
. Format for string is YEAR-MONTH-DAY.inplace (bool, optional) – If True, will perform time travel on and return a copy of original.
remote_instance (CatmaidInstance, optional) –
- Returns:
A younger version of the neuron(s).
- Return type:
CatmaidNeuron/List
Examples
>>> n = pymaid.get_neuron(16) >>> previous_n = pymaid.time_machine(n, '2016-12-1')