Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternating block solve #160

Merged
merged 26 commits into from
Dec 18, 2023
Merged

Conversation

minnerbe
Copy link
Collaborator

Changes

I added a client that does a couple of rounds of the distributed block solver with alternating layouts to ensure that every tile is in the "interior" of a block at least once. More specifically, the algorithm looks like this:

  1. solve blocks with overlap
  2. instead of interpolating transforms on overlapping regions, choose transform randomly from all candidates
  3. save blocks to database with coherent naming scheme (_runN)
  4. change parameters:
    • change stack to pull data from to target stack of previous iteration
    • shift block layout by half a block (before expanding, i.e., by 1/4 of an expanded block)
  5. go to 1.

Test

I tested this on a small toy stack (1 mFOV):

  • For comparison: here is a stack that was solved globally
  • This stack was solved using a 3x3 block layout (2x2 for the shifted iterations) and 4 iterations of the above algorithm

Results

Using the error comparison tool, we see that the iterative solution only deviates from the exact one by more than 1.5 px for a handful of tile pairs, all of which contain more or less only resin. Otherwise, the iterative solve looks pretty good to me. In particular, the global coarse block solve has errors well below 1px after the first two runs.

Interestingly, the exact solve seems to have a very visible (and probably wrong) drift in the last few layers, which the iterative solve doesn't.

Copy link
Collaborator

@trautmane trautmane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I made some nice-to-have-but-not-essential comments ...

Copy link
Collaborator

@trautmane trautmane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nits (really :) with one logic change.

@minnerbe
Copy link
Collaborator Author

minnerbe commented Dec 6, 2023

Thanks for the review! I'll try to incorporate your suggestions later today, but if I don't get around to do it and it's time critical, feel free to edit the code yourself.

@minnerbe
Copy link
Collaborator Author

minnerbe commented Dec 9, 2023

Thanks for applying the changes yourself, @trautmane ! I was completely swamped the last days...

@trautmane trautmane merged commit 5834069 into newsolver Dec 18, 2023
1 check passed
@trautmane trautmane deleted the feature/alternating-block-solve branch December 18, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants