morphoclass.transforms.node_features.extract_radial_distances module

Implementation of the radial distance node feature extractor.

class morphoclass.transforms.node_features.extract_radial_distances.ExtractRadialDistances(negative_ipcs=False, negative_bpcs=False)

Bases: morphoclass.transforms.node_features.extract_distances.ExtractDistances

Extract radial distance features from apical trees.

The data should contain the field tmd_neuron, see the ExtractTMDNeuron class.

For each apical tree in the neuron the radial distance of all node points of the morphology are extracted and added to the feature vector.

The radial distance of a given node is the distance to the root point of the tree that is measured by drawing a straight line.

Parameters
  • negative_ipcs (bool) – Invert sign for features of IPCs. ee documentation of the ExtractDistances base class for more details.

  • negative_bpcs (bool) – Invert sign for features of lower apical trees of BPCs. ee documentation of the ExtractDistances base class for more details.

get_distances(apical)

Extract the node distance feature from an apical tree.

This is an implementation of the base class’s abstract method.

Parameters

apical (tmd.Tree.Tree) – An apical tree.

Returns

A torch tensor of shape (n_nodes,) and of dtype float32 with the extracted node distance features.

Return type

torch.tensor