trackmate-sc / TrackMate-Cellpose

Tentative Cellpose integration in TrackMate.
GNU Affero General Public License v3.0
5 stars 3 forks source link

'Found 0 spots' #6

Closed simonecnascimento closed 1 year ago

simonecnascimento commented 1 year ago

It seems to always give me ‘Found 0 spots’ and Java error: java.lang.IllegalArgumentException: Stack argument out of range: 1 at ij.ImageStack.getProcessor(ImageStack.java:310) at net.imglib2.img.imageplus.ShortImagePlus.(ShortImagePlus.java:98) at net.imglib2.img.ImagePlusAdapter.wrapShort(ImagePlusAdapter.java:172) at net.imglib2.img.ImagePlusAdapter.wrapLocal(ImagePlusAdapter.java:102) at net.imglib2.img.ImagePlusAdapter.wrap(ImagePlusAdapter.java:74) at net.imglib2.img.ImagePlusAdapter.wrapImgPlus(ImagePlusAdapter.java:91) at fiji.plugin.trackmate.util.TMUtils.rawWraps(TMUtils.java:142) at fiji.plugin.trackmate.TrackMate.execDetection(TrackMate.java:356) at fiji.plugin.trackmate.detection.DetectionUtils$1.run(DetectionUtils.java:134)

I am using 16-bit image stack, red channel. Cells ranging from 50-100px.

Thank you!

tinevez commented 1 year ago

Hello @simonecnascimento This one is new to me. Would you care to share the image that produces the error, and the parameters?

simonecnascimento commented 1 year ago

Hi @tinevez,

This is a 2D tif stack (1999frames), 16-bit, recorded on the red channel. Cells are shown in white, elongated, not stained for nucleus.

test_cellpose test_cellpose_params

Thank you!

tinevez commented 1 year ago

Any change I could get the data itself? Or a small part of it?

simonecnascimento commented 1 year ago

Size is quite big and github does not support it. Could I email you instead?

tinevez commented 1 year ago

I have decent results with the following settings: Screenshot 2023-06-13 at 09 09 16

Screenshot 2023-06-13 at 09 15 05

It's far from perfect, but I think this is close to the best you can get given the image complexity and with the builtin models.

The reason you get 0 spots might be linked to 2 things:

tinevez commented 1 year ago

Any news @simonecnascimento ?

simonecnascimento commented 1 year ago

Hi @tinevez

Sorry for the delay in replying, I actually had to change my machine as it was incredibly slow and it was always freezing when I opened cellpose GUI.

Now I managed to train the cyto model, but the issue now is with cellpose integration with Trackmate:

[ERROR] Could not instantiate fiji.plugin.trackmate.cellpose.CellposeDetectorFactory org.scijava.InstantiableException: Class not found: fiji.plugin.trackmate.cellpose.CellposeDetectorFactory at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:285) at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:297) at fiji.plugin.trackmate.providers.AbstractProvider.registerModules(AbstractProvider.java:68) at fiji.plugin.trackmate.providers.AbstractProvider.(AbstractProvider.java:25) at fiji.plugin.trackmate.providers.DetectorProvider.(DetectorProvider.java:11) at fiji.plugin.trackmate.gui.TrackMateGUIController.createProviders(TrackMateGUIController.java:496) at fiji.plugin.trackmate.gui.TrackMateGUIController.(TrackMateGUIController.java:257) at fiji.plugin.trackmate.TrackMatePlugIn.run(TrackMatePlugIn.java:67) at ij.IJ.runUserPlugIn(IJ.java:229) at ij.IJ.runPlugIn(IJ.java:193) at ij.Executer.runCommand(Executer.java:137) at ij.Executer.run(Executer.java:66) at java.lang.Thread.run(Thread.java:662)

I added 'http://sites.imagej.net/TrackMate-Cellpose/' on the updates, but not sure why I am having this issue now. Other detectors seem to work fine.

Any idea why?

Thank you again!

tinevez commented 1 year ago

[ERROR] Could not instantiate fiji.plugin.trackmate.cellpose.CellposeDetectorFactory org.scijava.InstantiableException: Class not found: fiji.plugin.trackmate.cellpose.CellposeDetectorFactory at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:285)

Ok this is very weird. It basically states that it cannot find the class that corresponds to the cellpose extension you installed. But at the same time, since it appeared in the menu, you should have been able to get it.

Of course I cannot reproduce it on my side.

I suspect something odd with your Fiji installation. Could you try to download a fresh Fiji at https://fiji.sc, and do not install anything except the TrackMate-Cellpose extension?

simonecnascimento commented 1 year ago

It worked! Thanks a lot. I used Cyto 2.0 and gave me quite some spots, but not all. I will try to train a model with my own images to see if it can detect more spots.

Thank you very much again!