Description Usage Arguments Value Author(s) Examples
Get the values in a local neighborhood of an antsImage
.
1 2 | getNeighborhoodAtVoxel(image, center, kernel,
physical.coordinates = FALSE)
|
image |
Image object of S4 class |
center |
array of indices for neighborhood center |
kernel |
either an array of values for neighborhood radius (in voxels) or a binary array of the same dimension as the image, specifying the shape of the neighborhood to extract |
physical.coordinates |
a logical indicating if voxel indices and offsets should be in voxel or physical coordinates |
a list
valuesnumeric vector of values
indicesmatrix providing the coordinates for each value
Duda JT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | img<-makeImage(c(10,10),rnorm(100))
center <- dim(img)/2
radius <- rep(3,2)
nhlist <- getNeighborhoodAtVoxel(img,center,radius)
kernel <- 1*(rnorm(49)>0)
dim(kernel) <- c(7,7)
randlist <- getNeighborhoodAtVoxel(img,center,kernel)
randlist <- getNeighborhoodAtVoxel(img,center,kernel,
physical.coordinates = TRUE)
arr = as.array(img)
testthat::expect_error(getNeighborhoodAtVoxel(arr,center,kernel), "class")
testthat::expect_error(getNeighborhoodAtVoxel(img,as.character(center),kernel),
"center must be")
testthat::expect_error(getNeighborhoodAtVoxel(img,center,c(radius, 3)),
"kernel must have same")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.