Description Usage Arguments Value Author(s) Examples
View source: R/SpatCorrImage.R
Create the neighbor indices on a group of subregions.
1 | neighbors_in_regions(region_idx, nb_idx, nb_dist)
|
region_idx |
a list of voxels indices for multiple regions. The length is the number of regions. |
nb_idx |
matrix with the neighbor indices of each voxel in each row |
nb_dist |
matrix with the distances between neighbors and the voxel in each row |
a list object contains of multiple list objects for neighbor indices and distances for different regions. For each region,
the list object contions two matrices: idx and dist.
idx contains the neighbor indices of each voxel in each row.
dist contains the distances between neighbors and the voxel in each row.
Jian Kang <jiankang@umich.edu>
1 2 3 4 5 6 7 | dim_img = c(10,10,10)
grids <- lapply(1:3,function(i) seq(-round(dim_img[i]/2)+1,round(dim_img[i]/2),length=dim_img[i]))
nb <- find_image_neighbors(grids)
region_mask_3 <- create_sphere_mask(grids,radius=3)
region_mask_2 <- create_sphere_mask(grids,radius=2)
region_idx <- list(which(region_mask_3&(!region_mask_2)),which(region_mask_2))
nb_regions <- neighbors_in_regions(region_idx,nb$idx,nb$dist)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.