trackmate-sc / TrackMate

TrackMate is your buddy for your everyday tracking.
https://imagej.net/plugins/trackmate
GNU General Public License v3.0
156 stars 74 forks source link

Selection of spot in Trackscheme not working everytime after clicking on the segmented spot in ImageViewer #240

Open Sagnik700 opened 1 year ago

Sagnik700 commented 1 year ago

I am running Trackmate on a dataset of live cells and it is combined dataset which contains raw phase-contrast miscroscopy data in one channel and its corresponding segmentaion in another channel appended along the time axis. The link to the dataset - Public Link

This issue is sporadic and does not occur everytime, but now after encountering it about in 50% of the times I am creating this issue. When I am clicking one spot from the TrackScheme window the corresponding spot at the time step in the Image Viewer is getting highlighted but the other way around is not working. Clicking on a cell/spot on the Image Viewer, the spot does not get highlighted in the Trackscheme window.

I am sharing the value of parameters I am using to reproduce the bug:-

  1. The Z and T axis should be swapped at the beginning as Trackmate will ask for the same in a prompt
  2. Lable image detector should be selected
  3. Segment in Channel should be 2 in the next window along with the selection of Simplify contours
  4. Quality value for intial thresholding in the next window should be max and then no other filter needs to be selected
  5. Lap tracker is selected with Frame to Frame linking max value - 90pixels; Track segment gap closing max value - 500pixels; Track segment splitting max value - 15pixels
  6. No filters needed to be selected for tracks
  7. In Display options in next window, the value of Show tracks backward in time should be selected in Display tracks dropdown with Fade tracks in time selected and Fade range as 30 time-points
  8. After clicking on TrackScheme now, the bug should be there. Clicking on a cell/spot on the Image Viewer, the spot will not get highlighted in the Trackscheme window.
tinevez commented 11 months ago

Hello @Sagnik700

I have been using TrackMate for a while since this issue was opened, and could not clearly reproduce it.

I was thinking however that this issue might be connected to how selection clicks are handled in the main window. I notice that you use the label detector in 2D, which means that you will generate a segmentation results in 2D. The results will be a closed polygon for a spot.

Ideally, you would want to select this spot for a mouse click inside the polygon, but right now this is not the case. The code that checks whether a click happens inside a spot simply checks whether the click happens within the spot's radius from the center.

So when selecting a spot, TrackMate still thinks it is a circle, and not a polygon. Even when the spot is displayed as a polygon. For me, this causes some confusion when I click inside elongated spots.

Maybe it is your case?

Sagnik700 commented 11 months ago

Hello @tinevez , I think this can be a possible reason because in my dataset I had many elongated segmentations and maybe when I was encountering the issue I was trying to select an elongated segmentation outside of its circular segmentation's radius. It also suffices the reason for it being sporadic, since maybe I was trying to select some circular segmentation and the selection stayed within the radius. I will be able to confirm you about this as soon as possible after I test it again. Thanks for the tip.