morphoclass.console.stats_plotter module¶
Default data preparation script shared across different datasets.
-
class
morphoclass.console.stats_plotter.
DatasetStatsPlotter
(dataset_csv_path: pathlib.Path, report_path: pathlib.Path, morph_name_column: str = 'morph_name', morph_path_column: str = 'morph_path', mtype_column: str = 'mtype')¶ Bases:
object
Plotter for morphology dataset statistics.
- Parameters
dataset_csv_path – The path for the morphology dataset CSV file.
report_path – The output path for the HTML report.
-
property
df_stats
¶ Get a data frame with dataset statistics.
The data frame contains the following columns:
path: the neuron morphology file path
layer: the m-type layer; e.g. the m-type L5_UPC corresponds to layer L5
{axon,apical,basal,neurites}-size: the node count in the respective neurite graph
{axon,apical,basal,neurites}-pd-size: the point count in the respective persistence diagram.
- Returns
pd.DataFrame
- Return type
The data frame with dataset statistics
-
static
load_neuron
(path: str) → tmd.Neuron.Neuron.Neuron¶ Load a TMD neuron given a file path.
-
make_data_count_plots
() → None¶ Make data count plots and save them to disk.
-
make_neuron_preview_plots
() → None¶ Make neuron preview plots and save them to disk.
For each m-type one sample is selected randomly and plotted. The plot contains two renders of the 3D morphology, one in the front view, and one in the side view, as well as a combined plot of a persistence diagram overlaid on top of a persistence image.
-
make_node_count_plots
(neurite: str) → None¶ Make neurite graph and PD count plots and save them to disk.
-
property
neurons
¶ Get a map from a neuron morphology file path to the loaded neuron.
-
run
() → None¶ Run all plotting routines and save all plots to disk.
-
save_report
(report_title: str = 'Dataset Plots') → None¶ Save the HTML report to disk.
-
savefig
(fig: matplotlib.figure.Figure, path: pathlib.Path) → pathlib.Path¶ Save a figure and return the input path.