-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into zeeuqsze-grayscale-colab
- Loading branch information
Showing
22 changed files
with
400 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## Autodetect Cicular Regions of Interest (ROI) | ||
|
||
**plantcv.roi.auto_wells**(*gray_img, mindist, candec, accthresh, minradius, maxradius, nrows, ncols, radiusadjust=None*) | ||
|
||
**returns** roi_objects | ||
|
||
- **Parameters:** | ||
- gray_img = Gray single channel image data | ||
- mindist = minimum distance between detected circles | ||
- candec = higher threshold of canny edge detector | ||
- accthresh = accumulator threshold for the circl centers | ||
- minradius = minimum circle radius | ||
- maxradius = maximum circle radius | ||
- nrows = expected number of rows | ||
- ncols = expected number of columns | ||
- radiusadjust = amount to adjust the average radius, this can be desirable if you want ROI to sit inside a well, for example (in that case you might set it to a negative value). | ||
- **Context:** | ||
- Uses a Hough Circle detector to find circular shapes, then uses a gaussian mixture model to sort found circular objects so they are ordered from | ||
top left to bottom right. We assume that circles are of approximately equal size because we calculate an average radius of all of the found circles. | ||
The average radius size can be adjusted with the radius adjust parameter, for example in the case that you'd like the ROI to sit inside of the well. | ||
|
||
**Reference Image** | ||
|
||
![Screenshot](img/documentation_images/roi_auto_wells/circle-wells.png) | ||
|
||
```python | ||
|
||
from plantcv import plantcv as pcv | ||
|
||
# Set global debug behavior to None (default), "print" (to file), | ||
# or "plot" (Jupyter Notebooks or X11) | ||
pcv.params.debug = "plot" | ||
|
||
# Detect Circular Shapes and Use as ROIs | ||
rois1 = pcv.roi.auto_wells(gray_img=gray_img, mindist = 20, candec = 50, | ||
accthresh = 30, minradius = 40, maxradius = 50, nrows=4, ncols=6, radiusadjust=-10) | ||
|
||
``` | ||
|
||
**Grid of ROIs** | ||
|
||
![Screenshot](img/documentation_images/roi_auto_wells/21_roi.png) | ||
|
||
**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/roi/roi_methods.py) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Automatically detect a color card and color correct in one step | ||
|
||
Corrects the color of the input image based on the target color matrix using an affine transformation | ||
in the RGB space after automatic detection of a color card within the image. A one-step wrapper of | ||
[plantcv.transform.detect_color_card](transform_detect_color_card.md), [plantcv.transform.std_color_matrix](std_color_matrix.md), | ||
[plantcv.transform.get_color_matrix](get_color_matrix.md), and [plantcv.transform.affine_color_correction](transform_affine_color_correction.md). | ||
|
||
**plantcv.transform.auto_correct_color**(*rgb_img, label=None, \*\*kwargs*) | ||
|
||
**returns** corrected_img | ||
|
||
- **Parameters** | ||
- rgb_img - Input RGB image data containing a color card. | ||
- label - Optional label parameter, modifies the variable name of observations recorded. (default = `pcv.params.sample_label`) | ||
- **kwargs - Other keyword arguments passed to `cv2.adaptiveThreshold` and `cv2.circle`. | ||
- adaptive_method - Adaptive threhold method. 0 (mean) or 1 (Gaussian) (default = 1). | ||
- block_size - Size of a pixel neighborhood that is used to calculate a threshold value (default = 51). We suggest using 127 if using `adaptive_method=0`. | ||
- radius - Radius of circle to make the color card labeled mask (default = 20). | ||
- min_size - Minimum chip size for filtering objects after edge detection (default = 1000) | ||
- **Returns** | ||
- corrected_img - Color corrected image | ||
|
||
- **Example Use** | ||
- Below | ||
|
||
```python | ||
|
||
from plantcv import plantcv as pcv | ||
|
||
rgb_img, imgpath, imgname = pcv.readimage(filename="top_view_plant.png") | ||
|
||
corrected_rgb = pcv.transform.auto_correct_color(rgb_img=old_card) | ||
``` | ||
|
||
**Debug Image: automatically detected and masked the color card** | ||
|
||
![Screenshot](img/documentation_images/correct_color_imgs/detect_color_card.png) | ||
|
||
|
||
**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/transform/auto_correct_color.py) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
## Tutorial: Arabidopsis Multi-Plant Workflow | ||
|
||
Check out our interactive Arabidopsis multi-plant tutorial! | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-arabidopsis-tray/HEAD?labpath=index.ipynb) Check out our interactive arabidopsis multi-plant tutorial! | ||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-arabidopsis-tray/HEAD?labpath=index.ipynb) | ||
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/danforthcenter/plantcv-tutorial-arabidopsis-tray/blob/main/index-Colab.ipynb) | ||
[![Static Badge](https://img.shields.io/badge/Open%20on%20GitHub-black?logo=github)](https://github.com/danforthcenter/plantcv-tutorial-arabidopsis-tray.git) | ||
|
||
<iframe src="https://nbviewer.jupyter.org/github/danforthcenter/plantcv-tutorial-arabidopsis-tray/blob/main/index.ipynb" width="100%" height="1500px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
## Tutorial: Morphology Functions | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-morphology/HEAD?labpath=index.ipynb) | ||
Check out our interactive morphology tutorial! | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-morphology/HEAD) | ||
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/danforthcenter/plantcv-tutorial-morphology/blob/main/index-Colab.ipynb) | ||
[![Static Badge](https://img.shields.io/badge/Open%20in%20GitHub-black?logo=github)](https://github.com/danforthcenter/plantcv-tutorial-morphology.git) | ||
|
||
<iframe src="https://nbviewer.jupyter.org/github/danforthcenter/plantcv-tutorial-morphology/blob/main/index.ipynb" width="100%" height="1500px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
## Tutorial: Seed Analysis Workflow | ||
|
||
Check out our interactive tutorial! | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-seeds/HEAD?labpath=index.ipynb) Check out our interactive seed analysis tutorial! | ||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-seeds/HEAD) | ||
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/danforthcenter/plantcv-tutorial-seeds/blob/main/index-Colab.ipynb) | ||
[![Static Badge](https://img.shields.io/badge/Open%20on%20GitHub-black?logo=github)](https://github.com/danforthcenter/plantcv-tutorial-seeds.git) | ||
|
||
<iframe src="https://nbviewer.jupyter.org/github/danforthcenter/plantcv-tutorial-seeds/blob/main/index.ipynb" width="100%" height="1500px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
## Tutorial: Watershed Segmentation Workflow | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-watershed/HEAD?labpath=index.ipynb) Check out our interactive watershed tutorial! | ||
Check out our interactive watershed tutorial! This tutorial uses the analyze watershed segmentation function to roughly segment individual leaves. In this case, the number of objects reported from the analyze watershed function is a rough estimation of the number of leaves. The Watershed Segmentation Function is a PlantCV function based on code contributed by Suxing Liu, Arkansas State University. For more information see https://github.com/lsx1980/Leaf_count. | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/danforthcenter/plantcv-tutorial-watershed/HEAD?labpath=index.ipynb) | ||
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/danforthcenter/plantcv-tutorial-watershed/blob/main/index-Colab.ipynb) | ||
[![Static Badge](https://img.shields.io/badge/Open%20on%20GitHub-black?logo=github)](https://github.com/danforthcenter/plantcv-tutorial-watershed.git) | ||
|
||
<iframe src="https://nbviewer.jupyter.org/github/danforthcenter/plantcv-tutorial-watershed/blob/main/index.ipynb" width="100%" height="1500px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.