VOI: Extract VOI from 3D image Stack

View source: R/VOI.R

VOIR Documentation

Extract VOI from 3D image Stack

Description

This function extracts a Volume Of Interest (VOI) of the desired size and shape from a 3D image stack.

Usage

VOI(Stack, shape = c("sphere", "cube"), size, pos)

Arguments

Stack

an image stack object

shape

maximum number of 3D pixels (voxels) considered as isolated islands

size

for a spheric VOI, the number of voxels along the diameter of the sphere; for a cubic VOI, number of voxels along the side of the cube.

pos

center position of the VOI.

Details

VOI is a simple function to extract a VOI from a 3D image stack. It needs careful positioning.

Value

An array of dimensions size x size x size containing the VOI subset from the image stack.

Author(s)

Alessio Veneziano

Examples

#Extract a spherical VOI at the barycenter of a Stack
data(exampleStack)
pos<-apply(which(Stack!=0,T),2,mean)
voi<-VOI(exampleStack,"sphere",50,pos)
image(voi[,,20])


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