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

Allow blank images in training data set #42

Merged
merged 3 commits into from
Feb 4, 2023
Merged

Conversation

elaubsch
Copy link
Member

@elaubsch elaubsch commented Feb 3, 2023

This PR addresses a known bug in subpixel_distance_transform that prevented images without spots from being included in the training data set for the spot detection model. subpixel_distance_transform now checks the length of input point_list and if its length is zero, it returns a null result. This PR also adds a test for the no spots case for subpixel_distance_transform.

@elaubsch elaubsch added the fix Fixes a bug label Feb 3, 2023
@elaubsch elaubsch requested a review from rossbar February 3, 2023 23:32
Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Just two nits:

  • Using the kwarg name fill_value= makes the call slightly more grokable.
  • Passing in the dtype is slightly more efficient than coercing the array to the desired dtype after creating the array.

Neither of these is important - feel free to ignore!

At some point we should investigate if we can't speed this up using e.g. scipy.spatial, especially if this is used with large image_shapes and/or lots of points. Not relevant for now though, LGTM!

deepcell_spots/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
@elaubsch elaubsch merged commit a0a884d into master Feb 4, 2023
@elaubsch elaubsch deleted the mly/blank_images branch February 4, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants