A list containing the filled volume and parameters used to generate
the volume
Arguments
surface
a surface mesh, can be mesh objects from rgl or
freesurferformats packages
inflate
amount of 'voxels' to inflate on the final result; must be
a non-negative integer. A zero inflate value means the resulting
volume is tightly close to the surface
IJK2RAS
volume 'IJK' (zero-indexed coordinate index) to
'tkrRAS' transform, default is automatically determined
leave it `NULL` if you don't know how to set it
preview
whether to preview the results; default is false
preview_frame
integer from 1 to 256 the depth frame used to generate
preview.
Author
Zhengjia Wang
Details
This function creates a volume (256 on each margin) and fill in
the volume from a surface mesh. The surface vertex points will be embedded
into the volume first. These points may not be connected together, hence
for each 'voxel', a cube patch will be applied to grow the volume. Then,
the volume will be bucket-filled from a corner, forming a negated mask of
"outside-of-surface" area. The inverted bucket-filled volume is then shrunk
so the mask boundary tightly fits the surface