-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected "tail" from previous time frame showing in points layer in multi-animal datasets #446
Comments
FYI These warnings that were thrown to the terminal are because the data being loaded in contains >>> self._extent_data
array([[ 0., nan, nan],
[8999., nan, nan]]) From what I can tell trawling the |
I also did some playing around today whilst looking at #433, and noticed the below which might be relevant here: The Pre-loading a video might be "fixing" the issue because loading a video is updating the range (in the frames dimension) of the import napari
import napari.layers
import numpy as np
viewer = napari.Viewer(ndisplay=2)
# A point at the origin in all 9000 frames.
# SLEAP_two-mice_octagon.analysis.h5 has 9000 frames, for reference
points = np.zeros((9000, 3))
points[:, 0] = np.arange(9000)
pl = napari.layers.Points(points)
viewer.add_layer(pl)
dock_widget, plugin_widget = viewer.window.add_plugin_dock_widget("movement")
napari.run()
# Now loading the SLEAP_two-mice_octagon.analysis.h5 dataset via the widget works,
# and there is no "double-plotting" bug. And you can slide to the end of the dataset (frame 8999). So I think the place to start is to try and figure out why the "load data" button in the widget is not emitting the appropriate signal to the |
Further to the above, manually setting the Place a breakpoint at line 151 of
|
Thanks @willGraham01 for this excellent piece of deep investigative debugging. I sincerely appreciate it. This gives us a concrete thread to pick up. |
Steps:
1-
napari -w movement
2- Load the sample data file
SLEAP_two-mice_octagon.analysis.h5
3- The frame slider is at frame 256, but I can see keypoints for both frame 255 and frame 256. Notice there are more keypoints per individual than expected (the corresponding
movement
dataset says 7 keypoints)I also get this error message:

The issue is sometimes fixed when loading the video. It is so far always fixed if I load the video and then flick back and forth a few frames.
Note that in the screenshots above, the total number of frames does not correspond to the video length - seems like an issue with the order of the axes when the video is not loaded?
Originally posted by @sfmig in #393 (comment)
As far as I can tell, this only happens with SLEAP multi-animal datasets. Interestingly, it happens with the "mixed-labels" version of the Aeon dataset, but not with the "proofread" one. I wonder whether this is somehow related to mixed identities/tracks in SLEAP files. Intriguingly, whether we are using the analysis.h5 or the .slp file doesn't matter.
Originally posted by @niksirbi in #393 (comment)
To me it happens with all the multi-animal datasets, not only SLEAP ones (the Sherlock bboxes dataset - which is not in GIN but can share- , and the DLC two mice dataset). I think maybe that is a stronger hint.
Another hint is that the frame slider end is set to 512 in all cases - seems like a default? It makes me think napari is interpreting the axes wrong... Just to be extra clear I am not loading any videos, just data.
Originally posted by @sfmig in #393 (comment)
Yay, you make a strong case. If it's all multi-animal datasets, and the problem is solved by pre-loading a video first, it is indeed highly likely that napari does something funky with the axes there. I guess if the video is added first and the points later, napari aligns the axes of the points layer to the image layer? Do you know if pre-loading the image only (still frame) also solves this or do we always need the video?
Originally posted by @niksirbi in #393 (comment)
I just tried with the two mice octagon data - the problem still exists if you load a still frame. The number of frames in the slider does not match the number of frames in the data.
Originally posted by @sfmig in #393 (comment)
The text was updated successfully, but these errors were encountered: