makeSphere: Spheric Volume

View source: R/makeSphere.R

makeSphereR Documentation

Spheric Volume

Description

Generates a Spheric volume of user's specified size.

Usage

makeSphere(nvoxel, offset = 2)

Arguments

nvoxel

number of voxels along the diameter of the sphere.

offset

number of voxels of the border around the cubic volume

Details

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

Value

coords

a matrix of voxel coordinates of the sphere.

volume

a binarised 3D array of the volume of sphere.

Author(s)

Alessio Veneziano

Examples

#Create a volume of a 21 voxels diameter sphere with 2 voxels of offset
sph<-makeSphere(21,2)

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

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


AlessioVeneziano/IndianaBones documentation built on Dec. 2, 2022, 7:35 a.m.