fan.to.voxel {espadon}R Documentation

Indices of voxels crossed by a fan

Description

The fan.to.voxel function computes the indices of voxels crossed by a fan. It is useful for retrieving voxel values and voxel indices of a volume (dose or ct) along the fan rays.

Usage

fan.to.voxel(vol, fan, restrict = FALSE, vol.value = 1)

Arguments

vol

"volume" class object.

fan

"fan" class object created by fan.sphere for example.

restrict

Boolean. If TRUE, only the voxels with a value equal to vol.value are taken into account.

vol.value

Value of the voxels taken into account, in case of restrict = TRUE

Value

Returns a dataframe of 4 columns. Each line gives:

If the rays do not cross any voxel, the dataframe has no row.

See Also

fan.beam, fan.planar, fan.sphere.

Examples

vol <- vol.create (pt000 = c(1,10,10), dxyz = c (1 , 1, 1),
                   n.ijk = c(100, 100, 100)) 
fan.origin <- c (50,50,50)                         
fan <- fan.sphere (angle = 10, origin = fan.origin)
fan.voxel <- fan.to.voxel (vol = vol, fan = fan)
head (fan.voxel)

# Use of the 2nd column of fan.voxel to select voxels 
bin <- vol.copy (vol, modality = "binary")
bin$vol3D.data[] <- FALSE
bin$vol3D.data[fan.voxel[,2]] <- TRUE
bin$max.pixel <- TRUE
bin$min.pixel <- FALSE
display.kplane(bin, k=10)

[Package espadon version 1.7.0 Index]