trackmate-sc / TrackMate

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

Track display reset after action #219

Open kapoorlab opened 2 years ago

kapoorlab commented 2 years ago

Hello, I have a trackmate action that corrects the tracks and sets the new graph on the model which does get updated in the trackscheme but the display setting of drawing the track overlay on the hyperstack throws this error:

Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445) at java.util.HashMap$ValueIterator.next(HashMap.java:1474) at fiji.plugin.trackmate.TrackModel.nTracks(TrackModel.java:617) at fiji.plugin.trackmate.visualization.hyperstack.TrackOverlay.drawOverlay(TrackOverlay.java:103)

In my model.update() function I do ask it to clear the tracks and notify the listener with this code snippet:

`model.beginUpdate();

//Some calls

model.clearTracks(true);

model.setTracks(graph, true);

logger.log( "New tracks: " + model.getTrackModel().nTracks(false));

model.endUpdate();`

Any idea on how to avoid this exception?

kapoorlab commented 2 years ago

This only occurs to me if I have track display on while running the extension. If I turn the track display off then I am able to avoid this error.

kapoorlab commented 2 years ago

The issue is not gone, I have uploaded the Copenhagen challenge dataset that includes the oneat detections in a csv file titled CleanDetections, if you use that with the TrackMate-oneat action it will throw the concurrent modification error as above, that disallows me to select a spot in the hyperstack displayer by not making it turn green. https://zenodo.org/record/6569672#.YoknIXZBxEY