Description Usage Arguments Details Value See Also Examples
Compute the spatial groups using the coordinates of the observations.
1 2 | calcGroupsCoords(coords, array = NULL, Neighborhood, max_groups = 10000,
verbose = optionsMRIaggr("verbose"))
|
coords |
the spatial coordinates of the observations. data.frame. REQUIRED. |
array |
alternative specification of the spatial coordinates using an array where the non-NA values indicates the points of interest. array or |
Neighborhood |
the type of neighbourhood. character. |
max_groups |
the maximum number of groups. postive integer. |
verbose |
should the execution of the function be traced ? logical. |
ARGUMENTS:
the Neighborhood
argument can be a matrix or an array defining directly the neighbourhood to use (i.e the weight of each neighbor)
or a name indicating which type of neighbourhood should be used (see the details section of initNeighborhood
).
An list containing :
[[ls.group]]
: lists
of the observations of each spatial group.
[[df.group]]
: a data.frame indicating the position and the group of each observation.
[[group_size]]
: the size of each spatial group. integer vector.
initFilter
for various pre-stored filters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")
optionsMRIaggr(outline.index = TRUE, num.main = FALSE)
## select data
MASK_DWI_t0 <- selectContrast(MRIaggr.Pat1_red, param = "MASK_DWI_t0")
coords <- selectCoords(MRIaggr.Pat1_red)
#### 1- compute spatial groups using coordinates ####
res3DN18 <- calcGroupsCoords(coords = coords[MASK_DWI_t0 == 1,], Neighborhood = "3D_N18")
res3DN18$group_size
## display the lesion spatial groups
multiplot(coords, contrast=MASK_DWI_t0, legend = FALSE, num=2,
index1=coords[MASK_DWI_t0 == 1,][res3DN18$ls.group[[1]],])
#### 2-compute spatial groups using an array ####
A.MASK_DWI_t0 <- dt2array(MASK_DWI_t0,coords = coords)$contrast[[1]]
A.MASK_DWI_t0[A.MASK_DWI_t0 == FALSE] <- NA
## display
graphics::image(A.MASK_DWI_t0[,,3])
## computation of the spatial groups
res3DN18.bis <- calcGroupsCoords(array = A.MASK_DWI_t0, Neighborhood = "3D_N18")
res3DN18$group_size - res3DN18.bis$group_size # same result
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.