yfukai / m2stitch

MIST-inspired microscope image stitching package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertationError: there is no good top pair

njbradley opened this issue · comments

Hello! I have been trying to use this library to stitch together some microscope images, but I am running into this error. I am not really sure what this error means, is it a problem with my images? What is the next step in troubleshooting this?

In addition, I found the behavior of this error to be somewhat confusing, I was able to run the example script fine, but when I used a 2 by 2 subset of the example images, I got this error. Is it normal that smaller grids will get this error?

Thanks for your time, any help is appreciated! Let me know if seeing my code would be helpful, but right now I am just trying to understand what causes this error.

Hi, @njbradley thanks for your question! The error is raised here, meaning that there are no "matching" tile pairs at the initial guess in the direction of the last dimension. Here, "matching" means there is at least one candidate for the overlap region for which the intensity in the region looks correlated (more precisely, the quantity called normalized cross-correlation must be larger than 0.5.). Now, this threshold is fixed (though it'll be great if we can adjust it) and I'm afraid the only workaround is increasing the tile number to make sure you have at least one "good" overlapping region (now you only have two candidates of the pairs for 2x2 tiles).
I hope this comment helps! Now I cannot take time for improvement but any PRs are welcome, needless to say.

Thanks for responding, that really helps! I actually went in and changed the threshold manually and it worked! I'll try to make a PR that allows you to adjust it, was there any specific way you wanted it to be implemented? I would probably just add it as another parameter for stitch_images.