morphoclass.transforms.node_features.extract_vertical_distances module¶
Implementation of the vertical distance node feature extractor.
-
class
morphoclass.transforms.node_features.extract_vertical_distances.ExtractVerticalDistances(vertical_axis='y', negative_ipcs=False, negative_bpcs=False)¶ Bases:
morphoclass.transforms.node_features.extract_distances.ExtractDistancesExtract vertical 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 vertical distance of all node points of the morphology are extracted and added to the feature vector.
The vertical distance of a given node is the distance to the root point of the tree that is measured by following the graph edges, and projecting onto a given axis. The default axis is ‘y’.
- Parameters
vertical_axis (str) – Axis along which the neuron is assumed to be oriented vertically. See documentation of the ExtractDistances base class for more details.
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