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 V2 #102

Merged
merged 86 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b78a3c3
initial commit adding tools for cropping and registering with ants
edyoshikun Sep 22, 2023
6c1ce18
adding lir crop
edyoshikun Sep 26, 2023
0b71192
starting cleanup for registration
edyoshikun Oct 4, 2023
f11874d
converting nan to zero
edyoshikun Oct 5, 2023
1df5d66
ants estimate affine
edyoshikun Oct 24, 2023
b2e38e1
adding config file for estimate_transform
edyoshikun Oct 24, 2023
7819ec4
cleaning up some redundancies
edyoshikun Oct 24, 2023
9fc7df8
fix edge case of input not being float32
edyoshikun Oct 24, 2023
957fc49
channel is an int
edyoshikun Oct 24, 2023
ccde02e
typo in napari add image for vs ants optimzer
edyoshikun Oct 24, 2023
ee1845f
adding utils yaml
edyoshikun Oct 24, 2023
e617ffc
separated the manual estimation from the optimizer
edyoshikun Oct 30, 2023
d019bf6
added ants to numpy and viceversa
edyoshikun Oct 30, 2023
a76d70c
adding input at the end to prevent from closing
edyoshikun Oct 30, 2023
0d39cbe
replacing the reading of .mat to matrix from yaml
edyoshikun Nov 1, 2023
362e7a7
added changes to ants to numpy from Jordaos input
edyoshikun Nov 3, 2023
9d25d1a
cannot have recOrder as dependency given different pycromanager versions
edyoshikun Nov 3, 2023
caa84dc
format
edyoshikun Nov 3, 2023
6d6504a
add test for optimize_affine and update readme
edyoshikun Nov 3, 2023
f2c56fb
adding docstring
edyoshikun Nov 3, 2023
8ed961d
removed the config dependency
edyoshikun Nov 3, 2023
7a7b20d
removing the focus_finding svg
edyoshikun Nov 3, 2023
ac4a5fc
removing the estimate_affine.yml and making flags to choose channels …
edyoshikun Nov 3, 2023
2d13d4d
added comment and code to use scipy.
edyoshikun Nov 3, 2023
58175d0
-ls and -lf to -s and -t
talonchandler Nov 3, 2023
3b9d5eb
document FOCUS_SLICE_ROI_WIDTH
talonchandler Nov 3, 2023
8acad5c
`estimate-source-to-target-affine` -> `estimate-affine`
talonchandler Nov 3, 2023
3fabc8a
standardize `optimize-affine` arguments
talonchandler Nov 3, 2023
52c21ad
cleaner docs
talonchandler Nov 3, 2023
66d8990
update RegistrationSettings
talonchandler Nov 3, 2023
98089b2
fix tests
talonchandler Nov 3, 2023
c34bad0
remove duplicate
talonchandler Nov 3, 2023
a35153f
write indices to output config
talonchandler Nov 3, 2023
36f0b7e
read channels from file
talonchandler Nov 3, 2023
9bfbd20
test fix
talonchandler Nov 4, 2023
2ca449c
echo improvments
talonchandler Nov 4, 2023
5bf0ba0
black
talonchandler Nov 4, 2023
3e236f9
style
ieivanov Nov 9, 2023
6226786
remove duplicate cli call
ieivanov Nov 9, 2023
9137527
more intuitive manual registration
ieivanov Nov 10, 2023
4f709ba
Merge branch 'main' into registration_v2
ieivanov Nov 10, 2023
ca75078
patch for deskewing
edyoshikun Nov 13, 2023
df53a74
testing slurmkit
edyoshikun Nov 15, 2023
cd698d6
fix apply affine example
ieivanov Nov 15, 2023
fdae716
matrix multiplication bugfix
ieivanov Nov 15, 2023
ebc8b04
updating the lir_crop using new registration
edyoshikun Nov 15, 2023
94761c8
adding lir crop to the apply affine and modifying the manual estimati…
edyoshikun Nov 16, 2023
a29811a
convert nans to zeros
edyoshikun Nov 16, 2023
4562403
adding test for affine
edyoshikun Dec 12, 2023
92d54dc
removed main
edyoshikun Dec 12, 2023
4fd7b6b
fix `apply_affine` docstring
ieivanov Dec 12, 2023
4540956
fixing formatting
edyoshikun Dec 12, 2023
0753c58
remove crop-output from cli args
ieivanov Dec 12, 2023
ef4980f
estimate affine cli docstrings
ieivanov Dec 12, 2023
0e2f8c4
reverting changes to AnalysisSettings model.
edyoshikun Dec 12, 2023
7c3c5f9
optimize_affine cli docstrings
ieivanov Dec 12, 2023
0d30a55
Merge branch 'registration_v2' of github.com:czbiohub/mantis_automati…
ieivanov Dec 12, 2023
ec56140
Revert "reverting changes to AnalysisSettings model."
ieivanov Dec 12, 2023
4172494
fix points layer grid mode bug
ieivanov Dec 14, 2023
7fa9896
fix tests
ieivanov Dec 14, 2023
eb757cb
combining the croping and merging to the apply-affine
edyoshikun Dec 19, 2023
af8dd2e
removing unnecessary prints()
edyoshikun Dec 19, 2023
5325426
add registration and stabilization modules
ieivanov Jan 5, 2024
538ddee
Merge branch 'main' into registration_v2
ieivanov Jan 5, 2024
076f1cb
style
ieivanov Jan 5, 2024
1e8ee8a
flake8
ieivanov Jan 5, 2024
59a762d
Merge branch 'registration_v2' of github.com:czbiohub/mantis into reg…
edyoshikun Jan 5, 2024
6a5f435
Registration refator (#118)
ieivanov Jan 16, 2024
97d2302
removing the source n target shape zyx and testing keep overhang
edyoshikun Jan 16, 2024
ac2dac7
updating estimate affine with previous commit changes
edyoshikun Jan 16, 2024
fde7982
Merge branch 'main' into registration_v2
ieivanov Jan 17, 2024
cfd1116
style
ieivanov Jan 17, 2024
5c7fcf5
Update example_apply_affine_settings.yml
ieivanov Jan 17, 2024
e6ac5f1
Merge branch 'main' into registration_v2
ieivanov Jan 17, 2024
10277c6
refactor registration and stabilization functions
ieivanov Jan 17, 2024
4a54fb7
fixing pytests
edyoshikun Jan 17, 2024
0b45130
more intuitive function names
ieivanov Jan 17, 2024
83292ad
minor refactor of estimane_affine
ieivanov Jan 17, 2024
f358f22
Merge branch 'registration_v2' of https://github.com/czbiohub-sf/shri…
ieivanov Jan 17, 2024
1b78856
bugfix
ieivanov Jan 17, 2024
71eb2c7
fixing the slurmkit files.
edyoshikun Jan 17, 2024
e574675
typo
ieivanov Jan 17, 2024
1957563
cleaner processing of additioanal source channels
ieivanov Jan 18, 2024
d62934a
Merge branch 'registration_v2' of github.com:czbiohub/mantis_automati…
ieivanov Jan 18, 2024
ab6244f
refactor apply_affine job submission
ieivanov Jan 18, 2024
6626aa6
remove position batch processing
ieivanov Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed the config dependency
edyoshikun committed Nov 3, 2023
commit 8ed961dcddac10878412caa386baa5e8b54d4a04
21 changes: 14 additions & 7 deletions mantis/cli/estimate_affine.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import napari
import numpy as np
import yaml
import os

from iohub import open_ome_zarr
from skimage.transform import EuclideanTransform
@@ -31,24 +32,30 @@
@click.command()
@labelfree_position_dirpaths()
@lightsheet_position_dirpaths()
@config_filepath()
@output_filepath()
def estimate_source_to_target_affine(
labelfree_position_dirpaths, lightsheet_position_dirpaths, config_filepath, output_filepath
labelfree_position_dirpaths, lightsheet_position_dirpaths, output_filepath
):
"""
Estimate the affine transform between two channels (source channel and target channel) by manual inputs.
mantis estimate-source-to-target-affine -lf ./acq_name_labelfree_reconstructed.zarr/0/0/0 -ls ./acq_name_lightsheet_deskewed.zarr/0/0/0 -c ./config.yml -o ./output.yml
mantis estimate-source-to-target-affine -lf ./acq_name_labelfree_reconstructed.zarr/0/0/0 -ls ./acq_name_lightsheet_deskewed.zarr/0/0/0 -o ./output.yml
"""

# # Get a napari viewer()
viewer = napari.Viewer()

settings = yaml_to_model(config_filepath, EstimateTransformSettings)
source_channel_idx = settings.source_channel_idx
target_channel_idx = settings.target_channel_idx
pre_affine_90degree_rotations_about_z = settings.pre_affine_90degree_rotations_about_z
print("Getting dataset info")
print("\n phase channel INFO:")
os.system(f"iohub info {labelfree_position_dirpaths[0]}")
print("\n fluorescence channel INFO:")
os.system(f"iohub info {lightsheet_position_dirpaths[0]} ")

source_channel_idx = int(input("Enter phase_channel index to process: "))
target_channel_idx = int(input("Enter fluor_channel index to process: "))
pre_affine_90degree_rotations_about_z = int(
input("Rotate the source channel by 90 degrees? (0, 1, or -1): ")
)

click.echo(f"Estimating registration with labelfree_channel idx {source_channel_idx}")
click.echo("Loading data and estimating best focus plane...")