Skip to contents

Calculate template 'MNI' coordinates for points on native brain

Usage

transform_point_to_template(
  subject,
  positions,
  space = c("scannerRAS", "tkrRAS"),
  mapping_method = c("volumetric", "surface"),
  flip_hemisphere = FALSE,
  verbose = TRUE,
  project_surface = "pial",
  volumetric_transform = c("auto", "affine", "nonlinear"),
  ...
)

transform_thinfilm_to_mni152(
  subject,
  flip_hemisphere = FALSE,
  interpolator = 0.3,
  n_segments = c(16, 16),
  group_labels = NULL,
  project_surface = "pial",
  volumetric_transform = c("auto", "affine", "nonlinear")
)

Arguments

subject

'RAVE' subject

positions

optional matrix of 3 columns, either in scanner or surface space (specified by space); default is missing and will use the electrode localization results (electrodes.csv)

space

if positions is given, which native coordinate system should be used; default is native 'T1' (or 'scannerRAS'); alternative is 'FreeSurfer' surface coordinate (or 'tkrRAS')

mapping_method

whether the mapping is 'volumetric' or 'surface'; default is the former.

flip_hemisphere

whether to flip the hemisphere; default is FALSE

verbose

whether to verbose the mapping progress; default is true

project_surface

for surface mapping only, which surface to project electrodes onto; default is 'pial' surface, other common choices are 'white' for white-matter, or 'smoothwm' for smoothed white matter

volumetric_transform

for volume mapping only, which type of transform to use; default is 'auto' detecting and use non-linear deformation if exists, and fall back to 'affine' transform; other choices are 'affine' or 'nonlinear'

...

ignored

interpolator

whether the transform lean towards volume mapping (interpolator=0) or surface mapping (interpolator=1)

n_segments

positive integers with length of two: resolution of the mapping; default segments the thin-film array into 16 by 16 segments

group_labels

NULL (default) or a character vector indicating the group labels of thin-film electrodes; default assumes that all contacts are from thin-film electrodes.

Value

A table of electrode 'MNI' coordinates.

Examples


if(interactive()) {

transform_point_to_template('demo/DemoSubject', mapping_method = "volumetric")

}