Skip to content

Added nuclei filtering to labeled images#44

Merged
droiva merged 3 commits into
mainfrom
droiva
Apr 14, 2026
Merged

Added nuclei filtering to labeled images#44
droiva merged 3 commits into
mainfrom
droiva

Conversation

@droiva

@droiva droiva commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@droiva

droiva commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator Author

@apugalde please review if any other enhancements are needed or if any other bugs are needed to be fixed

@droiva droiva requested a review from apugalde April 14, 2026 07:58
@apugalde

apugalde commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Wouldn't be faster like this? Just a suggestion

# Calculate all areas at once
vals, counts = numpy.unique(inf, return_counts=True)
# Get labels that pass the filter
valstoremove = vals[counts > area_filter_min AND counts < area_filter_max]
# Set all values to zero
inf[numpy.isin(inf, valstoremove)] = 0

@droiva

droiva commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator Author

Totally true, now changed to use bool mask instead of loop. Did not know about return_counts parameter!

@droiva droiva merged commit ef65835 into main Apr 14, 2026
3 checks passed
@droiva droiva deleted the droiva branch April 14, 2026 09:46
This was referenced Apr 14, 2026
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