Learn R Programming

⚠️There's a newer version (0.5.5) of this package.Take me there.

fsbrain (version 0.1.0)

Managing and Visualizing Brain Surface Data

Description

Provides high-level access to 'FreeSurfer' neuroimaging data on the level of subjects and groups. Load morphometry data, surfaces and brain parcellations based on atlases. Mask data using labels, load data for specific atlas regions only, and visualize the results directly in 'R'.

Copy Link

Version

Install

install.packages('fsbrain')

Monthly Downloads

446

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Tim Schc3<a4>fer

Last Published

April 15th, 2020

Functions in fsbrain (0.1.0)

brainview.si

Visualize a list of colored meshes from a single viewpoint, interactively.
brainview.t4

Visualize a list of colored meshes from four angles.
coloredmesh.from.color

Create a coloredmesh from a mesh and pre-defined colors.
brainview.sr

Visualize a list of colored meshes, rotating the camera around them.
brainview.t9

Visualize a list of colored meshes from nine angles.
coloredmesh.from.label

Create a coloredmesh from a label.
apply.labeldata.to.morphdata

Apply a label to morphometry data.
apply.label.to.morphdata

Load a label from file and apply it to morphometry data.
coloredmeshes.from.color

Create coloredmeshes for both hemis using pre-defined colors.
find.subjectsdir.of

Find the subject directory containing the fsaverage subject (or others) on disk.
coloredmesh.plot.colorbar.separate

Draw colorbar for coloredmeshes in separate 2D plot.
brainviews

Show one or more views of the given meshes in rgl windows.
clip.data

Clip data at quantiles to remove outliers.
flip2D

Flip a 2D matrix.
apply.transform

Apply matmult transformation to input.
boxcoords.from.bbox

Compute the coordinates of the 8 corners of a 3D box.
collayer.bg.sulc

Compute binarized sulcal depth surface color layer.
collayer.bg.meancurv

Compute binarized mean curvature surface color layer.
arrange.brainview.images

Combine several brainview images into a new figure.
collayers.merge

Merge two or more color layers based on their transparency values.
brainview.sd

Visualize a list of colored meshes from a single defined angle.
coloredmesh.from.morph.standard

Create a coloredmesh from standard space morphometry data.
combine.colorbar.with.brainview.image

Combine a colorbar and a brainview image into a new figure.
cube3D.tris

Return triangles for a 3D cube or cuboid.
coloredmesh.from.annot

Create a coloredmesh from an annotation of an atlas.
download_optional_data

Download optional data for this package if required.
collayer.bg

Compute binarized mean curvature surface color layer.
coloredmesh.from.morphdata

Create a coloredmesh from arbitrary data.
collayer.bg.atlas

Compute atlas or annotation surface color layer.
draw.colorbar

Draw coloredbar into background of current plot.
get.rglstyle.shiny

Get a shiny visualization style.
cubes3D.tris

Vectorized version of cube3D.tris
delete_all_optional_data

Delete all data in the package cache.
collayer.from.mask.data

Compute surface color layer from morph-like data.
get.slice.indices

Compute slice indices from slice definition.
find.freesurferhome

Find the FREESURFER_HOME directory on disk.
face.edges

Enumerate all edges of the given faces or mesh.
collayer.from.morphlike.data

Compute surface color layer from morph-like data.
fup

Transform first character of a string to uppercase.
get.atlas.region.names

Determine atlas region names from a subject.
alphablend

Perform alpha blending for pairs of RGBA colors.
annot.outline

Compute outline vertex colors from annotation.
group.agg.atlas.standard

Aggregate standard space morphometry data over brain atlas regions and subjects for a group of subjects.
group.annot

Load annotations for a group of subjects.
group.morph.native

Retrieve native space morphometry data for a group of subjects.
desaturate

Perform simple desaturation or grayscale conversion of RGBA colors.
download_fsaverage

Download the FreeSurfer v6 fsaverage subject.
collayer.from.annot

Compute surface color layer from annotation or atlas data.
group.morph.standard

Retrieve standard space morphometry data for a group of subjects.
fs.value.list.from.agg.res

Create a named value list from a dataframe.
fsbrain.renderable

Check whether object can be rendered by fsbrain
collayer.from.annotdata

Compute surface color layer from annotation or atlas data.
group.concat.measures.native

Concatenate native space data for a group of subjects.
hemilist.derive.hemi

Derive 'hemi' string from the data in a hemilist
hasIn

Check for values in nested named lists
coloredmesh.from.mask

Create a coloredmesh from a mask.
group.concat.measures.standard

Concatenate standard space data for a group of subjects.
get.view.angle.names

Get list of valid view angle names.
coloredmesh.from.morph.native

Create a coloredmesh from native space morphometry data.
label.to.annot

Merge several labels into an annotation
getIn

Retrieve values from nested named lists
colorlist.brain.clusters

Return diverging color list
combine.colorbar.with.brainview.animation

Combine a colorbar and a brain animation in gif format into a new animation.
labeldata.from.mask

Create labeldata from a mask.
flip3D

Flip a 3D array along an axis.
fs.coloredmesh

fs.coloredmesh constructor
group.label.from.annot

Extract a region from an atlas annotation as a label for a group of subjects.
group.label

Retrieve label data for a group of subjects.
is.fs.coloredvoxels

Check whether object is an fs.coloredvoxels instance (S3)
get.rglstyle

Get the default visualization style parameters as a named list.
is.hemilist

Check whether x is a hemilist
get_optional_data_filepath

Access a single file from the package cache by its file name.
get.rglstyle.default

Get the default visualization style parameters as a named list.
group.agg.atlas.native

Aggregate native space morphometry data over brain atlas regions and subjects for a group of subjects.
hemilist.wrap

Wrap data into a named hemi list.
mesh.vertex.neighbors

Compute neighborhood of a vertex
hull.retain.along.axis

Copy the first *n* foreground voxel values.
list_optional_data

Get file names available in package cache.
magick.grid

Arrange a multi-frame ImageMagick image into a grid.
print.fs.coloredmesh

Print description of a brain coloredmesh (S3).
normalize

Normalize data.
get.rglstyle.parameters

Produce the named list of style parameters from style definition.
print.fs.coloredvoxels

Print description of fs.coloredvoxels (S3).
ras2vox_tkr

The FreeSurfer default ras2vox_tkr matrix.
merge.hemi.annots

Merge the annotations from two hemispheres into one annot.
mesh.vertex.included.faces

Return all faces which are made up completely of the listed vertices.
group.morph.agg.native

Aggregate native space morphometry data over one hemisphere for a group of subjects.
read.md.demographics

Read demographics file
group.morph.agg.standard

Aggregate standard space (fsaverage) morphometry data over one hemisphere for a group of subjects.
group.multimorph.agg.native

Aggregate native space morphometry data for multiple measures over hemispheres for a group of subjects.
hemilist.get.combined.data

Get combined data of hemi list
get.rglstyle.semitransparent

Get the semi-transparent visualization style parameters as a named list.
readable.volume

Find files with the given base name and extensions that exist.
hemilist.unwrap

Unwrap hemi data from a named hemi list.
subject.filepath.morph.native

Construct filepath of native space morphometry data file.
regions.to.ignore

Give suggestions for regions to ignore for an atlas.
subject.filepath.any

Construct filepath of any freesurfer file.
read.colorcsv

Read colors from CSV file.
sort.coloredmeshes.by.hemi

Sort coloredmeshes into 2 lists by their 'hemi' property.
subject.volume

Read a brain volume.
subject.surface

Load a surface for a subject.
read.md.subjects

Read subjects file
subject.label.from.annot

Extract a region from an atlas annotation as a label for a subject.
subject.mask

Compute a mask for a subject.
spread.values.over.annot

Spread a single value for a region to all region vertices.
group.multimorph.agg.standard

Aggregate standard space (fsaverage) morphometry data for multiple measures over hemispheres for a group of subjects.
vis.coloredmeshes.rotating

Visualize a list of colored meshes in a single scene and rotate them, movie-style.
vis.data.on.fsaverage

Visualize arbitrary data on the fsaverage template subject, if available.
vis.coloredmesh

Draw a coloredmesh using a style.
subject.annot

Load an annotation for a subject.
vis.coloredmeshes

Visualize a list of colored meshes in a single scene.
vis.subject.morph.standard

Visualize native space morphometry data for a subject.
vis.rotated.coloredmeshes

Rotate and visualize coloredmeshes, applying a style.
write.region.values

Write one value per atlas region for a subject.
vis.subject.annot

Visualize an annotation for a subject.
vol.merge

Merge background volume and overlay to new colors.
vol.overlay.colors.from.activation

Generate colors for a 3D volume, based on the activation data and a colormap.
subject.atlas.agg

Aggregate morphometry data over brain atlas regions for a subject.
vis.symmetric.data.on.subject

Visualize clusters or activation data on the surface of any subject.
write.region.values.fsaverage

Write one value per atlas region for a template subject.
label.border

Compute border of a label.
subject.morph.native

Retrieve native space morphometry data for a single subject.
is.Triangles3D

Check whether object is a Triangles3D instance
label.from.annotdata

Extract a region from an annotation as a label.
report.on.demographics

Print a demographics report
mask.from.labeldata.for.hemi

Create a binary mask from labels.
makecmakeopts.merge

Create final `makecmap_options` list
is.fs.coloredmesh

Check whether object is an fs.coloredmesh (S3)
subject.morph.standard

Retrieve standard space morphometry data for a single subject.
vol.overlay.colors.from.colortable

Compute voxel colors based on colortable.
rglactions.has.key

Check for a key in names of rglactions.
vol.plane.axes

Get indices of the axes defining the given plane.
subject.filepath.morph.standard

Construct filepath of standard space morphometry data file.
volvis.contour

Visualize contour of a volume.
vis.data.on.subject

Visualize arbitrary data on the surface of any subject.
vol.vox.from.crs

Compute R voxel index for FreeSurfer CRS voxel index.
spread.values.over.subject

Spread the values in the region_value_list and return them for one hemisphere.
spread.values.over.hemi

Spread the values in the region_value_list and return them for one hemisphere.
subject.label

Retrieve label data for a single subject.
vis.mask.on.subject

Visualize a vertex mask on the surface of a subject.
vis.path.along.verts

Draw a 3D line from vertex to vertex
vislayout.from.coloredmeshes

Visualize coloredmeshes from several angles and combine the images into a new figure.
vis.labeldata.on.subject

Visualize a label on the surface of a subject.
vis.subject.morph.native

Visualize native space morphometry data for a subject.
perform.na.mapping

Perform NA mapping for transparency
vol.boundary.box.apply

Apply a boundary box to a volume, returning the inner volume part
vis.subject.label

Visualize a binary label for a subject.
vol.boundary.box

Compute 3D bounding box of a volume.
rglvoxels

Draw 3D boxes at locations using rgl.
rotate3D

Rotate a 3D array in 90 degree steps.
perform.rglactions

Perform rglactions, like taking screenshots.
vol.planes

Translate names and indices of planes.
vol.slice

Extract a slice of a 3D image stack.
test.numerical.meandiff

Perform tests for group differences on paired or unpaired data for two groups.
vol.hull

Retain only the outer hull voxels of the foreground.
rotate90

Rotate 2D matrix clockwise in 90 degree steps.
vol.imagestack

Turn volume into an ImageMagick image stack.
vis.region.values.on.subject

Visualize arbitrary data, one value per atlas region, on the surface of any subject (including template subjects).
vis.color.on.subject

Visualize pre-defined vertex colors on a subject.
rotate2D

Rotate a 2D matrix in 90 degree steps.
vox2ras_tkr

The FreeSurfer default vox2ras_tkr matrix.
write.region.aggregated

Write data aggregated over regions to morphometry file for group.
vol.boundary.mask

Compute foreground pixels over the whole 3D imagestack.
test.numerical.meandiff.unpaired

Perform tests for group differences on unpaired data for two groups.
test.numerical.meandiff.paired

Perform tests for group differences on paired data (repeated measurements) for two conditions or time points.
vis.renderable

Visualize a renderable object
vol.intensity.to.color

Convert integer intensity image to RGB color string form.
vol.mask.from.segmentation

Extract subset from a volume by value.
volvis.voxels

Voxel-based visualization of volume mask at surface RAS positions.
volvis.lightbox

Draw a lightbox view from volume slices.