sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Node trails don't update during proofreading

Open olinesn opened this issue 2 years ago • 4 comments

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!

image (9)

olinesn avatar Aug 08 '22 19:08 olinesn

Relevant Code

  1. Method to load overlays inside MainWindow class. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L1139-L1179

  2. Methods to plot trails inside TrackTrailOverlay class. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/overlays/tracks.py#L122-L170

  3. Method where TrackTrailOverlay.add_to_scene is called https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L1331-L1355

  4. Method where MainWindow._after_plot_update is called. https://github.com/talmolab/sleap/blob/2efae3d96e7c843a52b855c37be96fea9c6e2725/sleap/gui/app.py#L292-L315

roomrys avatar Aug 12 '22 00:08 roomrys

This issue has been resolved in the new release - install SLEAP v1.2.7 here.

roomrys avatar Sep 12 '22 20:09 roomrys

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

olinesn avatar Sep 12 '22 21:09 olinesn

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

roomrys avatar Sep 12 '22 23:09 roomrys