mesh.from.bin: Creation of a mesh according to a binary volume

mesh.from.binR Documentation

Creation of a mesh according to a binary volume

Description

The mesh.from.bin function creates a mesh class object from a volume object of "binary" modality.

Usage

mesh.from.bin(
  bin,
  alias = "",
  tol = min(abs(bin$dxyz))/2,
  smooth.iteration = 10,
  smooth.type = c("taubin", "laplace", "HClaplace", "fujiLaplace", "angWeight",
    "surfPreserveLaplace"),
  smooth.lambda = 0.5,
  smooth.mu = -0.53,
  smooth.delta = 0.1,
  verbose = FALSE
)

Arguments

bin

"volume" class object of "binary" modality.

alias

Character string, $alias of the mesh defining the $alias of the created object.

tol

Tolerance in mm, applied for mesh simplification. See vcgClean. The default value, equal to half the smallest voxel edge, limits meshing errors.

smooth.iteration

Number of iterations applied in the smoothing algorithm. See vcgSmooth.

smooth.type

character: select smoothing algorithm. Available are "taubin", "laplace", "HClaplace", "fujiLaplace", "angWeight" (and any sensible abbreviations). By default, set to "taubin". See vcgSmooth.

smooth.lambda

numeric: parameter for Taubin smooth. See vcgSmooth.

smooth.mu

numeric: parameter for Taubin smooth. See vcgSmooth.

smooth.delta

numeric: parameter for Scale dependent laplacian smoothing (see reference below).and maximum allowed angle (in radians) for deviation between normals Laplacian (surface preserving). See vcgSmooth.

verbose

Boolean, by default set to FALSE. Allows you to inhibit comments.

Value

Returns a "mesh" class object. This is a list including the following 6 elements:

  • $patient: set to bin$patient.

  • $patient.bd: set to bin$patient.bd.

  • $patient.name: set to bin$patient.name.

  • $patient.sex: set to bin$patient.sex.

  • $file.basename: set to "".

  • $file.dirname: set to "".

  • $object.name: set to "".

  • $object.alias: set to the alias argument of the function.

  • $frame.of.reference: set to bin$frame.of.reference.

  • $ref.pseudo : set to bin$ref.pseudo.

  • $modality : set to "mesh".

  • $description: By default, set to paste (bin$object.alias, "mesh").

  • $creation.date: set to Sys.Date.

  • $nb.faces: set to the number of faces of the mesh.

  • $mesh: list of 3 elements defining the mesh:

    - $vb: array made up of the generalized coordinates (x, y, z, 1) of the vertices of the triangles.
    There are as many columns as there are vertices.
    - $it: array of the 3 indices of the vertices forming a triangle, arranged by column.
    There are as many columns as there are triangles in the mesh.
    - $normals: array made up of the generalized coordinates (x, y, z, 1) of the normal vectors of each triangle.
    There are as many columns as there are vertices.

Note

To compute the mesh, all NA voxels of the binary volume bin are set to FALSE. If all voxels are equal to FALSE, the function returns the code NULL.

See Also

vcgSmooth

Examples

# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = c("ct", "rtstruct"), roi.name = "",
                             dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]

# creation of the patient mesh
bin <- bin.from.roi (CT, struct = S, roi.name = "patient", verbose = FALSE)
mesh.patient <- mesh.from.bin (bin, alias = "patient", verbose = FALSE)
str (mesh.patient)

espadon documentation built on April 11, 2025, 5:57 p.m.