morph_tool.utils

Utils.

Functions

find_morph(folder, stem)

Returns the path to a morphology in morphology_dir matching stem.

is_morphology(filename[, extensions])

Returns True if the extension is supported.

iter_morphology_files(folder[, recursive, ...])

Iterator that returns path to morphology files.

neurondb_dataframe(neurondb[, morphology_dir])

Returns a DataFrame.

morph_tool.utils.find_morph(folder: Path, stem: str) Optional[Path]

Returns the path to a morphology in morphology_dir matching stem.

If no morphology is found, returns None

morph_tool.utils.is_morphology(filename, extensions=None)

Returns True if the extension is supported.

morph_tool.utils.iter_morphology_files(folder, recursive=False, extensions=None)

Iterator that returns path to morphology files.

morph_tool.utils.neurondb_dataframe(neurondb: Path, morphology_dir: Optional[Path] = None) DataFrame

Returns a DataFrame.

The expected columns: name, layer, mtype, use_axon, (optional) path. If read from an XML, additional columns maybe be present.

Parameters:
  • neurondb – the neurondb.(dat|xml) file

  • morphology_dir – (Optional) If passed, a column with the path to each morphology file will be added

Raises: ValueError if the neurondb does not abide by the specification https://bbpteam.epfl.ch/documentation/projects/morphology-repair-workflow/latest/input_files.html#specification

Deprecated since version Use: morph_tool.morphdb.MorphDB instead.