cog: Image Center of Gravity

Description Usage Arguments Value Examples

View source: R/cog.R

Description

Find Center of Gravity of Image, after thresholding

Usage

1
cog(img, thresh = 0, ceil = FALSE, warn = TRUE)

Arguments

img

Object of class nifti

thresh

threshold for image, will find img > 0

ceil

Run ceiling to force integers (usu for plotting)

warn

Produce a warning if the image is empty after thresholding

Value

Vector of length 3

Examples

1
2
3
4
5
6
dims = rep(20, 3)
x = array(rnorm(prod(dims)), dim = dims)
img = nifti(x, dim= dims, 
datatype = convert.datatype()$FLOAT32, cal.min = min(x), 
cal.max = max(x), pixdim = rep(1, 4))
cog(img)

neuroconductor-devel/neurobase documentation built on May 6, 2021, 1:48 p.m.