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

PSF measurement, simulation, and deconvolution #130

Merged
merged 61 commits into from
Aug 13, 2024
Merged

PSF measurement, simulation, and deconvolution #130

merged 61 commits into from
Aug 13, 2024

Conversation

talonchandler
Copy link
Contributor

@talonchandler talonchandler commented Feb 3, 2024

  • paired with this confluence page and this confluence page
  • 2024-05-07 - now includes draft CLI calls psf-from-beads which estimates an averaged PSF from a bead volume, and deconvolve which uses the estimated PSF to deconvolve

TODO:

  • update pre-commit

@ieivanov ieivanov marked this pull request as ready for review August 1, 2024 22:18
@ieivanov
Copy link
Collaborator

ieivanov commented Aug 1, 2024

@talonchandler would you like to keep scripts/fit_psf_to_beads.py, scripts/simple_psf.py, and scripts/simulate_psf.py? They may need to have their deskew updated. These scripts call on deskew/_deskew_matrix which I think now is deprecated. Or is deskew/_get_transform_matrix the deprecated one? deskew_data uses

    matrix = _get_transform_matrix(
        raw_data.shape, ls_angle_deg, px_to_scan_ratio, keep_overhang
    )

but I think that may be a bug? I'd like to remove one of _deskew_matrix or _get_transform_matrix.

@ieivanov
Copy link
Collaborator

ieivanov commented Aug 1, 2024

P. S. If that's a bug in the deskew, let's fix it in a separate PR that we can merge right away

@ieivanov
Copy link
Collaborator

ieivanov commented Aug 2, 2024

P. S. If that's a bug in the deskew, let's fix it in a separate PR that we can merge right away

This is a bug in this branch only, I'll fix it

@talonchandler
Copy link
Contributor Author

I removed scripts/fit_psf_to_beads.py, scripts/simple_psf.py, and scripts/simulate_psf.py because I don't think we'll need them. I can resurrect them if that changes.

Those are the only places that _deskew_matrix is used, so I've deleted that function, too.

With those deletions we can focus our attention on the _get_transform_matrix, which was regressing from the main branch (the GPU deskew branch changed the affine transformation matrix). I added a test to catch this problem, then fixed the problem.

I spot-tested a deskew on real data, so I now think the deskew in this branch is ready (a minor refactor from main)

@ieivanov thanks for flagging this. I just took a look, and I think these deskew functions were the only places where accidental regressions happened.

@ieivanov
Copy link
Collaborator

ieivanov commented Aug 7, 2024

I'll test the refactored measure_psf today and then we can merge

@ieivanov ieivanov self-requested a review August 7, 2024 22:58
Copy link
Collaborator

@ieivanov ieivanov left a comment

Choose a reason for hiding this comment

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

I've tested measure_psf on mantis, I think this PR is ready to merge

@talonchandler
Copy link
Contributor Author

LGTM!

ieivanov and others added 2 commits August 12, 2024 18:32
@ieivanov ieivanov merged commit 00c9924 into main Aug 13, 2024
2 checks passed
@ieivanov ieivanov deleted the simulate-psf branch August 13, 2024 15:48
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