Conversation
|
Got basic timeseries with linestack working. I've also got some code snippets for interpolating to display heatmap with non-uniformly sampled timeseries data. I should be able to have this fully working with time series very soon :D Kooha-2025-12-27-03-50-45.mp4 |
|
Got heatmap to display timeseries working. It should also work with non-uniformly sampled data by interpolating, need to test. Also need to implementing switching between heatmap and line representations, need to delete the graphic when switching. Kooha-2025-12-27-17-47-16.mp4 |
|
So timeseries can be represented with arrays of one of the following shapes (let's ignore x-axis values for now). If we have: l: number of timeseries We can have the following shapes: Extended to n-dimensional arrays (for example, trajectories projected onto principal components?). If each non-timeseries dim is I don't think we can auto-detect if
Scatters can be similar to some cases of nd-lines 🤔 , but x values would be directly specified and the current index is parametric (example with time indicating position in a low dim space). This would actually be true for lines as well if representing trajectories. So for nd-line maybe we have two versions, parametric (y and z are not functions of x, but x, y, z are a function of some other dim) and non-parametric (simple timeseries lines where y and z are functions of x). |
|
I made a more generalist
where: It can map arrays of these dims to a line, line collection, line stack, scatter, or list of scatters (similar to multi-line). I think this is a much more elegant way to deal with things, and Example if we have data that is I think we can also use this for heatmaps and interpolation. Use the reference units to determine a uniform x-range for the current display window, and we can interpolate using EDIT: I think that the |
|
For positions graphics, I should actually do |
|
Some more ideas: Allow any 2-3 dims to be used as the graphic dimensions and specify the slider dims. This would also allow using named dims (such as those used in xarray). We interpret the given order of the EDIT: A limitation of the above is that a user can't collapse multiple "graphic/display dimensions" into "final graphic/display dimensions" if they're hard-coded this like. So something like: An example for images would be collapsing |
|
We can use I was thinking of what's the best way to show a scatter for each keypoint, and I think I should make a |
|
ok I think stuff is working ndpositions-2026-01-29_22.55.54.mp4 |
|
I think I need to make a |
|
A set of imgui UIs that allow controlling some aspects of the "nd graphics" could be useful, such as:
|
Stuff I should finish before implementing the orchestrator:
Things that make me "uncomfortable" that I need to settle:dim shapesDim shape for nd-positions is
Do we just document this well, that the When using nd-positions data in conjunction with nd-image data, we'd have something like this: Where The |
|
Working on "implement mapping from a slider reference index with units (such as time) to array index.", which requires proper implementation of |
|
Window funcs working for ndp_windows-2026-02-01_03.39.52.mp4 |
* start separating iw plotting and array logic * some more basics down * comment * collapse into just having a window function, no frame_function * progress * placeholder for computing histogram * formatting * remove spaghetti * more progress * basics working :D * black * most of the basics work in iw * fix * progress * progress but still broken * flippin display dims works * camera scale must be positive for MIP rendering * a very difficult to encounter iterator bug! * patch iterator caveats * mostly worksgit status * add ArrayProtocol * rename * fixes * set camera orthogonal to xy plane when going from 3d -> 2d * naming, cleaning * cleanup, correct way to push and pop dims * quality of life improvements * new histogram lut tool * new hlut tool * imagewidget rgb toggle works * more progress * support rgb(a) image volumes * ImageGraphic cleanup * cleanup, docs * fix * updates * new per-data array properties work * black formatting * fixes and other things * typing tweaks * better iterator, fix bugs * fixes * show tooltips in right clck menu * ignore nans and inf for histogram * histogram of zeros * docstrings * fix imgui pixels * iw indices event handlers only get a tuple of the indices * bugfix * fix cmap setter * spatial_func better name * bugfix * hist specify quantile * fix typos (#991) * fix typos * add rendercanvas to intersphinx_mapping * nd-iw backup * correct ImageGraphic w.r.t. ndw * last fixes in ndi
|
I need to restore the current ImageWidget in main so we can deprecate and remove it in a future release. |
|
List of thoughts:
I think I can make the linear selector not respond to index changes when it the selector itself changes the index by using pause_graphics on the event handler that sets the linear selector index within the NDGraphic |
|
basic orchestration of ndgraphics works 😭 @Vipitis you do some point tracking work too right? ndwb-2026-02-17_01.35.14.mp4# start, stop, step range for time
reference_range = [(vid_indexing[0], vid_indexing[-1], 0.025, "time (s)")]
# Create an ND Widget with the reference dimensions
ndw = fpl.NDWidget(ref_ranges=reference_range, shape=(1, 2))
# add video as an nd image
ndw[0, 0].add_nd_image(
vid,
index_mappings=(vid_second_to_index,),
processor_kwargs={"compute_histogram": False, "rgb": True}
)
# add behavior data as an nd scatter
nd_scatter = ndw[0, 0].add_nd_scatter(
df_tracks, # tracks dataframe
keypoints_cols[:, :-1], # provide the columns to take the tracks data from in the form [(keypoint_n_x), (keypoint_n_y), ...],
likelihood_cols, # show likelihood as tooltips
processor=ndp_extras.NDPP_Pandas, # use the processor for pandas dataframes
display_window=5,
index_mappings=(tracks_second_to_index,) # time (s) -> array index mapping
) |
|
For NDPositions for other graphic features like colors, sizes, markers, cmap_transform, etc, maybe the way to do it is to just pass an additional array of the same shape as the data (i.e. s1,... sq, n, p, _) but with the corresponding feature values instead. And then we can use the same index and display window to get the values for those features at the given indices. Could also take a mapping function that takes the current indices and current data_slice array to create the feature values on the fly. |
|
I just noticed these weird glitches on my desktop on both my AMD and Nvidia GPU. Never noticed it before. I wonder if it's related to replacing the buffer when the number of datapoints changes but I'm not sure. The line turns red whenever the buffer has been replaced. One or more lines is rendered according to some previous positions data and not the current one. I checked the values in the actual @almarklein any guesses? EDIT: I posted on pygfx wtf-2026-02-17_22.58.23.mp4 |
|
linear selector stuff working 😄 linear_selector-2026-02-18_01.56.30.mp4@clewis7 very clever for suggesting I should just keep the same linear selector logic and set the dw-2026-02-18_02.35.51.mp4 |
|
I think github is broken, there's a merge conflict which I solved locally and then pushed. Those changes are in the branch (can see on github if I go to that branch), but it's not showing up on the commits list here. And when I try to resolve the conflicts here on the PR it keeps saying "this page is out of date" and I make the changes 🤦♂️ |
|
seems like github is working again, the commits have shown up in the PR 🤷 |
|
I just realized I think we can do subplot.frame.rect to get the number of pixels in x across the subplot and use that to figure out a good auto number of data points to display for OOC rendering and LOD of timeseries data. EDIT: this needs more thought, easy to compute if it's a single line across x but more compicated for real data lol |
|
We can have something like an index for even the l dim (number of lines, rows, scatters, etc) and p (n datapoints) dim, (context: last 3 dims are l x p x 2 | 3). When you plot contours on a movie and traces, that's l x p x 2. l is the same for both, it's number of components. We can use a selection vector to represent interaction with them. And if you have behavior, you can use another selection vector for keypoints. When you add an NDgraphic, you just specify which selection vector it's on. If looking at calcium and behavior you give the calcium arrays all the same component/neuron selection vector, and you give the behavior related arrays keypoint or whatever relevant selection vector that corresponds to the l dim This way we don't event have to write event code for even this interactivity, it gets even more declarative. Can also think of how to use the selector tools (rect and polygon) to auto-update the selection vectors. |
|
|
ok I need to do the following:
Better idea: Each Need to draw this out properly and take linear selectors into consideration as well. |
There was a problem hiding this comment.
@FlynnOConnell you do more imgui than any of us, can you please review this.

it begins 😄
implements #951