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

XY and Z drift stabilization; replaces #108 #128

Merged
merged 142 commits into from
Jul 2, 2024
Merged

Conversation

ieivanov
Copy link
Collaborator

@ieivanov ieivanov commented Jan 23, 2024

TODO (01/19/24):

  • Merge main after registration_v2
  • Move functions between /mantis/cli/stabilization and /mantis/analysis/stabilize
  • fix tests @edyoshikun
  • Test the stabilization calculations @ieivanov , use verbose mode
  • Update slurmkit call for CLI @edyoshikun
  • estimate_xy_stabilization should use the z indices calculated by estimate_z_stabilization @ieivanov
  • estimate_stabilization should use channel_name rather than channel_index, like estimate_affine. Is there ever a case where we'd want to use different channels for focus finding and xy stabilization? In not, the config can have just "channel_name" rather than focus_finding_channel_index @ieivanov
  • Can we try to reduce the number of CLI input parameters of estimate_stabilization? Should we collect them using input or is it useful for this function to be non-interactive? - These should be CLI options
  • Can we reuse process_single_position and apply_function_to_zyx_and_save in apply_stabilization?
  • remove analysis/stabilize.py if not used
  • Optional: can we estimate the XY stabilization in parallel across timepoints? See discussion here: Parallel image registration glichtner/pystackreg#14. Can we supply the algorithm with pairs of (t_{n}, t_{n+1}) images? Does this computation take a lot of time and is it worth parallelizing? - limiting step is z stabilization, no need to parallelize for now
  • Add optional argument to estimate_stabilization to specify which position name is used for xy stabilization @ieivanov

This PR has the code for:

  • Calculating the z-drift and returning a z-translation matrix for timelapses estimate_stabilization_affine()
  • Calculating the xy-translation and returning a xy-translation matrices for timelapses stabilize_timalpse()
  • CLI call for running the stabilization
  • Save the translation matrices for XY and Z drift as yml
  • add tests

For the XY stabilization, you can use:
/hpc/projects/comp.micro/mantis/2023_09_22_A549_0.52NA_illum/3-registration/A549_MitoViewGreen_LysoTracker_W3_FOV5_1_phase.zarr

For Z drift, any of the timelapses:
/hpc/projects/comp.micro/mantis/2023_11_01_OpenCell_infection/4-registration/timelapse_7/timelapse_7_phase_registered.zarr

@ieivanov ieivanov mentioned this pull request Jul 1, 2024
11 tasks
@ieivanov
Copy link
Collaborator Author

ieivanov commented Jul 1, 2024

I am happy with this PR. The Z stabilization is well-tested. The XY stabilization is not used as much and not tested quite as well.

mantis/cli/utils.py Outdated Show resolved Hide resolved
mantis/cli/utils.py Outdated Show resolved Hide resolved
@ieivanov ieivanov merged commit 7c7f964 into main Jul 2, 2024
2 checks passed
@ieivanov ieivanov deleted the stabilization_yml_v2 branch July 2, 2024 20:37
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