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

Current fixes #158

Merged
merged 5 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions aydin/features/groups/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ def _correlate(
for axis in range(image.ndim):

# prepare shape:
shape = [
1,
] * image.ndim
shape = [1] * image.ndim
shape[axis] = kernel.shape[0]

# reshape kernel:
Expand Down
1 change: 1 addition & 0 deletions aydin/gui/_qt/custom_widgets/program_flow_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(self, parent):
"HCR (Royer)": examples_single.royerlab_hcr,
"Blastocyst Fracking (Maitre)": examples_single.maitre_mouse,
"OpenCell ARHGAP21 (Leonetti)": examples_single.leonetti_arhgap21,
"OpenCell ANKRD11 (Leonetti)": examples_single.leonetti_ankrd11,
}
for item in menu_items.keys():
action = menu.addAction(item)
Expand Down
4 changes: 4 additions & 0 deletions aydin/io/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def get_array(self):
'1arq6nj4oiJaxG7dPHjhYVTSYXM2Czpgx',
'Leonetti_OC-FOV_ARHGAP21_ENSG00000107863_CID000556_FID00030711_stack.tif',
)
leonetti_ankrd11 = (
'1Bl0WlEPeDe8MmlWy8_KaZS9QKthvSDHM',
'Leonetti_OC-FOV_ANKRD11_ENSG00000167522_CID001385_FID00033338_stack.tif',
)

# XYZ
huang_fixed_pattern_noise = (
Expand Down
3 changes: 1 addition & 2 deletions aydin/util/crop/demo/demo_sf_rep_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def _crop_fun():
if __name__ == "__main__":

demo_super_fast_representative_crop(
examples_single.royerlab_hcr.get_array().squeeze(),
crop_size=1_000_000,
examples_single.royerlab_hcr.get_array().squeeze(), crop_size=1_000_000
)

demo_super_fast_representative_crop(
Expand Down
2 changes: 1 addition & 1 deletion aydin/util/crop/super_fast_rep_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _downscale(length):

# Compute zoom factor
zoom_per_axis = tuple(
1.0 / d if s > 1 else 1 for d, s in zip(downscale_factor, image.shape)
1.0 / d if s > d else 1 for d, s in zip(downscale_factor, image.shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is safer condition, thanks @royerloic !

)
lprint(f"zoom_per_axis: {zoom_per_axis}")

Expand Down
8 changes: 2 additions & 6 deletions aydin/util/edge_filter/fast_edge_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ def fast_edge_filter(array: ArrayLike, axis: int = 0, gpu: bool = True):
# Cast to float:
array = array.astype(dtype=numpy.float32, copy=False)

negative = [
'0',
] * array.ndim
negative = ['0'] * array.ndim
negative[axis] = '-1'
positive = [
'0',
] * array.ndim
positive = ['0'] * array.ndim
positive[axis] = '+1'

kernel_str = f"""
Expand Down