navis.write_json¶
- navis.write_json(x, filepath, **kwargs)[source]¶
Save neuron(s) to json-formatted file.
Nodes and connectors are serialised using pandas’
to_json()
. Most other items in the neuron’s __dict__ are serialised usingjson.dumps()
. Properties not serialised: .graph, .igraph.- Parameters:
x (TreeNeuron | NeuronList) – Neuron(s) to save.
filepath (str, optional) – File to save data to. If None will return a json-formatted string.
**kwargs – Parameters passed to
json.dumps()
andpandas.DataFrame.to_json()
.
- Returns:
Only if
filepath=None
.- Return type:
str
See also
read_json()
Read json back into navis neurons.