Skip to contents

Compute a common mask between two spaces

Usage

common_mask(g1, g2, rule = c("intersection", "union"))

Arguments

g1

First GDS or space

g2

Second GDS or space

rule

Either "intersection" or "union"

Value

A list with integer indices idx1 and idx2 for subsetting each

Examples

m1 <- array(c(TRUE, FALSE, TRUE, TRUE), c(2, 2, 1))
m2 <- array(c(TRUE, TRUE, FALSE, TRUE), c(2, 2, 1))
sp1 <- space_voxel(c(2,2,1), diag(4), mask_bitmap = m1,
  storage = "packed")
sp2 <- space_voxel(c(2,2,1), diag(4), mask_bitmap = m2,
  storage = "packed")
common_mask(sp1, sp2, rule = "intersection")
#> $idx1
#> [1] 1 3
#> 
#> $idx2
#> [1] 1 3
#>