navis.read_nmx¶
- navis.read_nmx(f, include_subdirs=False, parallel='auto', precision=32, limit=None, **kwargs)[source]¶
Read NMX files into Neuron/Lists.
NMX is an xml-based format used by pyKNOSSOS. See e.g. here for a data dump of neurons from Wanner et al. (2016).
- Parameters:
f (str) – Filename or folder. If folder, will import all
.nmx
files.include_subdirs (bool, optional) – If True and
f
is a folder, will also search subdirectories for.nmx
files.parallel ("auto" | bool | int) – Defaults to
auto
which means only use parallel processing if more than 200 files are imported. Spawning and joining processes causes overhead and is considerably slower for imports of small numbers of neurons. Integer will be interpreted as the number of cores (otherwise defaults toos.cpu_count() // 2
).precision (int [8, 16, 32, 64] | None) – Precision for data. Defaults to 32 bit integers/floats. If
None
will let pandas infer data types - this typically leads to higher than necessary precision.limit (int, optional) – If reading from a folder you can use this parameter to read only the first
limit
NMX files. Useful if wanting to get a sample from a large library of skeletons.**kwargs – Keyword arguments passed to the construction of
navis.TreeNeuron
. You can use this to e.g. set meta data.
- Return type:
See also
navis.read_nml()
Read NML file(s).