Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fslcog

Image Center of Gravity (FSL)


Description

Find Center of Gravity of Image from FSL

Usage

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

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

Value

Vector of length 3 unless ts option invoked

Note

FSL uses a 0-based indexing system, which will give you a different answer compared to cog, but fslcog(img, mm = FALSE) +1 should be relatively close to cog(img)

Examples

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)
}

fslr

Wrapper Functions for 'FSL' ('FMRIB' Software Library) from Functional MRI of the Brain ('FMRIB')

v2.24.1
GPL-3
Authors
John Muschelli [aut, cre] (<https://orcid.org/0000-0001-6469-1750>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.