position_trodes_position.py
TrodesPosParams
¶
Bases: SpyglassMixin
, Manual
Parameters for calculating the position (centroid, velocity, orientation)
Source code in src/spyglass/position/v1/position_trodes_position.py
default_pk: dict
property
¶
Return the default primary key for this table.
default_params: dict
property
¶
Return the default parameters for this table.
insert_default(**kwargs)
classmethod
¶
Insert default parameter set for position determination
Source code in src/spyglass/position/v1/position_trodes_position.py
get_default()
classmethod
¶
Return the default set of parameters for position calculation
Source code in src/spyglass/position/v1/position_trodes_position.py
get_accepted_params()
classmethod
¶
Return a list of accepted parameters for position calculation
TrodesPosSelection
¶
Bases: SpyglassMixin
, Manual
Table to pair an interval with position data and position determination parameters
Source code in src/spyglass/position/v1/position_trodes_position.py
insert_with_default(key, skip_duplicates=False, edit_defaults={}, edit_name=None)
classmethod
¶
Insert key with default parameters.
To change defaults, supply a dict as edit_defaults with a name for the new paramset as edit_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
dict
|
Restriction uniquely identifying entr(y/ies) in RawPosition. |
required |
skip_duplicates |
bool
|
Skip duplicate entries. |
False
|
edit_defaults |
dict
|
Dictionary of overrides to default parameters. |
{}
|
edit_name |
str
|
If edit_defauts is passed, the name of the new entry |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
Key does not identify any entries in RawPosition. |
Source code in src/spyglass/position/v1/position_trodes_position.py
TrodesPosV1
¶
Bases: SpyglassMixin
, Computed
Table to calculate the position based on Trodes tracking
Source code in src/spyglass/position/v1/position_trodes_position.py
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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
make(key)
¶
Populate the table with position data.
- Fetch the raw position data and parameters from the RawPosition table and TrodesPosParams table, respectively.
- Inherit methods from IntervalPositionInfo to calculate the position and generate position components (position, orientation, velocity).
- Generate AnalysisNwbfile and insert the key into the table.
- Insert the key into the PositionOutput Merge table.
Source code in src/spyglass/position/v1/position_trodes_position.py
generate_pos_components(*args, **kwargs)
staticmethod
¶
Generate position components from 2D spatial series.
calculate_position_info(*args, **kwargs)
staticmethod
¶
Calculate position info from 2D spatial series.
fetch1_dataframe(add_frame_ind=True)
¶
Fetch the position data as a pandas DataFrame.
Source code in src/spyglass/position/v1/position_trodes_position.py
TrodesPosVideo
¶
Bases: SpyglassMixin
, Computed
Creates a video of the computed head position and orientation as well as the original LED positions overlaid on the video of the animal.
Use for debugging the effect of position extraction parameters.
Source code in src/spyglass/position/v1/position_trodes_position.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|
make(key)
¶
Generate a video with overlaid position data.
Fetches... - Raw position data from the RawPosition table - Position data from the TrodesPosV1 table - Video data from the VideoFile table Generates a video using opencv and the VideoMaker class.
Source code in src/spyglass/position/v1/position_trodes_position.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|