pysnt.converters.extractors module#

Graph vertex and edge attribute extraction functionality.

This module handles extraction of attributes from graph vertices and edges, including: - Base extractor classes (VertexExtractor, EdgeExtractor) - Concrete extractor implementations for different data types - Extractor registries for automatic type detection - Type detection functions for vertices and edges - Color attribute extraction utilities

Dependencies: core.py

class VertexExtractor[source]#

Bases: object

Base class for vertex attribute extraction.

extract_attributes(vertex: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from a vertex object.

get_default_attributes() List[str][source]#

Get default attributes to extract for this vertex type.

get_display_position(vertex: Any) tuple | None[source]#

Get (x, y) position for display, or None if not available.

class EdgeExtractor[source]#

Bases: object

Base class for edge attribute extraction.

extract_attributes(edge: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from an edge object.

get_default_attributes() List[str][source]#

Get default attributes to extract for this edge type.

class SWCPointExtractor[source]#

Bases: VertexExtractor

Extractor for SWCPoint vertices.

extract_attributes(vertex: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from SWCPoint vertex.

get_default_attributes() List[str][source]#

Default SWCPoint attributes.

get_display_position(vertex: Any) tuple | None[source]#

Get (x, y, z) position from SWCPoint.

class BrainAnnotationExtractor[source]#

Bases: VertexExtractor

Extractor for BrainAnnotation vertices.

extract_attributes(vertex: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from BrainAnnotation vertex.

get_default_attributes() List[str][source]#

Default BrainAnnotation attributes.

class SWCWeightedEdgeExtractor[source]#

Bases: EdgeExtractor

Extractor for SWCWeightedEdge edges.

extract_attributes(edge: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from SWCWeightedEdge.

get_default_attributes() List[str][source]#

Default SWCWeightedEdge attributes.

class AnnotationWeightedEdgeExtractor[source]#

Bases: EdgeExtractor

Extractor for AnnotationWeightedEdge edges.

extract_attributes(edge: Any, requested_attrs: List[str]) Dict[str, Any][source]#

Extract attributes from AnnotationWeightedEdge.

get_default_attributes() List[str][source]#

Default AnnotationWeightedEdge attributes.