Visualizing 3D Objects with RMINC

As of RMINC 1.3 we’ve begun to support visualizing 3D volumes with R. This document is designed to showcase a few of these features.

#Load in our libraries
library(RMINC)
library(rgl)

Lets pull in a demonstration object file. The file format currently supported by RMINC is the BIC-MNI text obj format, documented on their github. This file format is used by CIVET, amongst other tools, to store brain surfaces. The figures produced are interactive and can be rotated and magnified with the mouse.

mouse_cortex <- 
  read_obj("/axiom2/projects/software/cortical-thickness/MWM/c57bl6_laplacian_grid_full_surface_simplified.obj")

plot(mouse_cortex)

In addition to creating surfaces, it is possible to add thresholdable statistics maps with colour legends

demo_stats <- #Generate some random uniform vertex data
  runif(ncol(mouse_cortex$vertex_matrix))

plot(mouse_cortex, demo_stats, colour_range = c(.5,1))