skeleton
sleap.qc.features.skeleton
¶
Skeleton graph analysis utilities.
Classes:
| Name | Description |
|---|---|
SkeletonAnalyzer |
Analyze skeleton topology to determine feature applicability. |
SkeletonAnalyzer
¶
Analyze skeleton topology to determine feature applicability.
This class extracts structural properties from a skeleton graph that determine which QC features are applicable (e.g., curvature requires chains of 5+ nodes, symmetry requires defined pairs).
Attributes:
| Name | Type | Description |
|---|---|---|
n_nodes |
Number of nodes in the skeleton. |
|
n_edges |
Number of edges. |
|
edges |
list[tuple[int, int]]
|
List of edge tuples (src, dst). |
node_names |
List of node names. |
|
symmetry_pairs |
list[tuple[int, int]]
|
List of symmetric node pairs as (left_idx, right_idx). |
spine |
list[tuple[int, int]]
|
Longest path through the skeleton (main chain). |
all_chains |
list[tuple[int, int]]
|
All simple chains of length >= 3. |
endpoints |
list[tuple[int, int]]
|
Node indices with degree 1. |
branch_points |
list[tuple[int, int]]
|
Node indices with degree > 2. |
max_chain_length |
list[tuple[int, int]]
|
Length of the longest chain. |
n_triplets |
list[tuple[int, int]]
|
Number of joint triplets (for angle features). |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize from a sleap-io Skeleton. |
get_adjacency |
Get adjacency list representation. |
get_curvature_chains |
Get chains suitable for curvature computation. |
Source code in sleap/qc/features/skeleton.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
has_symmetry
property
¶
Whether skeleton has symmetry pairs defined.
__init__(skeleton)
¶
Initialize from a sleap-io Skeleton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skeleton
|
'sio.Skeleton'
|
The skeleton to analyze. |
required |
Source code in sleap/qc/features/skeleton.py
get_adjacency()
¶
Get adjacency list representation.
Source code in sleap/qc/features/skeleton.py
get_curvature_chains(min_length=3)
¶
Get chains suitable for curvature computation.
Returns:
| Type | Description |
|---|---|
list[list[int]]
|
List of chains sorted by length (longest first). |