Skip to content

Commit

Permalink
Merge pull request #910 from danforthcenter/cmyk_doc_updates
Browse files Browse the repository at this point in the history
Doc updates
  • Loading branch information
nfahlgren authored Jun 16, 2022
2 parents 811e655 + 5507652 commit deb0ffd
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 21 deletions.
1 change: 1 addition & 0 deletions docs/apply_transformation_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ corrected_img = pcv.transform.apply_transformation_matrix(source_img=source_img,

![Screenshot](img/documentation_images/correct_color_imgs/hstack.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
2 changes: 2 additions & 0 deletions docs/create_color_card_mask.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ mask = pcv.transform.create_color_card_mask(rgb_img=img, radius=10, start_coord=
**Color card mask**

![Screenshot](img/documentation_images/correct_color_imgs/color_card_mask.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
2 changes: 2 additions & 0 deletions docs/find_color_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ avg_chip_size = pcv.outputs.observations['prefix']['color_chip_size']['value']
**Tilted color card**

![Screenshot](img/documentation_images/correct_color_imgs/tilted_color_card.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
1 change: 1 addition & 0 deletions docs/get_color_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ print(color_matrix)
[ 220. 74.632 158.8224 144.3724]]

```
**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
1 change: 1 addition & 0 deletions docs/load_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ filename = "test.npz"
matrix = pcv.transform.load_matrix(filename=filename)

```
**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
1 change: 1 addition & 0 deletions docs/mp_inverse.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ print(matrix_m)

```

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
8 changes: 4 additions & 4 deletions docs/otsu_threshold.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ from plantcv import plantcv as pcv
pcv.params.debug = "print"

# Create binary image from a gray image based on threshold values.
# Targeting light objects in the image.
threshold_light = pcv.threshold.otsu(gray_img=gray_img, max_value=255, object_type='dark')
# Targeting dark objects in the image.
threshold_dark = pcv.threshold.otsu(gray_img=gray_img, max_value=255, object_type='dark')

```

Expand All @@ -44,8 +44,8 @@ threshold_light = pcv.threshold.otsu(gray_img=gray_img, max_value=255, object_ty
```python

# Create binary image from a gray image based on threshold values.
# Targeting dark objects in the image.
threshold_dark = pcv.threshold.otsu(gray_img=gray_img, max_value=255, object_type='light')
# Targeting light objects in the image.
threshold_light = pcv.threshold.otsu(gray_img=gray_img, max_value=255, object_type='light')

```

Expand Down
3 changes: 3 additions & 0 deletions docs/parallel_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,6 @@ Windows you will need to specify the whole path to `plantcv-workflow.py`.
```shell
python %CONDA_PREFIX%/Scripts/plantcv-workflow.py --config my_config.json
```

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/parallel/__init__.py)

23 changes: 12 additions & 11 deletions docs/rgb2cmyk.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ from plantcv import plantcv as pcv
# or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# image converted from RGB to LAB, channels are then split.
# Lightness ('l') channel is output
l_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')
# image converted from RGB to CMYK, channels are then split.
y_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')

```

Expand All @@ -38,8 +37,8 @@ l_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')

```python

# Green-Magenta ('a') channel is output
a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='C')
# Cyan ('c') channel is output
c_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='C')

```

Expand All @@ -49,8 +48,8 @@ a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='C')

```python

# Green-Magenta ('a') channel is output
a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='M')
# Magenta ('m') channel is output
m_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='M')

```

Expand All @@ -60,8 +59,8 @@ a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='M')

```python

# Green-Magenta ('a') channel is output
a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')
# Yellow ('a') channel is output
y_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')

```

Expand All @@ -71,7 +70,9 @@ a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='Y')

```python

# Green-Magenta ('a') channel is output
a_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='K')
# Black ('k') channel is output
k_channel = pcv.rgb2gray_cmyk(rgb_img=rgb_img, channel='K')

```

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/rgb2gray_cmyk.py)
2 changes: 2 additions & 0 deletions docs/save_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ pcv.transform.save_matrix(matrix=matrix, filename=fname)

```

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)

2 changes: 1 addition & 1 deletion docs/texture_threshold.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ texture calculation for thresholding.
- **Note:**
- This function is computationally expensive and will likely take several minutes to run (even longer if images are large).
- **Example use:**
- [Interactive Documentation](https://mybinder.org/v2/gh/danforthcenter/plantcv-binder.git/master?filepath=notebooks%2Fthreshold.ipynb)
- Below

**Original image (lightness channel)**

Expand Down
1 change: 1 addition & 0 deletions docs/transform_correct_color.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ target_matrix, source_matrix, transformation_matrix, corrected_img = pcv.transfo

![Screenshot](img/documentation_images/correct_color_imgs/hstack.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
15 changes: 10 additions & 5 deletions docs/transform_resize.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,24 @@ resize_img5 = pcv.transform.resize_factor(img=img, factors=(0.1154905775, 0.1154
```

**Images after resizing**
1st resized image
**1st resized image (default interpolation)

![Screenshot](img/documentation_images/resize/19_resize1.jpg)

2nd resized image
**2nd resized image (Interpolation by nearest)**

![Screenshot](img/documentation_images/resize/19_resize2.jpg)

3rd resized image (cropping)
**3rd resized image (cropping)**

![Screenshot](img/documentation_images/resize/19_resize3.jpg)

3rd resized image (zero-padding)
**4th resized image (zero-padding)**

![Screenshot](img/documentation_images/resize/19_resize4.jpg)

5th resize image
**5th resized image (by factor)**

![Screenshot](img/documentation_images/resize/19_resize5.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/resize.py)
1 change: 1 addition & 0 deletions docs/transformation_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ deviance, transformation_matrix = pcv.transform.calc_transformation_matrix(matri

```

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/transform/color_correction.py)
3 changes: 3 additions & 0 deletions docs/visualize_pseudocolor.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ unaltered, the matplotlib default DPI is 100 pixels per inch.
![Screenshot](img/documentation_images/pseudocolor/mask.jpg)

**Mask of "bad" values**

![Screenshot](img/documentation_images/pseudocolor/bad_mask.png)


Expand Down Expand Up @@ -109,9 +110,11 @@ pseudo_img_mask_obj_bad_mask = pcv.visualize.pseudocolor(gray_img=img, obj=obg,
![Screenshot](img/documentation_images/pseudocolor/pseudo_onimage_simple.jpg)

**Pseudocolored, Pixels With User Defined "bad" Values Marked Using Red Color (no axes or colorbar)**

![Screenshot](img/documentation_images/pseudocolor/pseudocolored_mask_bad.png)

**Pseudocolored, Cropped, background="white", Pixels With User Defined "bad" Values Marked Using Red Color (no axes)**

![Screenshot](img/documentation_images/pseudocolor/pseudocolored_mask_bad_obj.png)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/visualize/pseudocolor.py)

0 comments on commit deb0ffd

Please sign in to comment.