catmssim_3d_slice  R Documentation 
The categorical structural similarity index measure for 3D categorical or binary images for multiple scales. The default is to compute over 5 scales. This computes a 2D measure for each xy slice of the zaxis and then averages over the zaxis.
catmssim_3d_slice(
x,
y,
levels = NULL,
weights = NULL,
window = 11,
method = "Cohen",
...,
random = "random"
)
x , y 
a binary or categorical image 
levels 
how many levels of downsampling to use. By default, 5. If

weights 
a vector of weights for the different scales. By default,
equal to 
window 
by default 11 for 2D and 5 for 3D images,
but can be specified as a
vector if the window sizes differ by dimension.
The vector must have the same number of
dimensions as the inputted 
method 
whether to use Cohen's kappa ( 
... 
additional constants can be passed to internal functions. 
random 
whether to have deterministic PRNG ( 
a value less than 1 indicating the similarity between the images.
set.seed(20181207)
dim < 8
x < array(sample(0:4, dim^5, replace = TRUE), dim = c(dim^2, dim^2, dim))
y < x
for (j in 1:(dim)) {
for (i in 1:(dim^2)) y[i, i, j] < 0
for (i in 1:(dim^2  1)) y[i, i + 1, j] < 0
}
catmssim_3d_slice(x, y, weights = c(.75, .25)) # by default method = "Cohen"
# compare to some simple metric:
mean(x == y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.