MyNixOS website logo
Description

Estimation of Fractal Dimension of a Black Area in 2D and 3D (Slices) Images.

Estimate the of fractal dimension of a black area in 2D and 3D (slices) images using the box-counting method. See Klinkenberg B. (1994) <doi:10.1007/BF02065874>.

fractD

The goal of fractD is to ...

Installation

You can install the released version of fractD from CRAN with:

install.packages("fractD")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("mfpok/fractD")

The package fractD contains two fuctions fract2D and fract3D that allow to estimate the fractal dimension (D) of 2D and 3D images. Fractal dimension is estimated by the method of box-counting. Box-counting method is useful to calculate the fractal dimension of various sets of any dimension and patterns with or withouth self-similarity (Klinkenberg, 1994). The method overlay a series of squares (for fract2D) or cubes (for fract3D) of different sizes. Then, for each size step the functions keep track of the number of squares or cubes occupied by the black area into the image. Finally, the fractal dimension (D) is estimated by linear regression of log(n°boxes) on log(box.size).

The following illustration show the rational behind the function fract2D:

Example

Here an example of applying fract2D to the following image:

library(fractD)
## basic example code for fract2D
fct2D <- fract2D(dir = "vignettes/examples/source.dir", box.size = c(1,2,4,8,16,32,64,128,256,512))

## the following code saves the data in a file named "es3D.rds" into the "output"" folder 
## not run ## 
##fct2D <- fract2D(dir = "examples/source.dir", box.size = c(1,2,4,8,16,32,64,128,256,512), save.dir = "examples/output/", save.name = "es2D")
# the function create a list with two objects: 
fct2D$D # Estimated fractal dimension
#>      id      D
#> 1 fig_1 1.7669

fct2D$raw.dat # Raw data from which fractal dimension was calculated 
#>       id box.size    box
#> 1  fig_1        1 328905
#> 2  fig_1        2  86845
#> 3  fig_1        4  23155
#> 4  fig_1        8   6207
#> 5  fig_1       16   1681
#> 6  fig_1       32    462
#> 7  fig_1       64    135
#> 8  fig_1      128     44
#> 9  fig_1      256     17
#> 10 fig_1      512      6

The following illustration show the rational behind the function fract3D:

Example

Here an example of applying fract3D to the following image:

library(fractD)
## basic example code for fract3D
# save.dir and save.name provide optional 
fct3D <- fract3D(dir = "vignettes/examples/source.dir", dist.slice = 10, box.size = c(1,2,4,8,16,32,64,128,256,512))

## the following code saves the data in a file named "es3D.rds" into the "output"" folder 
## not run ## 
## fct3D <- fract3D(dir = "examples/source.dir", dist.slice = 1, box.size = c(1,2,4,8,16,32,64,128,256,512), save.dir = "examples/output/", save.name = "es3D")
# the function create a list with two objects: 
fct3D$D # Estimated fractal dimension
#>          id      D
#> 1 es_3D_img 2.2215

fct3D$raw.dat # Raw data from which fractal dimension was calculated 
#>           id box.size     box
#> 1  es_3D_img        1 4816960
#> 2  es_3D_img        2  759820
#> 3  es_3D_img        4  120164
#> 4  es_3D_img        8   22632
#> 5  es_3D_img       16    4066
#> 6  es_3D_img       32     736
#> 7  es_3D_img       64     135
#> 8  es_3D_img      128      43
#> 9  es_3D_img      256      17
#> 10 es_3D_img      512       6

References

  • Mandelbrot B.B. (1982) - . San Francisco: W.H. Freman.
  • Klinkenberg B. (1994) - . Mathematical Geology, vol. 26, n° 1.
  • Dubuc B., Quiniou J.F., Roques-Carmes C., Tricot C., Zucker S.W. (1989) - . Physical Review A, vol. 39, n° 3.
  • Taud H and Parrot J-F (2005) - . Géomorphologie: relief, processus, environnement: 4, 327-338.
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows