czbiohub-sf / shrimPy

shrimPy: Smart High-throughput Robust Imaging & Measurement in Python
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Methods to stitch a position grid #137

Closed ieivanov closed 2 months ago

ieivanov commented 5 months ago

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 https://github.com/czbiohub-sf/shrimPy/pull/135#issuecomment-2038005161

TODO:

ieivanov commented 2 months ago

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 commented 2 months ago

LGTM! Thanks @ieivanov.