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

Use correct min/max stretching, and guard against flat images #357

Merged
merged 2 commits into from
Aug 17, 2024

Conversation

thouis
Copy link
Contributor

@thouis thouis commented Aug 15, 2024

The min/max stretching was using (im - min) / max, instead of (im - min) / (max - min). This change fixes that stretch, and also adds a small epsilon to guard against NaNs when max == min.

@thouis
Copy link
Contributor Author

thouis commented Aug 15, 2024

I also added a check for the image size matching the configured size, and a warning for cell boxes entirely outside the image.

These changes all originated from the same run,
With a misconfigured image size,
That led to clipping boxes outside the image,
Which produced all-zeros images,
Which produced NaNs in the image normalization.

@thouis
Copy link
Contributor Author

thouis commented Aug 15, 2024

The assertion on image size could be ignored if you first incorporate this PR: #354

Copy link
Member

@jccaicedo jccaicedo left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jccaicedo
Copy link
Member

Thank you for the PR!! This is amazing!

@jccaicedo jccaicedo merged commit bed9d6a into cytomining:master Aug 17, 2024
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