Learn R Programming

ANTsR (version 0.3.3)

jointLabelFusion: joint label fusion

Description

A multiple atlas voting scheme to customize labels for a new subject.

Usage

jointLabelFusion(targetI, targetIMask, atlasList, beta = 4, rad = NA, labelList = NA, doscale = TRUE, doNormalize = TRUE, maxAtlasAtVoxel = c(1, Inf), rho = 0.01, usecor = FALSE, boundary.condition = "image", rSearch = 2, segvals = NA, probimgs = NA, jifImage = NA)

Arguments

targetI
antsImage to be approximated
targetIMask
mask with value 1
atlasList
list containing antsImages
beta
weight sharpness, default to 2
rad
neighborhood radius, default to 4
labelList
list containing antsImages
doscale
scale neighborhood intensities
doNormalize
normalize each image range to 0, 1
maxAtlasAtVoxel
min/max n atlases to use at each voxel
rho
ridge penalty increases robustness to outliers but also makes image converge to average
usecor
employ correlation as local similarity
boundary.condition
one of 'image' 'mean' 'NA'
rSearch
radius of search, default is 2
segvals
list of labels to expect
probimgs
list of probability images (to help slice by slice estimate)
jifImage
the current estimated jif image (helps speed slice by slice)

Value

approximated image, segmentation and probabilities

Examples

Run this code

set.seed(123)
ref<-antsImageRead( getANTsRData("r16"))
ref<-resampleImage(ref,c(50,50),1,0)
ref<-iMath(ref,"Normalize")
mi<-antsImageRead( getANTsRData("r27"))
mi2<-antsImageRead( getANTsRData("r30"))
mi3<-antsImageRead( getANTsRData("r62"))
mi4<-antsImageRead( getANTsRData("r64"))
mi5<-antsImageRead( getANTsRData("r85"))
refmask<-getMask(ref)
refmask<-iMath(refmask,"ME",2) # just to speed things up
ilist<-list(mi,mi2,mi3,mi4,mi5)
seglist<-list()
for ( i in 1:length(ilist) )
 {
 ilist[[i]]<-iMath(ilist[[i]],"Normalize")
 mytx<-antsRegistration(fixed=ref , moving=ilist[[i]] ,
   typeofTransform = c("Affine") )
 mywarpedimage<-antsApplyTransforms(fixed=ref,moving=ilist[[i]],
   transformlist=mytx$fwdtransforms)
 ilist[[i]]=mywarpedimage
 seg<-kmeansSegmentation( ilist[[i]], k=3, kmask = refmask)
 seglist[[i]]<-seg$segmentation
 }
r<-2
pp<-jointLabelFusion(ref,refmask,ilist, rSearch=2,
  labelList=seglist, rad=rep(r, length(dim(ref)) ) )

Run the code above in your browser using DataLab