Skip to content

Multivariate K means with ANTsR

stnava edited this page Mar 26, 2015 · 1 revision

Suppose you have multiple modalities and you want to segment based on their joint structure.

aa<-antsImageRead(modality1)
bb<-antsImageRead(modality2)
mm<-getMask( aa )
cl <- kmeans( cbind( aa[mm==1],  bb[mm==1] ) ,  3 )
km<-makeImage( mm, cl$cluster )

Compute the k probabilities:

# not done