makeCube: Cubic Volume

View source: R/makeCube.R

makeCubeR Documentation

Cubic Volume

Description

Generates a Cubic volume of user's specified size.

Usage

makeCube(nvoxel, offset = 2)

Arguments

nvoxel

number of voxels along the side of the cube.

offset

number of voxels of the border around the cubic volume

Details

makeCube is used by the function makeVOI to extract VOIs from a 3D volume.

Value

coords

a matrix of voxel coordinates of the cube.

volume

a binarised 3D array of the volume of the cube.

Author(s)

Alessio Veneziano

Examples

#Create a volume of a 21x21x21 cube with 2 voxels of offset
cube<-makeCube(21,2)

#Plot the 3D coords of the cube
require(rgl)
points3d(cube$coords,col="grey",size=2)

#Plot a slice of the volume (the cube is in white pixels)
image(cube$volume[,,10],col=grey(0:32/32))


AlessioVeneziano/indianaBones documentation built on Nov. 29, 2022, 12:21 a.m.