trackmate-sc / TrackMate

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

Loading saved XML file from trackmate cannot recreate the same tracking as the #230

Closed pipecedeno closed 2 years ago

pipecedeno commented 2 years ago

Hello,

Currently I'm doing the tracking of some multicellular yeasts growing, and I'm using a trained model of cellpose as the detector for trackmate, and then for the tracking I use the LAP tracker that is integrated in trackmate, and the first time I use the model everything goes smooth and works perfectly, but if I saved the progress to an XML file using the save bottom of the trackmate window, next time I try to open the XML file to continue from where I left, the video and the progress I did isn't the same anymore as the ROIs that are drawn and the tracking doesn't work anymore.

I'm using Ubuntu 20.04.5 LTS, I don't know how to find the version of imagej2 that I'm using but is the newest one.

Sometimes while loading in the console the following appears:

javax.swing.text.BadLocationException: Invalid remove
    at javax.swing.text.AbstractDocument.handleRemove(AbstractDocument.java:605)
    at javax.swing.text.AbstractDocument.remove(AbstractDocument.java:590)
    at fiji.plugin.trackmate.gui.components.LogPanel$LogPanelLogger$1.run(LogPanel.java:166)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

The XML file that was saved (just changed the termination of the file to txt as github doesn't allow me to upload a xml file): rep5_26aug2022_2_cropped.txt

This is the gif of what I did before saving the xml file: rep5_26aug2022_2_cropped_recording

And this is the gif of what appears after loading the xml file (removed the last frames because it was larger than 10mb): rep5_26aug2022_2_cropped_recording_after_loading_cut

Looking for information in google I found this webpage (https://forum.image.sc/t/trackmate-error-when-loading-a-saved-xml-linked-to-zvi/4683) which says I should use a TIF file for it to work, but this error appears while using the tif file, so something else must be the problem and I couldn't find further assistance in any other webpage.

Hope this information can help you understand the problem and help in advanced, And also thanks in advance for your time and assistance, Luis.

pipecedeno commented 2 years ago

Hello,

I did more testing to see what is failing, and I noticed that the display of the spots is what is failing, as I tried changing all the settings so that it doesn't display the detected spots as ROIs, or that it do not even display the spots, but after loading the XML file the spots that should display are no longer working, so the error must be on the spots that are being detected by cellpose and later are not saved correctly or loaded correctly.

Hope this has helped to make the problem easier to solve, Luis Felipe.

pipecedeno commented 2 years ago

Hello,

Today I finally solved the issue. The problem was that each time I opened trackmate I got prompted this message: Screenshot from 2022-09-01 11-39-20 And I just pressed YES and trackmate worked without problem, but because I never saved that option to the original file once I tried to reload the the saved XML the Z and T wouldn't be swapped so that's why the overlay wasn't working.

How to fix it: Open your file, go to Image > Properties, and the following window will appear: Screenshot from 2022-09-01 11-33-06 So you just need to swap the values of Z and T Screenshot from 2022-09-01 11-33-14 and then save the file.

And if it worked the problem error message won't appear while opening trackmate.