Construct a triangular mesh from a 3D volumetric mask
vol2spde(mask, res, nbhd_order = 1, buffer = c(1, 1, 3, 4, 4))
An inla.spde2 object.
An array of 0s and 1s representing a volumetric mask
The spatial resolution in each direction, in mm. For example, c(2,2,2) indicates 2mm isotropic voxels.
For volumetric data, what order neighborhood around data locations to keep? (0 = no neighbors, 1 = 1st-order neighbors, 2 = 1st- and 2nd-order neighbors, etc.). Smaller values will provide greater computational efficiency at the cost of higher variance around the edge of the data.
For volumetric data, size of extra voxels layers around the bounding box, in terms of voxels. Set to NULL for no buffer.
This function requires the INLA
package, which is not a CRAN package.
See https://www.r-inla.org/download-install for easy installation instructions.