read_atlas: Read atlas and key text files and compose useful dataframes

Description Usage Arguments Details Value Examples

View source: R/data_methods.R

Description

The assumption is that the atlas text file was created with 3dmaskdump (AFNI), which writes out both voxel indexes (i,j,k) and voxel coordinates (x,y,z). The i,j,k values are not used to within this package, but might be included in the text file. If txt_has_ijk=TRUE, the first 3 columns (containing the i,j,k values) will be dropped.

Usage

1
2
read_atlas(atlas_file, key_file = NULL, txt_has_index = FALSE,
  txt_has_ijk = TRUE)

Arguments

atlas_file

Output from 3dmaskdump; space-delimited text file with one row per voxel. The last column of each row is the voxel value. The voxel values should correspond to indexes found in the first column of the key file.

key_file

aparc.a2009s+aseg_rank.niml.lt, or some subset thereof. First column is an index, and the second column is a label. If a key file is not provided, the atlas cannot be labeled, and atlas regions across hemispheres cannot be grouped.

txt_has_index

Flag to indicate whether the first column of the atlas_file is a 1D voxel index. Default: FALSE

txt_has_ijk

Flag to indicate whether the first three columns of the atlas_file is are the 3D voxel indexes i,j,k. Default: TRUE

Details

X axis: Left-Right Y axis: Anterior-Posterior Z axis: Inferior-Superior

Value

A list containing the parsed and formatted atlas and key.

Examples

1
2
3
4
## Not run: 
  read_atlas(atlas_file, key_file, txt_has_index=FALSE, txt_has_ijk=TRUE)

## End(Not run)

crcox/ShinyATLROI documentation built on May 14, 2019, 11:33 a.m.