# NOT RUN {
#### example : composite of two components having different frequencies
nr <- nc <- 128; x <- seq(0, 1, length=nr); y <- seq(0, 1, length=nc)
coscomp1 <- outer(cos(20 * pi * x), cos(20 * pi * y))
coscomp2 <- outer(cos(5* pi * x), cos(5 * pi * y))
cosmeanf <- coscomp1 + coscomp2
op <- par(mfcol=c(3,1), mar=c(0,0.5,2,0.5))
image(cosmeanf, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="a composite image")
image(coscomp1, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="high-frequency component")
image(coscomp2, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="low-frequency component")
# }
# NOT RUN {
#### Ensemble average of Ensemble Patch Transform
outcos <- eptransf2d(z=cosmeanf, tau=12)
rangez <- range(cosmeanf)
par(mfrow=c(3,1), mar=c(2,2,2,1))
image(outcos$Epstat, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, zlim=rangez,
main="ensemble average of patch mean")
persp(outcos$Epstat, theta = -30, phi = 45, col = "white", xlab="X", ylab="Y",
main="ensemble average of patch mean")
image(outcos$Epsd, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main="ensemble average of standard deviation")
#### Ensemble Envelope of Ensemble Patch Transform
outcos2 <- eptransf2d(z=cosmeanf, tau=12, process = c("envelope", "average"))
par(mfrow=c(2,2), mar=c(2,2,2,1))
image(outcos2$EpL, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main="ensemble average of lower envelope")
image(outcos2$EpU, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main="ensemble average of upper envelope")
image(outcos2$EpM, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main="ensemble average of mean envelope")
image(outcos2$Epsd, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main="ensemble average of standard deviation")
# }
# NOT RUN {
par(op)
# }
Run the code above in your browser using DataLab