# NOT RUN {
## Example: MRI brain image segmentation
slicedata <- readsliceimg(fbase="t1_pn3_rf0", swap=FALSE)
image(slicedata$niislice, col=gray((0:255)/256), main="original image")
x0 <- premask(slicedata, subsamp=TRUE)
x <- prescale(x0)
rec <- 3000
res <- dpmixsim(x, M=1, a=1, b=2, upalpha=1, maxiter=4000,
rec=rec, nclinit=8)
## post-simulation
ngrid <- 200
z <- postdpmixciz(x, res=res, rec=rec, ngrid=ngrid, plot=TRUE)
# }
Run the code above in your browser using DataLab