oldpar <- par( no.readonly=TRUE )
# forward transform
dt <- dtcwt( blossom )
par( mfrow=c(2,3), mar=rep(2,4) )
for( j in 1:6 ){
image( blossom, col=grey.colors(32,0,1) )
contour( Mod( dt[[3]][ ,,j ] )**2, add=TRUE, col="green" )
}
par( oldpar )
# exmaple for the inverse transform
blossom_i <- idtcwt( dt )
image( blossom - blossom_i )
# example for a non-square case
boy <- blossom[50:120, 50:150]
bc <- put_in_mirror(boy, 128)
dt <- dtcwt(bc$res)
idt <- idtcwt(dt)[ bc$px, bc$py ]
Run the code above in your browser using DataLab