main.py
LinearizationParameters
¶
Bases: SpyglassMixin
, Lookup
Choose whether to use an HMM to linearize position. This can help when the eucledian distances between separate arms are too close and the previous position has some information about which arm the animal is on.
Source code in src/spyglass/linearization/v1/main.py
TrackGraph
¶
Bases: SpyglassMixin
, Manual
Graph representation of track representing the spatial environment. Used for linearizing position.
Source code in src/spyglass/linearization/v1/main.py
get_networkx_track_graph(track_graph_parameters=None)
¶
Get the track graph as a networkx graph.
Source code in src/spyglass/linearization/v1/main.py
plot_track_graph(ax=None, draw_edge_labels=False, **kwds)
¶
Plot the track graph in 2D position space.
Source code in src/spyglass/linearization/v1/main.py
plot_track_graph_as_1D(ax=None, axis='x', other_axis_start=0.0, draw_edge_labels=False, node_size=300, node_color='#1f77b4')
¶
Plot the track graph in 1D to see how the linearization is set up.
Source code in src/spyglass/linearization/v1/main.py
LinearizedPositionV1
¶
Bases: SpyglassMixin
, Computed
Linearized position for a given interval
Source code in src/spyglass/linearization/v1/main.py
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 195 196 197 198 199 200 201 202 203 |
|
make(key)
¶
Populate LinearizedPositionV1 table with the linearized position.
The linearized position is computed from the position data in the PositionOutput table. Parameters for linearization are specified in LinearizationParameters and the track graph is specified in TrackGraph. The linearization function is defined by the track_linearization package. The resulting linearized position is stored in an AnalysisNwbfile and added as an entry in the LinearizedPositionV1 and LinearizedPositionOutput (Merge) tables.
Source code in src/spyglass/linearization/v1/main.py
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 195 196 197 198 199 |
|