morphval.common

Private helper functions of the validation module.

Attributes

COMP_MAP

Functions

pretty_name(name)

Make a pretty name.

add_progress_bar(items, template, description)

Add a progress bar in notebooks.

progress_bar_label(template, description, notebook)

Format progress bar label.

dump2json(data_dir, var_name, data)

Save the dictionary 'data' into a .json file.

load_json(fname)

Load a json file from file with fname into the results dictionary.

find_cells(dir_name)

Return the cells in dir_name.

pyplot_non_interactive()

Suppress pyplot showing blank graphs when in interactive mode.

get_agg_fig()

Yield a figure and close it afterwards.

center_population(population)

Return a new population where all cells have been translated to their soma origins.

truncate_population(population, count)

Return a new population with count elements.

get_components_population(population, component)

Get component of a given population.

compute_bounding_box(*populations)

Get bounding box of a population.

plot_population(output_dir, population, xlim, ylim[, ...])

Plot a population.

plot_normalized_neurons(output_dir, ref_population, ...)

Plot cell examples and store the file in output_dir.

_center_truncate_population(population, cell_figure_count)

Module Contents

COMP_MAP
pretty_name(name)

Make a pretty name.

add_progress_bar(items, template, description)

Add a progress bar in notebooks.

progress_bar_label(template, description, notebook)

Format progress bar label.

dump2json(data_dir, var_name, data)

Save the dictionary ‘data’ into a .json file.

Parameters:
  • data_dir – the data directory

  • var_name – the name of the dictionary as a string

  • data – the data dictionary

load_json(fname)

Load a json file from file with fname into the results dictionary.

Returns:

The results dictionary

find_cells(dir_name)

Return the cells in dir_name.

Parameters:

dir_name (str) – path to the directory containing the cells

Returns:

The list of cell files

pyplot_non_interactive()

Suppress pyplot showing blank graphs when in interactive mode.

This usually happens in the context of jupyter notebooks

get_agg_fig()

Yield a figure and close it afterwards.

center_population(population)

Return a new population where all cells have been translated to their soma origins.

truncate_population(population, count)

Return a new population with count elements.

get_components_population(population, component)

Get component of a given population.

compute_bounding_box(*populations)

Get bounding box of a population.

plot_population(output_dir, population, xlim, ylim, notebook_desc=None)

Plot a population.

plot_normalized_neurons(output_dir, ref_population, test_population, cell_figure_count, components, notebook_desc=None)

Plot cell examples and store the file in output_dir.

Parameters:
  • output_dir (str) – path to the output directory

  • ref_population (NeuroM morph population) – reference population

  • test_population (NeuroM morph population) – test population

  • cell_figure_count (int) – number of exemplars to plot

  • components (list of str) – components to visualize

  • notebook_desc (str) – string used for labelling notebook progress bar

_center_truncate_population(population, cell_figure_count)