view_surf | R Documentation |
"surf"
object(s)Visualize one or two "surf"
objects(s), or the "surf"
component(s) in a "xifti"
using an interactive Open GL window
made with rgl
. The rgl
package is required.
view_surf(
...,
view = c("both", "lateral", "medial"),
widget = NULL,
title = NULL,
fname = FALSE,
cex.title = NULL,
text_color = "black",
bg = NULL,
alpha = 1,
edge_color = NULL,
vertex_color = NULL,
vertex_size = 0,
material = NULL,
width = NULL,
height = NULL,
zoom = NULL
)
... |
One of: A |
view |
Which view to display: |
widget |
Display the plot in an htmlwidget? Should be logical or
|
title |
Optional title(s) for the plot(s). It will be printed at the top in a separate subplot with 1/4 the height of the brain cortex subplots. Default: To use a custom title(s), use a length 1 character vector (same title for
each plot) or length If the title is non-empty but does not appear, try lowering |
fname |
Save the plot(s) (and color legend if applicable)? If If If neither of the cases above apply, a png image will be written for each
|
cex.title |
Font size multiplier for the title. |
text_color |
Color for text in title and colorbar legend. Default:
|
bg |
Background color. |
alpha |
Transparency value for mesh coloring, between 0 and 1. Default:
|
edge_color |
Outline each edge in this color. Default: |
vertex_color |
Draw each vertex in this color. Default:
|
vertex_size |
Draw each vertex with this size. Default: |
material |
A list of materials from |
width , height |
The dimensions of the RGL window, in pixels. If both are
The plot will be taller than If multiple |
zoom |
Adjust the sizes of the brain meshes. Default: |
This function works as a wrapper to view_xifti_surface
, but
some arguments are not applicable (e.g. color scheme and legend). Also,
instead of using the hemisphere
argument, name the surface arguments
surfL
or surfR
(see description for parameter ...
).
Finally, the default value for param
is "surf"
, not
"xifti"
.
To navigate the interactive Open GL window and html widget, left click and
drag the cursor to rotate the meshes. Use the scroll wheel or right click
and drag to zoom. Press the scroll wheel and drag to change the field-of-view.
For Open GL windows, execute
snapshot
to save the current window as a .png file,
close3d
to close the window, and
view3d
to programmatically control the
perspective.
To embed an interactive plot in an R Markdown document, first execute
rgl::setupKnitr()
to prepare the document for embedding the widget.
Then execute the plot command as you normally would to create a widget (i.e.
without specifying fname
, and by requesting more than one idx
or by setting widget
to TRUE
). When the R Markdown document is
knitted, the interactive widget should be displayed below the chunk in which
the plot command was executed. See the vignette for an example.
To embed a static plot in an R Markdown document, first execute
rgl::setupKnitr()
to prepare the document for embedding the snapshot
of the Open GL window. Then execute the plot command as you normally would
to create an Open GL window (i.e. without specifying fname
, and by
requesting only one idx
). In the options for the chunk in which the
plot command is executed, set rgl=TRUE, format="png"
. You can also
control the image dimensions here e.g. fig.height=3.8, fig.width=5
.
When the R Markdown document is knitted, the static plots should be
displayed below the chunk in which the plot command was executed. See the
vignette for an example.
Other visualizing:
view_comp()
,
view_xifti()
,
view_xifti_surface()
,
view_xifti_volume()
Other surface-related:
add_surf()
,
boundary_mask_surf()
,
edit_mask_surf()
,
even_vert_samp()
,
is.surf()
,
load_surf()
,
mask_surf()
,
read_surf()
,
resample_surf()
,
rotate_surf()
,
surf_area()
,
write_surf_gifti()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.