labsyspharm / ashlar

ASHLAR: Alignment by Simultaneous Harmonization of Layer/Adjacency Registration
https://labsyspharm.github.io/ashlar/
MIT License
118 stars 42 forks source link

Output tiling does not match input tiling #153

Open CristiSoitu opened 1 year ago

CristiSoitu commented 1 year ago

Hello,

I'll start by saying that this is a great, well-needed resource for the community. I'm posting these issues here, since it may be relevant for other people too. I have encountered 2 sorts of issues while using ashlar:

  1. I'm running it on several Z slices and I am using filepattern to specify tiling. All slices have the same tiling, acquired with the same microscope. For the command I'm using '{row:03}{col:03}' but also --flix-x --flip-y. For some slices it works great. However, for some of them (random ones almost) the output tiling is very different (2,1) rather than (3,3), which is also the input. Now, if for those slices that failed I'm using '{col:03}{row:03}' without any flipping, I get the right result. Any idea why?
  2. I'm running one slice with 7 imaging cycles. All cycles seem to be align perfectly, apart from cycle number 5, which is almost 2000 pixels off, regardless of whether I use the max shift option set to 50 or lower. The curious thing is that if I run it on just the first 5 cycles, all of them align and stitch well, including the one that failed previously. This happens for multiple slices, not just one.

Cristian

jmuhlich commented 1 year ago

We would have to see the image data to diagnose this sort of problem. Would you be willing to share it privately? You can reach out to the email address in my profile.

Be aware that stitching several Z slices of the same sample independently is going to introduce the same kind of error as stitching cycles independently. In our own lab we stitch datasets with Z stacks by stitching one slice and then applying the corrected tile positions to the other stacks. The Ashlar command line tool doesn't yet support saving the corrected positions after stitching or reusing them for later registration, but I could help write a small python script to achieve this if you are interested.