# doc-cache created by Octave 4.2.0
# name: cache
# type: cell
# rows: 3
# columns: 3
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
fujii


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1517

  This function implements the Fujii Technique [1]. Use as
  input data a 3D matrix created grouping NTIMES intensity matrices I(k)
  1<=k<=NTIMES

  I(k)=DATA(:,:,k)

  $FUJII=\sum\limits_{k=1}^{NTIMES-1} \frac{|I(k)-I(k+1)|}{I(k)+I(k+1)+eps}$

  The function is normalized to:

  $Y=FUJII \frac{200}{NTIMES-1}$

  Where (NTIMES-1) is the number of elements in the sum, 2 is a factor to
  to do $(I(k)+I(k+1))/2$, a mean value, and 100 is a percentage factor.
  Thus the Y matrix represents the expected percentage value of absolute difference 
  $|I(k)-I(k+1)|$ relative to the mean value $(I(k)+I(k+1))/2$ for any two 
  consecutive values.

  $Y \approx 100*E[\frac{|I(k)-I(k+1)|}{(I(k)+I(k+1))/2}]$

  References:
  [1] FUJII, H. et al. Evaluation of blood flow by laser speckle image sensing. 
      Applied Optics, New York, v. 26, n. 24, p. 5321-5325, 1987.


  After starting the main routine just type the following command at the
  prompt:
  Y = fujii(DATA);
  
  Input:
  DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES 
       intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then
       N(1,1) represents NLIN and
       N(1,2) represents NCOL and
       N(1,3) represents NTIMES.
  SHOW [Optional] If SHOW is equal to the string 'off', then do not plot the result.

  Output:
  Y   returns the Fujii matrix.


  For help, bug reports and feature suggestions, please visit:
  http://nongnu.org/bsltl




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53

  This function implements the Fujii Technique [1].



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
gendiff


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1533

  This function implements the Generalized Difference Technique [1]. Use as
  input data a 3D matrix created grouping NTIMES intensity matrices I(k)
  1<=k<=NTIMES

  I(k)=DATA(:,:,k)

  $GD=\sum\limits_{k=1}^{NTIMES-1} \sum\limits_{l=1}^{NTIMES-k} |I(k)-I(k+l)|$

  The function is normalized  with the number of elements in the sum.

  $Y=\frac{GD}{\binom{NTIMES}{2}}$

  Where $\binom{NTIMES}{2}$ is the binomial coefficient of NTIMES and 
  2. It is the number of combinations of NTIMES items taken 2 at a time.
  Thus Y matrix represents the expected value of absolute difference 
  $|I(k1)-I(k2)|$ for any two different k1 and k2 values.

  $Y\approx E[|I(k1)-I(k2)|]$

  Reference:
  [1] ARIZAGA, R. et al. Display of the local activity using dynamical speckle 
      patterns. Optical Engineering, Redondo Beach, v. 41, n. 2, p. 287-294, 
      June 2002.


  After starting the main routine just type the following command at the
  prompt:
  Y = gendiff(DATA);
    
  Input:
  DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES 
       intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then
       N(1,1) represents NLIN and
       N(1,2) represents NCOL and
       N(1,3) represents NTIMES.
  SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result.

  Output:
  Y    returns the Generalized Difference matrix.


  For help, bug reports and feature suggestions, please visit:
  http://nongnu.org/bsltl




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70

  This function implements the Generalized Difference Technique [1].



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
stdcont


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1674

  This function implements the temporal speckle contrast matrix [1], the temporal 
  speckle standard deviation matrix and the temporal speckle mean matrix. Use as
  input data a 3D matrix created grouping NTIMES intensity matrices I(k)
  1<=k<=NTIMES

  I(k)=DATA(:,:,k)

  $MU= \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} I(k) \approx E[I(k)]$

  $SIGMA = \sqrt{ \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} (I(k)-MU)^2  }$

  With difference of proposed in [1], here is used the population standard
  deviation. Finally

  $C = SIGMA/MU$

  The function additionally also returns the deviation and expected matrices.

  Reference:
  [1] R. Nothdurft and G. Yao, 'Imaging obscured subsurface inhomogeneity using 
      laser speckle,' Opt. Express  13, 10034-10039 (2005). 


  After starting the main routine just type the following command at the
  prompt:
  C       = stdcont(DATA);
  [C D]   = stdcont(DATA);
  [C D E] = stdcont(DATA);
    
  Input:
  DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES 
       intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then
       N(1,1) represents NLIN and
       N(1,2) represents NCOL and
       N(1,3) represents NTIMES.
  SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result.

  Output:
  C    returns the speckle contrast matrix of image Data Pack.
  D    [Optional] Returns the standard deviation matrix (SIGMA) of image Data Pack.
  E    [Optional] Returns the expected matrix (MU) of image Data Pack.


  For help, bug reports and feature suggestions, please visit:
  http://nongnu.org/bsltl




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80

  This function implements the temporal speckle contrast matrix [1], the tempo





