morphoclass.data.morphology_data module

Implementation of the MorphologyData class.

class morphoclass.data.morphology_data.MorphologyData(x=None, edge_index=None, edge_attr=None, y=None, pos=None, normal=None, face=None, **kwargs)

Bases: torch_geometric.data.data.Data

An object that hold morphological data and features.

It extends the Data class from torch-geometric to add additional features. In particular, the original Data class was meant to only hold graph data. We use it to also store persistence diagrams, persistence images, and other data.

classmethod load(path: StrPath)T

Load a serialised data object from disk.

save(path: Union[str, os.PathLike])None

Serialise the data object to disk.

to_dict()dict

Serialise to dictionary.

Since we don’t always store graph data, the num_nodes attribute cannot always be inferred. Therefore, we explicitly serialise it in order to recover it after de-serialisation.

Returns

The serialised morphology data.

Return type

dict