Colocalization._haussdorff_distance
— Methodhaussdorff_distance(xs, ys, aggregate=maximum)
Returns, for two segmented masks, the Haussdorff distance (per object).
Agg=maximum is the default, returns the maximum symmetric Euclidean distance of X to Y
Colocalization.aszero
— Methodaszero(xs)
zeros(eltype(xs), sizes(xs))
Colocalization.colocalize_2d
— Methodcolocalize(xs, ys; metric="pearson", windowsize=3)
Compute a colocalization metric `metric` on a window size of `windowsize^2`.
Set `windowsize` to >= 3, odd. If set to -1, use the entire image, output will be single scalar.
See `metrics` for metrics to use.
Colocalization.colocalize_all
— Methodcolocalize_all(xs, ys; windowsize=3)
Apply all coloc metrics. Returns a dictionary, so results are stored in results[metric].
Runs multithreaded.
```julia
xs = rand(10, 10)
ys = rand(10, 10)
res =colocalize_all(xs, ys)
correlation_values = res["pearson"]
μ, md, σ, min, max, q1, q3, iqr, q95, q99, nans = describe_map(correlation_values)
```
Colocalization.compute_distances_cc_to_mask
— Methodcompute_distances_cc_to_mask(from_cc, to_mask)
Compute distances, overlap, and a distance map from a component map to a mask.
The distance map has a token 0.1 if the distance = 0 to prevent occlusion with background.
Colocalization.describe_array
— Methoddescribe_array(xs)
Returns μ, md, σ, min, max, q1, q3, iqr, q95, q99, nans for `xs`.
Colocalization.filter_projection
— Functionfilter_projection(image, w=1, z=0)
Compute a 2-stage filtered mask based on image. w is the window size, z is the number of standard deviations to use as a threshold.
This removes isolated localizations of low intensity.
Colocalization.haussdorff_distance
— Methodhaussdorff_distance(xs, ys, aggregate=maximum)
Returns, for two segmented masks, the Haussdorff distance (per object).
Agg=maximum is the default, returns the maximum symmetric Euclidean distance of X to Y
Colocalization.haussdorff_max
— Methodhaussdorff_max(xs, ys)
The reference implementation for the Haussdorff distance, returns the maximum symmetric Euclidean distance of X to Y
See https://en.wikipedia.org/wiki/Hausdorff_distance
Colocalization.haussdorff_mean
— Methodhaussdorff_mean(xs, ys)
A variant of the Haussdorff distance, returns the mean symmetric Euclidean distance of X to Y
See https://en.wikipedia.org/wiki/Hausdorff_distance
Colocalization.intersection_mask
— Methodintersection_mask(xs, ys)
mask where x .> 0 and y .> 0
Colocalization.list_metrics
— Methodlist_metrics()
Returns a list of the supported metrics
Colocalization.metrics_iterator
— Methodmetrics_iterator()
Returns an iterator over the supported metrics, in String / Function pairs.
Metric functions expect equal shaped array, and return a scalar value
Colocalization.segment
— Functionsegment(image, scale=1.0)
Perform basic otsu thresholding. Scale argument allows you to include more (>1) background or less (<1)
Colocalization.spear
— Methodspear(left, right)
Return the spearman correlation between arguments, and the significance (z-test, t-test)
Reuse with permission from https://github.com/bencardoen/SubPrecisionContactDetection.jl
Colocalization.tomask
— Methodtomask(img)
Utility function to binarize argument
Colocalization.union_distance_mask
— Methodunion_distance_mask(xs, ys, distance)
Finds the connected components in X that are <= distance to any component in Y and vice versa
Returns mask_x, mask_y
Colocalization.union_mask
— Methodunion_mask(xs, ys)
mask where any component that has a non-zero intersection is set to 1.