sleap
sleap copied to clipboard
Node trails don't update during proofreading
When proofreading a .slp file, I'll often update the position of the subject's nose, which has a higher error rate than other nodes. I also leave the Trail Length at 10 to catch mislabelled nodes wile scrubbing through the video.
However, the Trail doesn't update when the node position is corrected. A fix for this would be for the plotted Trail to reflect changes in the proofread data (which is already reflected in the exported h5 files).
Thanks!
Relevant Code
-
Method to load overlays inside
MainWindow
class. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L1139-L1179 -
Methods to plot trails inside
TrackTrailOverlay
class. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/overlays/tracks.py#L122-L170 -
Method where
TrackTrailOverlay.add_to_scene
is called https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L1331-L1355 -
Method where
MainWindow._after_plot_update
is called. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L292-L315
This issue has been resolved in the new release - install SLEAP v1.2.7 here.
Hi Liezl @roomrys,
Thanks so much for pushing a fix for this. I'm seeing some strange behavior in 1.2.7, figured I'd let you know.
https://user-images.githubusercontent.com/69451171/189764685-6ef413a0-c090-447f-ab15-19254f1c0bfb.mp4
It looks like while the trails are being updated with the new information, the old nodes aren't being deleted. This seems to result in a 'zig-zag' pattern where the trail vector is based on alternating inferred/corrected nodes. I think the old nodes are therefore not being deleted, and a trail-length of 10 shows 5 corrected nodes and 5 inferred nodes.
Hope this video helps describe the behavior.
Best, Stefan
Oof, thanks for the heads up Stefan @olinesn. The problem seems to be that we do not prefer user instances in the TrackTrailOverlay.get_track_trails
and instead assume that there is only one instance per track in the frame. This leads to plotting the predicted point instead of the user instance in the trails.
Instead of looping through (L64 below)
for inst in frame:
We should instead loop through a list of instances (one instance per track) that prefers the user instances.
Relevant Code
TrackTrailOverlay.get_track_trails
to get the data needed to draw the track trail
https://github.com/talmolab/sleap/blob/b2cd605a2a87c59ac91058b7065ce904a9402ad3/sleap/gui/overlays/tracks.py#L40-L85