# eptransf2d: Two-dimensional Ensemble Patch Transform of an Image In EPT: Ensemble Patch Transform, Visualization and Decomposition

## Description

This function performs two-dimensional ensemble patch transform of an image for a size parameter.

## Usage

 1 2 3 4  eptransf2d(x = NULL, y = NULL, z, type = "rectangle", tau, theta = 0, process = c("average", "average"), pquantile = c(0, 1), equantile = c(0, 1), gamma = 1, boundary = "reflexive") 

## Arguments

 x, y locations of regular grid at which the values in image z are measured. When those are NULL, the image is supposed to be equally spaced. z matrix of an image observed at location (x, y). type patch type of "rectangle" or "oval". tau a size parameter for two-dimensional ensemble patch transform: tau[1] for horizontal size and tau[2] for vertical size of a two-dimensional patch. When length(tau) is 1, the horizontal and vertical size are the same. theta a degree of clockwise rotation of a patch. process specifies transform types for patch and ensemble processes: process[1] for patch process and process[2] for ensemble process. Each process has options of "average", "median", or "envelope". Note that when process[1] is "average" or "median", process[2] must be "average" or "median". When process[1] is "envelope", lower and upper envelopes are obtained by \code{pquantile[1]} \times 100 \%-quantile and \code{pquantile[2]} \times 100 \%-quantile of patches, respectively. When process[2] is "envelope", ensemble lower and upper envelopes are obtained as \code{equantile[1]} \times 100 \%-quantile and \code{equantile[2]} \times 100 \%-quantile of lower and upper envelopes of shifted patches, respectively. pquantile quantiles for lower and upper envelopes of patch transform. When it is c(0, 1), minimum and maximum of a patch are used for lower and upper envelopes, respectively. equantile quantiles for lower and upper envelopes of ensemble patch transform. gamma controls the amount of envelope magnitude. boundary specifies boundary condition from "reflexive", "periodic" or "none".

## Details

This function performs two-dimensional ensemble patch transform of an image for a size parameter tau, and produces statistics and envelopes for two-dimensional ensemble patch transform. When process[1] is "average" or "median", outputs related to envelopes are defined as NULL. When process[2] is "envelope", outputs, pstat and Epstat, are defined as NULL.

## Value

 x, y locations of regular grid at which the values in image z are measured. When it is NULL, the image is supposed to be equally spaced. z matrix of an image observed at location (x, y). pstat centrality of patch transform for size parameter tau. Epstat centrality of ensemble patch transform for size parameter tau. psd standard deviation of patch transform for size parameter tau. Epsd standard deviation of ensemble patch transform for size parameter tau. pL lower envelope of patch transform for size parameter tau. pU upper envelope of patch transform for size parameter tau. pM mean envelope, (pL + pU) / 2, of patch transform for size parameter tau. pR distance between lower and upper envelopes, (pU - pL), of patch transform for size parameter tau. EpL lower envelope of ensemble patch transform for size parameter tau. EpU upper envelope of ensemble patch transform for size parameter tau. EpM mean envelope, (EpL + EpU) / 2, of ensemble patch transform for size parameter tau. EpR distance between lower and upper envelopes, (EpU - EpL), of ensemble patch transform for size parameter tau. parameters a list of input parameters of type, tau, theta, process, pquantile, equantile, gamma, and boundary. nlevel the number of size parameter tau. For eptransf2d(), nlevel is 1.

meptransf2d, eptdecomp2d.
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #### 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") #### 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") par(op)