cmsc_sw {GCSM}R Documentation

Composite similarity on spatial windows

Description

Compute composite measures, GCSM, CMSC or SSIM, on spatial windows.

Usage

cmsc_sw(
  x,
  y,
  rescale = FALSE,
  xmin = NA_real_,
  xmax = NA_real_,
  ymin = NA_real_,
  ymax = NA_real_,
  ksize = 9,
  globe = FALSE,
  comp = "si"
)

cmsc_e1_sw(
  x,
  y,
  rescale = FALSE,
  xmin = NA_real_,
  xmax = NA_real_,
  ymin = NA_real_,
  ymax = NA_real_,
  ksize = 9,
  globe = FALSE,
  comp = "si"
)

cmsc_e2_sw(
  x,
  y,
  rescale = FALSE,
  xmin = NA_real_,
  xmax = NA_real_,
  ymin = NA_real_,
  ymax = NA_real_,
  ksize = 9,
  globe = FALSE,
  comp = "si"
)

gcsm_sw(
  x,
  y,
  rescale = FALSE,
  xmin = NA_real_,
  xmax = NA_real_,
  ymin = NA_real_,
  ymax = NA_real_,
  ksize = 9,
  globe = FALSE,
  comp = "si"
)

ssim_sw(
  x,
  y,
  rescale = FALSE,
  xmin = NA_real_,
  xmax = NA_real_,
  ymin = NA_real_,
  ymax = NA_real_,
  ksize = 11,
  sigma = 1.5,
  globe = FALSE,
  comp = "si"
)

Arguments

x

A matrix.

y

The other matrix.

rescale

Rescale or not before computation.

xmin, xmax, ymin, ymax

Normalization parameters. If NA, are calculated from the ranges of x and y, respectively. See Details.

ksize

Side length of spatial windows.

globe

Are data at the global scale? If TRUE, two vertical borders will be padded before computation.

comp

Variable to return. If "si", the composite measure, if "s1","s2" or "s3", the corresponding component.

sigma

Standard deviation of Gaussian weighting function depending on the distance between the cell and kernel center.

Details

These functions slide the spatial window over space. Missing values are omitted. Normalization parameters are used to rescale x and y, and determine the global minimum (min) and maximum (max). If rescale is TRUE, x and y are rescaled to (x-xmin)/(xmax-xmin) and (y-ymin)/(ymax-ymin); and set min=0, max=1. If FALSE, min=min(xmin,ymin), max=max(xmax,ymax). OpenMP is used for parallel computing.

Value

A matrix.

Examples

x = matrix(runif(36), nrow = 6, ncol = 6)

gcsm_sw(x, x + 0.2, xmin = 0, xmax = 1, ymin = 0, ymax = 1, ksize = 3)
cmsc_sw(x, x + 0.2, xmin = 0, xmax = 1, ymin = 0, ymax = 1, ksize = 3)
ssim_sw(x, x + 0.2, xmin = 0, xmax = 1, ymin = 0, ymax = 1, ksize = 3)

[Package GCSM version 0.1.1 Index]