Learn R Programming

ANTsR (version 0.3.3)

abpBrainExtraction: An ants-based brain extraction script.

Description

Brain extraction based on mapping a template image and its mask to the input image. Should be preceded by abpN4.

Usage

abpBrainExtraction(img = NA, tem = NA, temmask = NA, temregmask = NA, regtype = "SyN", tdir = NA)

Arguments

img
whole head image to which we map a brain mask
tem
Template image (the whole head) which has an associated label mask.
temmask
Template's antsImage brain mask.
temregmask
Template's registration mask including skull but not the face
regtype
registration type: 'SyN' (fast, default), 'SyNabp' (better, slower)
tdir
temporary directory (optional)

Value

outputs a brain image and brain mask.

Examples

Run this code

fn<-getANTsRData("r16")
img<-antsImageRead(fn)
img<-resampleImage(img,c(128,128),1,0)
tf<-getANTsRData("r27")
tem<-antsImageRead(tf)
tem<-resampleImage(tem,c(128,128),1,0)
temmask<-antsImageClone( tem )
temmask[ tem  > 20 ]<-1
temmask[ tem  <= 20 ]<-0
bm<-abpBrainExtraction(img=img,tem=tem,temmask=temmask)

Run the code above in your browser using DataLab