View source: R/brainview_magick.R
vislayout.from.coloredmeshes | R Documentation |
Create a tight layout view of coloredmeshes from several angles. Creates separate 'sd_<angle>' images, then crops and finally merges them into a single output image with image magick. The 'coloredmeshes' to pass to this function are usually obtained by running any 'vis*' function (like vis.subject.morph.native
, vis.subject.morph.standard
, vis.subject.label
, vis.subject.annot
, and others). That means you can use this function to visualize all kinds of data, e.g., morphometry data in native and standard space, labels, and brain atlases.
vislayout.from.coloredmeshes(
coloredmeshes,
view_angles = get.view.angle.names(angle_set = "t4"),
rgloptions = rglo(),
rglactions = list(),
style = "default",
output_img = "fsbrain_arranged.png",
silent = FALSE,
grid_like = TRUE,
background_color = "white",
transparency_color = NULL
)
coloredmeshes |
list of coloredmesh. A coloredmesh is a named list as returned by the 'coloredmesh.from*' functions (like |
view_angles |
list of strings. See |
rgloptions |
option list passed to |
rglactions |
named list. A list in which the names are from a set of pre-defined actions. The values can be used to specify parameters for the action. |
style |
character string, a rendering style, e.g., 'default', 'shiny' or 'semitransparent'. Alternatively, a named list of style parameters (see |
output_img |
string, path to the output file. Defaults to "fsbrain_arranged.png" |
silent |
logical, whether to suppress all messages |
grid_like |
logical, whether to arrange the images in a grid-like fashion. If FALSE, they will all be merged horizontally. Passed to |
background_color |
hex color string (like '#FFFFFF'), the color to use for the background. Ignored if 'transparency_color' is not NULL. To get a transparent background, use 'transparency_color' instead of this parameter. WARNING: Do not use color names (like 'gray'), as their interpretation differs between rgl and image magick! |
transparency_color |
hex color string (like '#FFFFFF'), the temporary background color that will get mapped to transparency, or NULL if you do not want a transparent background. If used, it can be any color that does not occur in the foreground. Try '#FFFFFF' (white) or '#000000' (black) if in doubt. WARNING: Do not use color names (like 'gray'), as their interpretation differs between rgl and image magick! |
named list, see arrange.brainview.images
for details
Other visualization functions:
highlight.vertices.on.subject()
,
highlight.vertices.on.subject.spheres()
,
vis.color.on.subject()
,
vis.data.on.fsaverage()
,
vis.data.on.subject()
,
vis.labeldata.on.subject()
,
vis.mask.on.subject()
,
vis.region.values.on.subject()
,
vis.subject.annot()
,
vis.subject.label()
,
vis.subject.morph.native()
,
vis.subject.morph.standard()
,
vis.subject.pre()
,
vis.symmetric.data.on.subject()
## Not run:
fsbrain::download_optional_data();
subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
# Use any vis function to get coloredmeshes. You can visualize morphometry,
# labels, an atlas, whatever. You can suppress the view unless you need it.
coloredmeshes = vis.subject.morph.native(subjects_dir, "subject1", "thickness",
cortex_only=TRUE, rglactions=list("clip_data"=c(0.05, 0.95)),
views=NULL);
# The meshes contain the surface, data, and color information and can be
# visualized. You could adapt the rendering style while doing so:
vislayout.from.coloredmeshes(coloredmeshes, style='shiny');
# You could change the rendering style on a per-mesh basis.
coloredmeshes[[1]]$style = list("shininess"=50, alpha=0.5);
vislayout.from.coloredmeshes(coloredmeshes, style='from_mesh');
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.