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

Methods to stitch a position grid #137

Merged
merged 41 commits into from
Jul 22, 2024
Merged

Methods to stitch a position grid #137

merged 41 commits into from
Jul 22, 2024

Conversation

ieivanov
Copy link
Collaborator

@ieivanov ieivanov commented Apr 29, 2024

She is ready!

This PR adds methods to stitch a grid of positions. Stitch parameters are computed with >>> mantis estimate-stitch. Images are then stitched with >>> mantis stitch. Image registration parameters are computed on pairs of images using phase cross-correlation; the pipeline can be extended to include more complex transformations. The image mosaic is compiled using "average" blending; other blending modes may be implemented later.

See examples in /hpc/projects/intracellular_dashboard/ops/2024_03_05_registration_test/live/3-stitch/ and /hpc/projects/intracellular_dashboard/ops/2024_04_11_Manual_HELA/1-stitch/v3/

Replaces #135
See #135 (comment)

TODO:

  • Convert compute_image_translation to CLI and save in config file
  • Test with non-square image and non-square grids

@ieivanov ieivanov changed the title Stitch images v2 Methods to stitch a position grid Jul 1, 2024
@ieivanov ieivanov changed the base branch from stitch_images to main July 15, 2024 21:36
@ieivanov ieivanov marked this pull request as ready for review July 18, 2024 20:35
Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

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

Big job! Looks great. I like the slurm job dependencies.

I'm in the middle of recreating your 2024_03_05_registration_test/live/3-stitch/ (~20% through the final step filling the last store) and everything's going smoothly.

Here are the small snags I've run into:

  • --slurm parameter tripped me up on the stitch call. Seems required, so I suggest dropping it for now?
  • the default --temp-dir wasn't writeable for me. Default to ./?
  • When I open the stitched zarr in napari I get GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled., and the viewable resolution is noticeably worse than the originals. Do we need pyramids? Another trick? I don't think this needs to block this merge, though.

mantis/cli/stitch.py Outdated Show resolved Hide resolved
mantis/cli/stitch.py Outdated Show resolved Hide resolved
mantis/cli/stitch.py Outdated Show resolved Hide resolved
mantis/cli/stitch.py Outdated Show resolved Hide resolved
@ieivanov
Copy link
Collaborator Author

Thanks for your review @talonchandler! I implemented your suggestions for --temp-path and --slurm options. Let's merge this and we'll fix other issues through smaller PRs.

When I open the stitched zarr in napari I get GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled., and the viewable resolution is noticeably worse than the originals. Do we need pyramids? Another trick? I don't think this needs to block this merge, though.

That's true - so far this only happens for our largest (OPS) datasets and it hasn't bothered me much. It'll be nice to have a proper fix, which I think is implementing pyramids. This is not a blocker for now - analysis still happens on a FOV basis and detailed inspection can be done on smaller ROIs by loading a selection of the data through python.

@talonchandler
Copy link
Contributor

LGTM! Thanks @ieivanov.

@ieivanov ieivanov merged commit ed2ba41 into main Jul 22, 2024
2 checks passed
@ieivanov ieivanov deleted the stitch_images_v2 branch July 22, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants