Learn R Programming

ANTsR (version 1.0)

jointIntensityFusion: joint intensity fusion

Description

Estimates an image from another set of images - intensity generalization of joint label fusion. Search radius used only when employing labels - WIP to speed it up.

Usage

jointIntensityFusion(targetI, targetIMask, atlasList, beta = 4, rad = NA,
  labelList = NA, doscale = TRUE, doNormalize = TRUE,
  maxAtlasAtVoxel = c(1, Inf), rho = 0.01, useSaferComputation = FALSE,
  usecor = FALSE, boundary.condition = "mean", rSearch = 2,
  segvals = NA, includezero = FALSE)

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

useSaferComputation

slower but more error checking

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

includezero

boolean - try to predict the zero label

Value

approximated image, segmentation and probabilities

Examples

Run this code
# NOT RUN {
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
d<-2
pp<-jointIntensityFusion(ref,refmask,ilist, rSearch=0,
  labelList=seglist, rad=rep(r,d) )
# }

Run the code above in your browser using DataLab