do.neurocdf: Aggregate values in ROI

Description Usage Arguments Details Value Author(s)

View source: R/do.R

Description

Aggregate values in ROI

Usage

1
2
3
4
5
6
  ## S3 method for class 'neurocdf'
 do(object, roi, fun, type = 1,
    margin = 2, na.rm = TRUE, na.rm.margin = 2,
    slice = NULL, plane = 3, x, y, z, realworld = FALSE,
    atlas = 2, var = "GlobalImage", mc.cores = 4,
    chunksize = 1000/mc.cores, exclude, ...)

Arguments

object

Filename of (neuro-)netcdf file

roi

Region of interest. Either a string or number defining the region in the atlas of 'x', or a nx3 matrix with voxel positions defining the region. If an attribute type="mm" is set, the voxel positions are treated as real world coordinates, and in the other case as voxel indices (vx).

fun

Optional function to apply. If missing the actual image values in each voxel is returned.

type

The image type number (if 0 all images will be used)

margin

Function applied row-wise (1) or column-wise (2). If 0 only the ROI coordinates are returned.

na.rm

Should NA values be removed (complete-cases)

na.rm.margin

Complete-cases defined from columns (2) or rows (1)

slice

Slice number

plane

Coordinate (row 1, column 2, slice 3)

x

row

y

column

z

slice

realworld

If TRUE real world coordinates are returned as the element mm.

atlas

Position of atlas among 'var' images

var

The variable in the neuro netCDF file from which the atlas is chosen.

mc.cores

Number of cores to be used in parallel computing

chunksize

Chunk size (parallel computing)

exclude

Index of subjects to exclude

...

Additional arguments parsed to lower level functions

Details

A kxn matrix is extracted where n is the number of voxels in the region, and k is the number of subjects/images. Optionally a function can be applied over columns of rows of this matrix.

Value

A list with voxel coordinates (vx), real world coordinates (mm) if realworld=TRUE, and aggregated image values val.

Author(s)

Klaus K. Holst


kkholst/neurocdf documentation built on May 20, 2019, 10:59 a.m.