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

Tiled logic bug when provided with a full grid #26

Closed
camisowers opened this issue Apr 6, 2023 · 0 comments · Fixed by #27
Closed

Tiled logic bug when provided with a full grid #26

camisowers opened this issue Apr 6, 2023 · 0 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@camisowers
Copy link
Contributor

camisowers commented Apr 6, 2023

Please refer to our FAQ and look at our known issues before opening a bug report.

Describe the bug
There is a logic error in alpineer.load_utils.load_tiled_img_data for the case when the number of FOVs is the same as spots in the grid (i.e. there are no black spaces in the stitched image).

The code runs, but the images are instead stitched in acquisition order and not the intended tiled shape.

Screenshot 2023-04-06 at 12 03 02 PM

Expected behavior
We want the images to stitch in the correct order.

Screenshot 2023-04-06 at 12 07 01 PM

Solution
Remove the following lines of code from the load_tiled_img_data function. in alpineer Even if there are no blank spots in the image, we should just always load in the images one at a time to ensure they are put in the correct location within the array.

    # no missing fov images, load data normally and return array
    if len(fov_list) == len(expected_fovs):
        if single_dir:
            img_xr = load_imgs_from_dir(
                data_dir,
                match_substring=channel,
                xr_dim_name="channels",
                trim_suffix="_" + channel,
                xr_channel_names=[channel],
            )
        else:
            img_xr = load_imgs_from_tree(
                data_dir, img_sub_folder, fovs=fov_list, channels=[channel]
            )
        return img_xr

This is probably happened because the same function is used by both toffy and ark; however, in ark the folders have already been renamed and could be loaded in alphabetical order without issue.

@camisowers camisowers added the bug Something isn't working label Apr 6, 2023
@camisowers camisowers self-assigned this Apr 6, 2023
@camisowers camisowers transferred this issue from angelolab/toffy Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant