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

refactor image handling #114

Merged
merged 30 commits into from
Aug 15, 2023
Merged

refactor image handling #114

merged 30 commits into from
Aug 15, 2023

Conversation

lukasalexanderweber
Copy link
Member

No description provided.

@lukasalexanderweber
Copy link
Member Author

@3nol maybe you want to have a look on those changes. My idea was that we can produce the scaled image masks by adding

    def read_masks(self, mask_names):
        mask_names = Images.resolve_wildcards(mask_names)
        assert len(mask_names) == len(self.img_names)
        for idx, name in enumerate(mask_names):
            img = Images.read_image(name)
            size = Images.get_image_size(img)
            np.testing.assert_array_equal(self.img_sizes[idx], size)
            yield img

and just use the normal resize function in the stitcher:

feature_masks = self.images.read_masks(feature_mask_names)
feature_masks = self.images.resize(imgs, Images.Resolution.MEDIUM)
feature_masks = list(feature_masks)

Of course this change is not backwards compatible, so I would also need to adjust the tutorial (no ImageHander anymore). I think it's worth it but it would be great to have feedback about this

@lukasalexanderweber lukasalexanderweber merged commit ad961e8 into main Aug 15, 2023
2 checks passed
@lukasalexanderweber lukasalexanderweber deleted the refactor_img_handling branch August 15, 2023 20:52
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.

None yet

1 participant