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

Registration refator #118

Merged
merged 17 commits into from
Jan 16, 2024
Merged

Registration refator #118

merged 17 commits into from
Jan 16, 2024

Conversation

ieivanov
Copy link
Collaborator

@ieivanov ieivanov commented Jan 5, 2024

  • refactored channel parsing in apply_affine
  • more robust handling of paths with white spaces
  • more clear print statements

@ieivanov ieivanov mentioned this pull request Jan 10, 2024
12 tasks
@ieivanov ieivanov merged commit 6a5f435 into registration_v2 Jan 16, 2024
@ieivanov ieivanov deleted the registration_refator branch January 16, 2024 04:44
ieivanov added a commit that referenced this pull request Jan 19, 2024
* initial commit adding tools for cropping and registering with ants

* adding lir crop

* starting cleanup for registration

* converting nan to zero

* ants estimate affine

* adding config file for estimate_transform

* cleaning up some redundancies

* fix edge case of input not being float32

* channel is an int

* typo in napari add image for vs ants optimzer

* adding utils yaml

* separated the manual estimation from the optimizer

* added ants to numpy and viceversa

* adding input at the end to prevent from closing

* replacing the reading of .mat to matrix from yaml

* added changes to ants to numpy from Jordaos input

* cannot have recOrder as dependency given different pycromanager versions

* format

* add test for optimize_affine and update readme

* adding docstring

* removed the config dependency

* removing the focus_finding svg

* removing the estimate_affine.yml and making flags to choose channels and verbose

* added comment and code to use scipy.

* -ls and -lf to -s and -t

* document FOCUS_SLICE_ROI_WIDTH

* `estimate-source-to-target-affine` -> `estimate-affine`

* standardize `optimize-affine` arguments

* cleaner docs

* update RegistrationSettings

* fix tests

* remove duplicate

* write indices to output config

* read channels from file

* test fix

* echo improvments

* black

* style

* remove duplicate cli call

* more intuitive manual registration

* patch for deskewing

* testing slurmkit

* fix apply affine example

* matrix multiplication bugfix

* updating the lir_crop using new registration

* adding lir crop to the apply affine and modifying the manual estimation and the optimizer to output the input zyx shape to yaml

* convert nans to zeros

* adding test for affine

* removed main

* fix `apply_affine` docstring

* fixing formatting

* remove crop-output from cli args

* estimate affine cli docstrings

* reverting changes to AnalysisSettings model.

* optimize_affine cli docstrings

* Revert "reverting changes to AnalysisSettings model."

This reverts commit 0e2f8c4.

* fix points layer grid mode bug

* fix tests

* combining the croping and merging to the apply-affine

* removing unnecessary prints()

* add registration and stabilization modules

* style

* flake8

* Registration refator (#118)

* refactor apply_affine

* clean up

Co-authored-by: Eduardo Hirata-Miyasaki <eduardo.hirata@czbiohub.org>

* debug and add comments

* updating estimate_affine to match new yml

* don't start parallel pool for 1 iterable

* patch previous commit

* make sure the source_channel_used is first in the list for the optimizer

* make optimize_affine accept the new config parameters

* fix bug calling iohub info on paths with white spaces; rename target_channel_str

* better white space cli bug fix

* cleaner print statements

* don't use itertools.starmap

* clean up apply_affine print statements

* clean up optimize_affine

---------

Co-authored-by: Eduardo Hirata-Miyasaki <eduardo.hirata@czbiohub.org>
Co-authored-by: Eduardo Hirata-Miyasaki <edhiratam@gmail.com>

* removing the source n target shape zyx and testing keep overhang

* updating estimate affine with previous commit changes

* style

* Update example_apply_affine_settings.yml

* refactor registration and stabilization functions

* fixing pytests

* more intuitive function names

* minor refactor of estimane_affine

* bugfix

---------

Co-authored-by: Talon Chandler <talonchandler@gmail.com>
Co-authored-by: Ivan Ivanov <ivan.ivanov@czbiohub.org>
ieivanov added a commit that referenced this pull request Jul 2, 2024
* initial commit adding tools for cropping and registering with ants

* adding lir crop

* starting cleanup for registration

* converting nan to zero

* ants estimate affine

* adding config file for estimate_transform

* cleaning up some redundancies

* fix edge case of input not being float32

* channel is an int

* typo in napari add image for vs ants optimzer

* adding utils yaml

* separated the manual estimation from the optimizer

* added ants to numpy and viceversa

* adding input at the end to prevent from closing

* replacing the reading of .mat to matrix from yaml

* added changes to ants to numpy from Jordaos input

* cannot have recOrder as dependency given different pycromanager versions

* format

* add test for optimize_affine and update readme

* adding docstring

* removed the config dependency

* removing the focus_finding svg

* removing the estimate_affine.yml and making flags to choose channels and verbose

* added comment and code to use scipy.

* -ls and -lf to -s and -t

* document FOCUS_SLICE_ROI_WIDTH

* `estimate-source-to-target-affine` -> `estimate-affine`

* standardize `optimize-affine` arguments

* cleaner docs

* update RegistrationSettings

* fix tests

* remove duplicate

* write indices to output config

* read channels from file

* test fix

* echo improvments

* black

* stabilization draft

* slurm z drift correction

* pystackreg

* functions for estimating the z_drift and xy translation over time

* style

* remove duplicate cli call

* more intuitive manual registration

* stabilization cli

* patch for deskewing

* fixing CLI calls and docstrings

* addine more comments to doctring

* stabilize_timalapse cli typo

* stabilize_timalapse cli typo

* removing some args in doctring.

* testing slurmkit

* fix apply affine example

* matrix multiplication bugfix

* updating the lir_crop using new registration

* adding lir crop to the apply affine and modifying the manual estimation and the optimizer to output the input zyx shape to yaml

* convert nans to zeros

* updating the output saving scheme taking zarrs and saving the verbose in the parent directory.
adding slurmkit demo

* add affine test

* fixing z-shift error

* remove saving intermediate z-shifts

* save to yml

* prototype to change to v2

* fixing the xy drift calculation. refactoring placed xy order instead of yx

* adding option to fill the zeroes with previous value.

* adding tests

* adding one more test

* adding test for affine

* removed main

* fix `apply_affine` docstring

* fixing formatting

* remove crop-output from cli args

* estimate affine cli docstrings

* reverting changes to AnalysisSettings model.

* optimize_affine cli docstrings

* Revert "reverting changes to AnalysisSettings model."

This reverts commit 0e2f8c4.

* fix points layer grid mode bug

* fix tests

* add slurmkit

* combining the croping and merging to the apply-affine

* removing unnecessary prints()

* add registration and stabilization modules

* style

* flake8

* Registration refator (#118)

* refactor apply_affine

* clean up

Co-authored-by: Eduardo Hirata-Miyasaki <eduardo.hirata@czbiohub.org>

* debug and add comments

* updating estimate_affine to match new yml

* don't start parallel pool for 1 iterable

* patch previous commit

* make sure the source_channel_used is first in the list for the optimizer

* make optimize_affine accept the new config parameters

* fix bug calling iohub info on paths with white spaces; rename target_channel_str

* better white space cli bug fix

* cleaner print statements

* don't use itertools.starmap

* clean up apply_affine print statements

* clean up optimize_affine

---------

Co-authored-by: Eduardo Hirata-Miyasaki <eduardo.hirata@czbiohub.org>
Co-authored-by: Eduardo Hirata-Miyasaki <edhiratam@gmail.com>

* removing the source n target shape zyx and testing keep overhang

* updating estimate affine with previous commit changes

* style

* Update example_apply_affine_settings.yml

* refactor registration and stabilization functions

* fixing pytests

* more intuitive function names

* minor refactor of estimane_affine

* bugfix

* fixing the slurmkit files.

* typo

* cleaner processing of additioanal source channels

* refactor apply_affine job submission

* remove position batch processing

* temporarily reorder functions

* revert temp reorder functions

* refactor functions

* refactor combined matrix calculation

* refactor z_drift multiprocessing

* small refactor + messaging

* renaming

* this eliminates stabilization_ove_time_ants by reusing processing_single_position_v2. Also fixes a bug in the processing_single_position_v2.

* modified the function to process channel indeces and copy over the other channels similar to affine transform.
by default all channels are processed with the same transform.

* remove `analysis/stabilize.py`

* renaming

* more renaming

* update docstring

* estimate_xy_stabilization uses the z indices calculated by estimate_z_stabilization

* style

* rename fields in position_focus.csv

* update z_drift figure save path

* add axis labels

* fixing tests

* fix method='ffill' deprecation issue

* clean up slurmkit examples

* update slurmkit_stabilize example

* fix tests

* minor fixes

* fix ffill

* add back `t_idx` param

* more ffill fix

* update apply_transform_to_zyx_and_save_v2 documentation

---------

Co-authored-by: Eduardo Hirata-Miyasaki <edhiratam@gmail.com>
Co-authored-by: Talon Chandler <talonchandler@gmail.com>
Co-authored-by: Eduardo Hirata-Miyasaki <eduardo.hirata@czbiohub.org>
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.

2 participants