fi <- antsImageRead(getANTsRData("r16") )
mi <- antsImageRead(getANTsRData("r64") )
fi<-resampleImage(fi,c(60,60),1,0)
mi<-resampleImage(mi,c(60,60),1,0) # speed up
mytx <- antsRegistration(fixed=fi, moving=mi, typeofTransform = c('SyN') )
mywarpedimage <- antsApplyTransforms( fixed=fi, moving=mi,
transformlist=mytx$fwdtransforms )
## Not run: # quick visualization fix for images with odd orientation
# mni = antsImageRead( getANTsRData( "mni" ) )
# strokt1=antsImageRead('strokt1.nii.gz')
# strokt1reg=antsRegistration(
# fixed=mni,
# moving=strokt1,
# typeofTransform = "QuickRigid",verbose=TRUE )
# plot( strokt1reg$warpedmovout, axis=3, nslices=20)
# # now - how to use a mask
# fi <- antsImageRead(getANTsRData("r16") )
# fiseg = kmeansSegmentation( fi, 3 )
# mi <- antsImageRead(getANTsRData("r64") )
# msk = thresholdImage(fiseg$segmentation, 0, 0 )
# mytx <- antsRegistration(fixed=fi, moving=mi, typeofTransform = c('SyNCC'),
# mask=msk, verbose=F )
# jac = createJacobianDeterminantImage( fi, mytx$fwdtransforms[1] )
# ## End(Not run)
Run the code above in your browser using DataLab