Skip to content

image_stitch - bugfix for bool / integer matrix#751

Merged
yunjunz merged 3 commits intomainfrom
olliestephenson-patch-1
Mar 18, 2022
Merged

image_stitch - bugfix for bool / integer matrix#751
yunjunz merged 3 commits intomainfrom
olliestephenson-patch-1

Conversation

@olliestephenson
Copy link
Contributor

Currently image_stitch.py can't correctly merge mask files. It puts the merged arrays into an array initialised as np.nan. Nans evaluate to True, meaning that we are left with blocks outside the data region that are set to True. Adding a simple check to see if we're merging boolean arrays, then setting the default values to False seems to fix the issue. Am I missing a possible bug here?

Currently `image_stitch.py` can't correctly merge mask files. It puts the merged arrays into an array initialised as `np.nan`. Nans evaluate to `True`, meaning that we are left with blocks outside the data region that are set to `True`. Adding a simple check to see if we're merging boolean arrays, then setting the default values to `False` seems to fix the issue. Am I missing a possible bug here?
@yunjunz yunjunz self-requested a review March 18, 2022 04:16
yunjunz added 2 commits March 17, 2022 21:42
+ explicitly define "fill_value" variable

+ use vprint() to shorten the print() if check
Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

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

Good catch @olliestephenson. This is a bug, for both boolean and integer types of the input matrix. Thank you!

@yunjunz yunjunz changed the title Fix mask merging bug in image_stitch.py image_stitch - bugfix for bool / integer matrix Mar 18, 2022
@yunjunz yunjunz merged commit bbbaf2b into main Mar 18, 2022
@yunjunz yunjunz deleted the olliestephenson-patch-1 branch March 18, 2022 05:45
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