neurom.io

IO operations module for NeuroM.

Functions

load_data

Unpack data into a raw data wrapper.

load_neuron

Build section trees from an h5 or swc file.

load_neurons

Create a population object.

Classes

NeuronLoader

Caching morphology loader.

class neurom.io.NeuronLoader(directory, file_ext=None, cache_size=None)[source]

Bases: object

Caching morphology loader.

Parameters
  • directory – path to directory with morphology files

  • file_ext – file extension to look for (if not set, will pick any of .swc|.h5|.asc)

  • cache_size – size of LRU cache (if not set, no caching done)

get(name)[source]

Get name morphology data.

neurom.io.load_data(handle, reader=None)[source]

Unpack data into a raw data wrapper.

neurom.io.load_neuron(handle, reader=None)[source]

Build section trees from an h5 or swc file.

neurom.io.load_neurons(neurons, neuron_loader=<function load_neuron>, name=None, population_class=<class 'neurom.core.population.Population'>, ignored_exceptions=())[source]

Create a population object.

From all morphologies in a directory of from morphologies in a list of file names.

Parameters
  • neurons – directory path or list of neuron file paths

  • neuron_loader – function taking a filename and returning a neuron

  • population_class – class representing populations

  • name (str) – optional name of population. By default ‘Population’ or filepath basename depending on whether neurons is list or directory path respectively.

Returns

neuron population object