bpt.2d(x, crystal.names=NULL, basis="block.bpt.2d", partition = NULL,
cost.fun="threshold",
n.levels=6, taper="poly2", boundary="zero",
n.taper=8, scale=NULL, thresh=NULL, p=1, prob=.75)
ibpt.2d(x)
bpt.2d, an image or matrix. Row length must be
divisible by
2^(n.levels) and
column length must be divisible by
2^(n.levels).
If mean(x) != 0, should de-mean first (see below). For
ibpt.2d,
an object of
bpt.2d.
"bj.h-bj.v".
where
j is an integer giving the level and
h is an integer from
0 to
2^j-1
giving the horizontal block number and
v is an integer from
0 to
2^j-1
giving the vertical block number.
If
crystal.names is supplied, then
basis is ignored.
"best.basis",
"block.bpt.2d" or
"gbpt.2d".
See the respective help files for details.
"gbpt.2d" basis is used. See the help for function
"gbpt.2d" for
details on how to specify the partition.
"entropy",
"threshold",
"sure", and "
lp" are available.
Only used for
"best.basis".
See
bp.costs.2d for details.
x is divided into
2^(2*n.levels)
nrow(x)/2^n.levels by
ncol(x)/2^n.levels
blocks. For
"best.basis",
n.levels gives the blocking factor for the finest level.
When both
crystal.names and
basis are missing,
2D subband basis of
n.levels is computed.
If
n.levels is bigger than
ml, where
ml is the maximum possible level,
computed from the
max.level function, then
n.levels is set to
ml and
a warning message is given.
"boxcar", "poly1", "poly2", "poly3", "poly4", "poly5", or
"trig".
See the function
bp.table for details.
"reflect", "periodic"
and
"zero".
See the function
bp.table for details.
2*n.taper.
By default,
n.taper is set to the smaller of 8 or
length(x)/2^(n.level+1),
which is the maximum possible length at the finest blocking level.
cost.fun.
See the function
bp.costs.2d for details.
(0,2] giving the degree of the
lpnorm when
cost.fun is
"lp".
See the function
bp.costs.2d for details.
cost.fun is
"threshold" or
"sure".
See the function
bp.costs.2d for details.
(0,1) used to
compute the threshold for when
cost.fun is
"threshold".
See the function
bp.costs.2d for details.
bpt.2d returns an object of class
bpt.2d, inheriting from
the class
crystal.matrix.
The object is a matrix of the same size as
x with crystal names as an
attribute.
ibpt.2d returns an image if
x is an object of class
bpt.2d.
The default optional arguments
n.levels, taper, boundary
can be reset using function
wavelet.options, see
wavelet.options for
details.
The algorithms for the taper functions are given in the
S+WAVELETS User's Manual,
in the section "Cosine Packet Algorithms". They are discussed in
greater depth in Wickerhauser (1994).
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis from Theory to Software. A. K. Peters Ltd, Wellesley, MA.
Meyer, F.G. and Coifman, R.R. (1997), Brushlets: A tool for directional image analysis and image compression Applied and Computational Harmonic Analysis, Academic Press Publishers.
xx <- brain-mean(brain) par(mfrow=c(1,2)) image(xx) bpt.xx <- bpt.2d(xx, basis="best.basis") plot(bpt.xx)