tortuosity               package:SoPhy               R Documentation

_V_a_r_i_a_b_i_l_i_t_y _o_f _t_h_e _t_o_r_t_u_o_s_i_t_y

_D_e_s_c_r_i_p_t_i_o_n:

     The function estimates the ratio between the mean tortuosity and
     the smallest tortuosity from profiles of Brilliant Blue tracer
     experiments

_U_s_a_g_e:

       tortuosity(depth, freq,range.depth, range.xi, len.xi=100,
                  lower.bound.m = 1.005, tolerance.m=0.01, PrintLevel=0) 

_A_r_g_u_m_e_n_t_s:

   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

_V_a_l_u_e:

     '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

_A_u_t_h_o_r(_s):

     Martin Schlather, schlath@hsu-hh.de <URL:
     http://www.unibw-hamburg.de/WWEB/math/schlath/schlather.html>

_R_e_f_e_r_e_n_c_e_s:

     Schlather, M. and Huwe, B. (2005) A characteristic for the
     variability of tortuosity. _Submitted._

_E_x_a_m_p_l_e_s:

     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)

