Learn R Programming

fslr (version 1.3)

cog: Image Center of Gravity

Description

Find Center of Gravity of Image, after thresholding

Usage

cog(img, thresh = 0, ceil = FALSE)

Arguments

img
Object of class nifti
thresh
threshold for image, will find img > 0
ceil
Run ceiling to force integers (usu for plotting)

Value

  • Vector of length 3

Examples

Run this code
if (have.fsl()){
x = array(rnorm(1e6), dim = c(100, 100, 100))
img = nifti(x, dim= c(100, 100, 100),
datatype = convert.datatype()$FLOAT32, cal.min = min(x),
cal.max = max(x), pixdim = rep(1, 4))
cog(img)
}

Run the code above in your browser using DataLab