Learn R Programming

fslr (version 2.25.3)

fslcog: Image Center of Gravity (FSL)

Description

Find Center of Gravity of Image from FSL

Usage

fslcog(img, mm = TRUE, verbose = TRUE, ts = FALSE)

Value

Vector of length 3 unless ts option invoked

Arguments

img

Object of class nifti, or path of file

mm

Logical if the center of gravity (COG) would be in mm (default TRUE) or voxels (FALSE)

verbose

(logical) print out command before running

ts

(logical) is the series a timeseries (4D), invoking -t option

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))
fslcog(img)
}

Run the code above in your browser using DataLab