Commit c0f3180
Extend
* Initial plan
* feat: extend absoluteToRelativeEvents with name-value modes and trial inference
Co-authored-by: Nabarb <23075957+Nabarb@users.noreply.github.com>
* chore: address code review feedback for absoluteToRelativeEvents
Co-authored-by: Nabarb <23075957+Nabarb@users.noreply.github.com>
* feat: make absoluteToRelativeEvents accept name-value args and robustly handle trial bounds
Replace inputParser with a name-value arguments interface for absoluteToRelativeEvents, add an input validator for trialStartReference, and expose inferTrialFromBounds as a named option. Improve robustness when pairing trial start/end timestamps by trimming unmatched leading ends or trailing starts and only keeping properly ordered start/end pairs. Minor tidy-ups to variable formatting.
* feat: standardize event structure and improve event handling logic
Update the Events_ struct to use PascalCase fields (Name, Trial, Data) and refine the absoluteToRelativeEvents utility with trial skipping and improved trial inference. Ensure addEvents remaps trial IDs to a consecutive range and update PCA/GPFA to correctly calculate explained variance during projection.
* feat: add cumulative arclength and update trial indexing in NeuralEmbedding
Update the arclength utility to return cumulative segment distances. Refine trial selection logic in NeuralEmbedding to use direct indices for event lookup, ensure tMask is consistently stored as a column vector, and increase event marker visibility in visualizations.
* feat: add plotEventDensity to visualize event distribution along arclength
Adds a method to compute and plot the density of events relative to the normalized arclength of neural trajectories. The method uses weighted kernel density estimation to account for non-uniform arclength velocity and provides multi-event visualization using the gramm library.
* feat: optimize plotEventDensity performance and robustness
Refactors the density calculation to process trials in a single pass and replaces expensive distance calculations with vectorized interpolation. Improves robustness by adding checks for finite arclengths and minimum data points for kernel density estimation.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Nabarb <23075957+Nabarb@users.noreply.github.com>
Co-authored-by: fbarban <federico.barban@unige.it>
Co-authored-by: Fede <fedbarban+github@gmail.com>absoluteToRelativeEvents with robust event filtering, trial inference, and flexible trial-start reference modes (#3)1 parent 557bfc6 commit c0f3180
5 files changed
Lines changed: 419 additions & 44 deletions
File tree
- +embedding
- +metrics/+compute
- @NeuralEmbedding
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | | - | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
0 commit comments