danforthcenter / plantcv

Plant phenotyping with image analysis
Mozilla Public License 2.0
665 stars 265 forks source link

Kmeans grayscale #1570

Closed leafism9 closed 2 weeks ago

leafism9 commented 4 months ago

Describe your changes A clear and concise description of what changes are made by this pull request. What was the previous functionality (if relevant) and what can we do now with these changes.

For any previously RGB specific lines in patch_extract() or predict_kmeans(), the added code checks the number of dimensions and number of channels in the image and chooses the RGB or grayscale vesion of the line accordingly. This is a non-breaking feature enhancement that allows grayscale functionality to the preexisting kmeans functions.

Additional update added 10/24/24 by Keely (k034b363), this PR now includes padding the outside edges of images input to predict_kmeans so that resulting masks can be applied to the original image. We have included this update here so as to avoid merge in order conflicts.

Type of update Is this a: New feature or feature enhancement

Associated issues Updated PR now closes: https://github.com/danforthcenter/plantcv/issues/1552

Additional context Add any other context about the problem here. N/A

For the reviewer See this page for instructions on how to review the pull request.

deepsource-io[bot] commented 4 months ago

Here's the code health analysis summary for commits 92aea4c..5c207f3. View details on DeepSource β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPythonβœ… Success
🎯 1 occurence resolved
View Check β†—
DeepSource Test coverage LogoTest coverageβœ… SuccessView Check β†—

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, βœ… Above Threshold100%, βœ… Above Threshold

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.