| tortuosity {SoPhy} | R Documentation |
The function estimates the ratio between the mean tortuosity and the smallest tortuosity from profiles of Brilliant Blue tracer experiments
tortuosity(depth, freq,range.depth, range.xi, len.xi=100,
lower.bound.m = 1.005, tolerance.m=0.01, PrintLevel=0)
depth |
depth in pixels |
freq |
number of stained pixels found in depth depth |
range.depth |
range of depths for which 1-H^* is fitted |
range.xi |
range of values of xi for which 1-H^* is fitted |
len.xi |
range.xi and len.xi define the grid
seq(min(range.xi), max(range.xi), len=len.xi) for which
1-H^* is fitted.
|
lower.bound.m |
lower bound for m used in the numerical optimisation |
tolerance.m |
non-negative value. If tolerance.m=0 only
the optimal xi is used to estimate m.
If tolerance.m>0 then all estimated m(D, xi)
are considered for which the span of m is less than or equal to
(1 + tolerance.m) times the minimal span value.
|
PrintLevel |
integer. If the value is greater than 1 then tracing information is given |
tortuosity returns a list of the following elements:
xi |
vector of length len.xi. It contains the values
of xi used in the algorithm |
raw.m |
matrix with len.xi rows. The number of colums
equals the number of depth values that are between the given
bounds range.depth. It contains
the fitted values of m |
span.xi |
vector of length len.xi contains span of all
raw.m values for the respective value of xi |
span.m |
vector of length len.xi.
It contains the difference between the largest and the smallest
value of raw.m for given xi
|
opt |
list of the optimal values: xi, m, s,
mspan (the span.xi found at xi) and D
(threshold depth)
|
input |
list of two vectors: freq and depth |
fitted |
list of two vectors that give the best fitted
curve: depth and p; the latter cannot be given
if tolerance.m>0 |
Martin Schlather, schlath@hsu-hh.de http://www.unibw-hamburg.de/WWEB/math/schlath/schlather.html
Schlather, M. and Huwe, B. (2005) A characteristic for the variability of tortuosity. Submitted.
data(F04)
path <- paste(system.file(package='SoPhy'),"tracer", sep="/")
F04$name <- paste(path, "F04.G.tif", sep="/")
m <- analyse.profile(F04, estimate.all=FALSE, method="fix.m",
selected.rate=c(0, 0), selected.dist=NULL,
interactive=FALSE, Print=0)
stained <- m$fct(m$picture, m$param)
freq <- m$absfr
truedepth <- m$r.i$data[, 1] + ncol(stained) - m$loc[[1]]$y[2]
tol = 0
mt <- tortuosity(truedepth, freq, range.depth=c(85, 97),
range.xi=c(-2.5, -0.6), Print=2, tol=tol)
str(mt$opt)
# fig. 3A in Schlather and Huwe (2005)
matplot(mt$xi, mt$raw.m, xlab=expression(xi), ylab="m",
type="l", col=1, lty=1)
# fig. 3B in Schlather and Huwe (2005)
plot(mt$xi, mt$span.m, xlab=expression(xi), ylab="span m",
type="l", col=1, lty=1)
for (cex in c(9, 9.5, 10))
points(mt$opt$x, mt$opt$mspan, cex=cex, col="darkgrey")
# fig. 2 in Schlather and Huwe (2005)
plot(mt$input$depth, mt$input$freq, xaxs="i", yaxs="i",
pch=16, ylab="stained pixels", xlab="depth [pixels]",
col="blue", cex=2)
lines(mt$fitted$depth, mt$fitted$p, lwd=3, col=2)