setGraphicOptions: Sets Graphic Options

Description Usage Arguments Details Value See Also Examples

View source: R/utils.R

Description

Set graphic options for digitMesh.mesh3d() and digitMesh.character().

Usage

1
2
3
4
5
6
7
8
setGraphicOptions(winNb=1, winSize= rbind(c(0,50,830,904), c(840,50,1672,904)), winSynchro=TRUE,
                  meshVertCol=TRUE, meshColor=rep("gray",2), meshAlpha=rep(1,2), meshShade=rep(TRUE,2),
                  meshPoints=c(FALSE,TRUE), meshWire=rep(FALSE,2),
                  PCplanesDraw=FALSE, PCplanesColor= "cyan", PCplanesAlpha=0.7,
                  intersectLines=TRUE, intersectPoints=FALSE, intersectColor="red",
                  spheresRad=0.02, spheresColor=matrix(c("black","blue"),2,2), spheresAlpha=1,
                  labelCex=2, labelColor="magenta", labelAdj=0.02,
                  zoomPercDist=0.15, zoomPtsDraw=TRUE, zoomPtsCol="orange", zoomSeeLm=FALSE)

Arguments

winNb

A numeric value within {1,2} setting for the number of grahical devices:
- 1 (default) for a single device subdivided into 2 parts (one for the decimated mesh, the other for the zoomed mesh);
- 2 for two separate devices.
Warning: For Mac users, only the setting with 2 separate devices is supported. The OS will be automatically detected when calling the digitMesh() function and winNb will be force to be 2 in case of a call from a Mac OS.

winSize

A vector or matrix indicating the size and positioning of graphical device(s):
- a vector with 4 positive values indicating the left, top, right and bottom (in pixels, see the help for the windowRect parameter in par3d for the device (when winNb=1);
- a 2*4 matrix of positive values, each line indicating as before the left, top, right and bottom (in pixels) for each device (when winNb=2).

winSynchro

A logical value indicating if user interaction (zoom, rotation) applied on a mesh should be synchronously applied on the second one (decimated or full mesh). Only Works for winNb=1.
Default: TRUE for synchronization.

meshVertCol

A logical value indicating if the original vertex colors should be kept (TRUE) or not (FALSE). In the last case, a uniform color specified by the meshColor will be used.

meshColor

A character vector of length 1 or 2 indicating the color(s) for mesh plotting. Values for meshColor should be taken from colors(). A 1-length vector will apply the same color for full and decimated mesh, and a 2-length will apply the first color for the decimated mesh and the second one for the full mesh.
Note: for the meshShade and the meshWire options, but not for the meshPoints option (see details after), this color won't overwrite the color stored in the material$color (if any) from the mesh3d object for plotting. This color will be used only if the material$color is NULL.
Default: rep("gray",2) => both meshes in gray.

meshAlpha

A character vector of length 1 or 2 indicating the alpha value(s) (transparency) for mesh plotting. It will overwrite the alpha value stored in material$alpha (if any). Values for meshAlpha should be taken within [0,1]. A 1-length vector will apply the same alpha for full and decimated mesh, and a 2-length vector will apply the first alpha for the decimated mesh and the second one for the full mesh.
Default: rep(1,2) => both meshes totally opaque.

meshShade

Logical vector of length 1 or 2 indicating if the meshes should be plotted or not via shade3d. TRUE value will use shade3d, and FALSE won't. A 1-length vector will apply the same value for both meshes and a 2-length will apply the first value for decimated mesh, and the second one for full mesh.
Note: each mesh should be plotted through one of the 3 possible representations ( meshShade, meshPoints, meshWire), meaning that at least one TRUE value in this parameter is needed for each mesh. If not filled, meshShade will be automatically set to TRUE.
Default: rep(TRUE,2) to use shade3d for both meshes.

meshPoints

Identical to meshShade to plot the mesh using using points3d.
Default: c(FALSE,TRUE) to use points3d only for the full mesh.

meshWire

Identical to meshShade to plot the mesh using wire3d.
Default: rep(FALSE,2) to not use wire3d for both meshes.

PCplanesDraw

A 1-length logical or a character vector of length 1, 2 or 3 indicating if major planes (from mesh principal components) as well as their intersections with the mesh should be plotted, and interactively set by user before the landmark digitizing step. Possible settings:
- TRUE (or FALSE): in this case all (or no one of) the 3 major planes will be (or won't be) plotted;
- any combination of the values within {"pc1-pc2","pc1-pc3","pc2-pc3"} indicating which particular plane(s) should be plotted.
Default: FALSE to not draw the planes and their intersections.

PCplanesColor

A character vector taking values within colors() indicating with which color each plane should be plotted. If only one value is given for more than one plane, the color value is recycled. Otherwise, this vector should have the same length than the number of plotted planes.
Default: "cyan".

PCplanesAlpha

A numerical vector taking values within [0,1] indicating with which transparency (alpha value) each plane should be plotted. If only one value is given for more than one plane, the alpha value is recycled. Otherwise, this vector should have the same length than the number of plotted planes.
Default: 0.7.

intersectLines

A logical vector indicating for each intersection plane if the lines3d mode of representation should be use to figure the mesh/major plane intersection. If only one value is given for more than one plane, the logical value is recycled. Otherwise, this vector should have the same length than the number of plotted planes.
Note 1: each intersection should be plotted through one of the 2 possible representations (intersectLines,intersectPoints), meaning that at least one TRUE value in this parameter is needed for each mesh. If no, intersectLines will be automatically set to TRUE.
Note 2: for big meshes, the intersection plotting can be fasten by setting intersectLines to FALSE.
Default: TRUE.

intersectPoints

Identical to intersectLines to plot the interstions using points3d.
Default: FALSE.

intersectColor

A character vector taking values within colors() indicating with which color each intersection should be plotted. If only one value is given for more than one plane, the color value is recycled. Otherwise, this vector should have the same length than the number of plotted planes.
Default: "red".

spheresRad

A numerical vector or matrix taking values within [0,1] indicating with which radius the spheres figuring the landmarks should be plotted. Actually, the radius is expressed as a fraction of the mesh dimensions(so better values are close to 0). Possible settings:
- a 2*2 matrix, the 1st line corresponding to the setting before user validation and the 2nd one after, the 1st column correspondng to the setting for the decimated mesh and the second one for the zoomed full mesh;
- a vector of length 2 corresponding to the setting before user validation and the 2nd one after (those values will be recycled for the full mesh);
- a unique value for the setting before and after the user validation, and for the decimated and the full mesh.
Default: 0.01.

spheresColor

A character vector or matrix taking values within colors() indicating with which color the spheres figuring the landmarks should be plotted. See spheresRad for possible settings.
Default: matrix(c("black","blue"),2,2) to plot on both meshes spheres in black while the landmark has not been validated, and in blue after.

spheresAlpha

A numerical vector or matrix taking values within [0,1] indicating with which transparency (alpha value) the spheres figuring the landmarks should be plotted. See spheresRad for possible settings.
Default: 1 (no transparency for spheres).

labelCex

A numerical vector or matrix taking positive values indicating with which size the landmark labels should be plotted. See See spheresRad for possible settings.
Default: 2.

labelColor

A character vector or matrix taking values within colors() indicating with which color the landmark labels should be plotted. See spheresRad for possible settings.
Default: "magenta".

labelAdj

A numerical vector or matrix or array taking values within [0,1] indicating how to adjust the label location relative to the landmark sphere. Possible settings:
- a 2*2*2 array, the 1st line corresponding to the setting before user validation and the 2nd one after, the 1st column correspondng to the setting for the decimated mesh and the second one for the full mesh, the first slice corresponding to the horizontal adjustment and the second one to the vertical adjustment;
- a 2*2 matrix corresonding to the slide for horizontal adjustment which will be recycled for vertical adjustment;
- a vector of length 2 corresponding to the setting before user validation and the 2nd one after (those values will be recycled for the full mesh and the vertical adjustment);
- a unique value for the setting before and after the user validation (recycled for the full mesh and the vertical adjustment).
Default: 0.02.

zoomPercDist

A numerical value within [0,1] specifying the extent of the zoomed full mesh. This extent is computed as the maximal distance between the clicked point and the mesh points multiplied by zoomPercDist.
Default: 0.15.

zoomPtsDraw

A logical value indicating if the exent of the zoomed mesh should be shown on the decimated mesh. This extent will be represented as a 3D point cloud.
Default: TRUE.

zoomPtsCol

A character value taking values within colors() indicating with which color the zoom extent (if zoomPtsDraw is set to TRUE) should be plotted.
Default: "orange".

zoomSeeLm

A logical value indicating if the landmark placed by user on the decimated mesh should be visible on the zoomed mesh. It will slightly fasten the process of the landmark digitizing enabling the direct validation (without any manual change) of the placed landmark, but at the risk of a more or less important approximation on the landmark positioning depending on the degree of decimation used for the decimated mesh.
Default: FALSE.

Details

This function allows user to set several parameters for graphical rendering for the landmark digitization process performed through the call of either digitMesh.mesh3d() or digitMesh.character(). With no arguments, this function returns the default settings for graphic options. Any of those options can be modified by setting new values for the corresponding arguments. Non-filled arguments will be set to default. Ill-filled arguments will return errors or warnings.

The arguments for graphic options are categorized by themes, and concerns: window options, mesh rendering options, major plane options, mesh/major plane intersection options, sphere options, labelling options and zoom options.

- the window options allow to set the number of grahical devices (winNb), their size and positioning (winSize) and the synchronization or not between full and decimated meshes of the user action (rotation, zoom: winSynchro);

- the mesh rendering options allow to play on mesh color (meshColor), its transparency (meshAlpha), its mode of representation (shading for meshShade, 3D points for meshPoints, 3D wire for meshWire);

- the major plane options allow to perform or not the preliminary step of major plane adjustement before landmark digitization (PCplanesDraw), to set their color and transparency ( PCplanesColor, PCplanesAlpha);

- the mesh/major plane intersection options allow to set the mode of representation for the intersection lines among major planes and mesh (via 3D lines for intersectLines or 3D points for intersectPoints) and their color (codeintersectColor);

- the sphere options for landmark rendering allow to set their radius (spheresRad), their color (spheresColor), and their transparency (spheresAlpha);

- the labelling options for landmark numbering allow to set their size (labelCex), their color (labelColor) and their adjustment relative to the sphere (labelAdj);

- the zoom options allow to set the extent of the zoomed area (zoomPercDist), to project or not on the decimated mesh this extent (zoomPtsDraw) and to set its color (zoomPtsCol), and to display or not on the full mesh the landmark pre-positionned on the decimated mesh (zoomSeeLm).

Value

A list of those parameters gathered in sublists following the thematic categorization described above.

See Also

setDecimOptions, setFileOptions, setTemplOptions.

Examples

1
2
3
4
5
6
7
# returning default settings:
GrOpt<-setGraphicOptions()

# some possible settings (not exhaustive):
GrOpt<-setGraphicOptions(winNb=2, winSynchro= FALSE, PCplanesDraw=c("pc2-pc3"))
GrOpt<-setGraphicOptions(meshColor=c("gray","orange"), meshPoints=FALSE, zoomSeeLm=TRUE)
#...

morphOptics/digit3DLand documentation built on July 17, 2021, 8:27 p.m.