Given an object computed with measure_disease()
or measure_disease_byl()
a Standard Area Diagram (SAD) with n
images are returned with the
respective severity values.
Arguments
- object
An object computed with
measure_disease()
ormeasure_disease_byl()
.- n
The number of leaves in the Standard Area Diagram.
- show_original
Show original images? Defaults to
FALSE
, i.e., a mask is returned.- show_contour
Show original images? Defaults to
FALSE
, i.e., a mask is returned.- nrow, ncol
The number of rows and columns in the plot. See [image_combine())]
[image_combine())]: R:image_combine())
- ...
Other arguments passed on to
measure_disease()
.
Value
A data frame with the severity values for the n
sampled leaves. A plot with
the standard area diagram can be saved by wrapping sad()
with png()
.
Details
The leaves with the smallest and highest severity will always be in the SAD.
If n = 1
, the leaf with the smallest severity will be returned. The others
are sampled sequentially to achieve the n
images after severity has been
ordered in an ascending order. For example, if there are 30 leaves and n is
set to 3, the leaves sampled will be the 1st, 15th, and 30th with the
smallest severity values.
The SAD can be only computed if an image pattern name is used in argument
pattern
of measure_disease()
. If the images are saved, the n
images
will be retrevied from dir_processed
directory. Otherwise, the severity
will be computed again to generate the images.
References
Del Ponte EM, Pethybridge SJ, Bock CH, et al (2017) Standard area diagrams for aiding severity estimation: Scientometrics, pathosystems, and methodological trends in the last 25 years. Phytopathology 107:1161–1174. doi:10.1094/PHYTO-02-17-0069-FI
Examples
if (interactive() && requireNamespace("EBImage")) {
library(pliman)
sev <-
measure_disease(pattern = "sev_leaf",
img_healthy = "sev_healthy",
img_symptoms = "sev_sympt",
img_background = "sev_back",
plot = FALSE,
save_image = TRUE,
show_original = FALSE,
dir_original = image_pliman(),
dir_processed = tempdir())
sad(sev, n = 2)
}
#> Processing image sev_leaf |====================== | 50% 00:00:00
#> Processing image sev_leaf_nb |==========================================| 100% 00:00:01
#> Done!
#> Elapsed time: 00:00:02