Learn R Programming

catsim (version 0.2.4)

binssim: Categorical Structural Similarity Index Metric (whole image)

Description

This computes the categorical or binary structural similarity index metric on a whole-image scale. The difference between this and the default 2-D method is that this considers the whole image at once and one scale rather than computing the index over a sliding window and downsampling to consider it at other scales.

Usage

binssim(
  x,
  y,
  alpha = 1,
  beta = 1,
  gamma = 1,
  c1 = 0.01,
  c2 = 0.01,
  method = "Cohen",
  ...
)

Value

Structural similarity index.

Arguments

x, y

binary or categorical image

alpha

normalizing parameter, by default 1

beta

normalizing parameter, by default 1

gamma

normalizing parameter, by default 1

c1

small normalization constant for the c function, by default 0.01

c2

small normalization constant for the s function, by default 0.01

method

whether to use Cohen's kappa (Cohen), Jaccard Index (Jaccard), Dice index (Dice), accuracy (accuracy), Rand index (Rand), Adjusted Rand Index (AdjRand or ARI), or normalized mutual information (NMI or MI) as the similarity index. Note Jaccard and Dice should only be used on binary data.

...

Constants can be passed to the components of the index.

Examples

Run this code
set.seed(20181207)
x <- matrix(sample(1:4, 10000, replace = TRUE), nrow = 100)
y <- x
for (i in 1:100) y[i, i] <- 1
for (i in 1:99) y[i, i + 1] <- 1
binssim(x, y)

Run the code above in your browser using DataLab