morphoclass.training.tns_utils module¶
Utilities for working with the NeuroTS package.
-
morphoclass.training.tns_utils.read_tns_parameters(parameters_file_path)¶ Read TNS parameters from file.
- Parameters
parameters_file_path (string or Path object) – path of the parameters file
- Returns
parameters – a dictionary containing TNS parameters per m-type
- Return type
dict
-
morphoclass.training.tns_utils.tns_distributions_from_dataset(dataset, ids=None, feature='path_distances', neurite_types=('basal', 'apical', 'axon'))¶ Extract TNS distributions from morphology dataset.
It is required that all samples in the dataset have the attribute “path”, which is used to extract the layer name
- Parameters
dataset (morphoclass.data.morphology_dataset.MorphologyDataset) – morphology dataset for which to compute the TNS distributions
ids (list, optional) – indices specifying a subset of the given dataset (e.g. the indices of the training set) if None then the whole dataset will be used.
feature (str) – feature for creation of TMD barcodes, see documentation of tns.extract_input.distributions
neurite_types (list_like) – neurite type for which to compute the distributions. Possible entries are ‘apical’, ‘basal’, ‘axon’.
- Returns
distributions – a dictionary containing extracted distribution parameters per m-type
- Return type
dict