run_otsu_discordance {mxnorm} | R Documentation |
Calculate Otsu discordance scores using specified threshold for an mx_dataset
object.
Description
The Otsu discordance analysis quantifies slide-to-slide agreement by summarizing the distance between slide-level Otsu thresholds and the global Otsu threshold for a given marker in a single metric.
Usage
run_otsu_discordance(
mx_data,
table,
threshold_override = NULL,
plot_out = FALSE,
...
)
Arguments
mx_data |
|
table |
dataset in |
threshold_override |
optional user-defined function or alternate thresholding algorithm adaptable from Python skimage module |
plot_out |
boolean to generate Otsu discordance plots (default=FALSE) |
... |
optional additional arguments for Otsu discordance functions |
Value
mx_dataset
object with analysis results of Otsu discordance in otsu_data
table
References
Otsu, N. (1979). A threshold selection method from gray-level histograms. IEEE transactions on systems, man, and cybernetics, 9(1), 62-66.
Examples
mx_data = mx_dataset(mxnorm::mx_sample, "slide_id", "image_id",
c("marker1_vals","marker2_vals","marker3_vals"),
c("metadata1_vals"))
mx_data = mx_normalize(mx_data, transform="log10",method="None")
## using `threshold_override` here in case users haven't installed `scikit-image`
mx_data = run_otsu_discordance(mx_data, table="normalized",
threshold_override = function(thold_data){quantile(thold_data, 0.5)})