Manual en PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Fractalyse 3.

0 (FracGIS)
User manual

Gilles Vuidel, Cécile Tannier and Pierre Frankhauser

2016-09-20
Contents

1
Part I

Generalities

2
Chapter 1

Introduction

1.1 About Fractalyse 3.0


Fractalyse is a software application for analysing 2D texture by fractal theory. The version 3 of Fractalyse
has been completely rewritten in Java language, to improve data management with GIS (Geographical
Information System) support, graphical user interface and performance with parallelism. It runs on any
computer supporting Java Virtual Machine.

1.2 Authors
Fractalyse has been developed by Gilles Vuidel, Cécile Tannier and Pierre Frankhauser at ThéMA labo-
ratory (University of Franche-Comté – CNRS).

1.3 Terms of use


Fractalyse is distributed free-of-charge. Users must cite the following reference in their publications: ????
The source code is available and licensed in GPLv3.

1.4 System requirements


Fractalyse 3.0 runs on any computer supporting Java 1.7 or later (PC under Linux, Windows, Mac, etc.).
However, when dealing with very large datasets, the amount of RAM memory in the computer will limit
the maximum image size that can be processed in a single run with Fractalyse. In addition, for some
methods, processing power (CPU) will determine the speed of computing. For details, see section 8 below.

1.5 Installing the software


Fractalyse can be downloaded from http://www.fractalyse.org
Download and install Java 1.7+ from java.com. If you have a 64-bit operating system, it is best to install
the 64-bit version of Java. Download fractalyse-3.0.jar and launch it.

3
Chapter 2

Input data

Fractalyse can read 2 types of data : vector and raster.

2.1 Data type

2.1.1 Vector format

Fractalyse support one vector format : Shapefile (.shp). This format is a vector GIS file format created
by ESRI for its GIS ArcGIS. It supports 3 type of geometry : point, line and polygon. Fractalyse support
all these geometry types.

2.1.2 Raster format

Fractalyse support 2 raster formats : TIFF and Ascii Grid.


Ascii grid is a text format. The image is written as a matrix preceded by a header of 5 lines :
ncols 5
nrows 5
xllcorner 0
yllcorner 0
cellsize 1
1 0 0 0 1
0 1 0 1 0
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
TIFF is a binary format commonly used for raster image. It can contains an extension named GeoTIFF,
which added spatial references to the image. Fractalyse can load TIFF image with or without GeoTIFF
extension. Fractalyse does not support RGB color image. You must convert your image in grayscale
mode before using Fractalyse.

4
Chapter 3

Fractal methods

This chapter explains the principles of the different fractal methods implemented in Fractalyse.

3.1 Unifractal dimension


Fractalyse implements 3 methods to estimate the fractal dimension :
ˆ box counting
ˆ dilation
ˆ correlation

3.1.1 Principles

Fractalyse implements different methods (box counting, dilation, correlation...) to measure fractal di-
mension which corresponds to different dimensions (Hausdorff, Minkowski, Correlation...). The process
of the measure is split in two part :
ˆ the counting method
ˆ the estimation module.

The counting method

Counting method goes step by step following an iteration principle. At each iteration step, the method
involved counting the number of black pixels contained in a counting window. From one step to the next,
the size of the counting window is enlarged. By doing that, we artificially change the level of analysis of
the image. So, for each method we have two elements varying according to the counting step (iteration
step) (i):
ˆ the number of counted elements (N )
ˆ the size of either the counting window or the reference element ().

Then, we obtain a series of points that can be represented on a Cartesian graph. The Y-axis corresponds
to the number of counted elements (N ) and the X-axis corresponds to the size of the counting window
or to the size of the reference element , with  increasing from step to step.

5
The estimation module

Mathematically, the series of points is a curve (named the empirical curve). The next stage is to fit
this empirical curve with another one, the estimated curve. If the empirical curve follows a fractal law,
the estimated curve has the form of a power law (parabolic or hyperbolic), and D represents the fractal
dimension.
N = D orN = − D
In most cases, the empirical curve is transformed on a log-log plot. The estimation of the fractal dimension
becomes a linear regression.
log N = log D = D log 

3.1.2 Box counting

This is the most used method to estimate fractal dimension. The image is covered by a quadratical grid
and the grid resolution  is then varied. Following the logic described earlier, for each value , the number
of squares N () containing any occupied point is counted.

3.1.3 Dilation

This method is based on the algorithm introduced by Minkowski and Bouligand to establish the dimension
of an object using the measure theory approach. In this analysis each occupied point is surrounded by a
square (or a circle) of size , the surface of which is considered to be completely occupied. The size of these
squares is then gradually enlarged, and we measure the total surface A() covered at each stage. As the
squares are enlarged, any details smaller than  are overlooked and we gradually obtain an approximation
of the original form. Because more and more squares overlap, the total occupied surface for a particular
value  is less than what it would be if the same number of occupied points that make up the original
form were surrounded individually. By dividing this total surface by the surface of a test square (2 ) or
circle (π 2 2 ), we get an approximation of the number of elements N () necessary to cover the whole.

3.1.4 Correlation

Each point of the image is surrounded with a small squared window. The number of occupied points
inside each window is enumerated. This allows the mean number of points per window of that given
size to be calculated. The same operation is applied for windows of increasing sizes. The X-axis of the
graph represents the size of the side of the counting window  = (2i + 1). The Y-axis represents the
mean number of counted points per window. (Because the theory underlying the correlation analysis
considers the simultaneous presence of two points at a certain distance, i.e. the mean distance between
a pair of built-up pixels, the correlation dimension is a second order fractal dimension. In a multi-fractal
theoretical framework, this correlation dimension should be extended to a series of three, four or more
points). In principle it is possible to choose any shape for the window, such as circle, hexagon, etc.
However, since pixels are square-like, the choice of a square helps to avoid rounding errors.

6
3.2 Local dimension

3.2.1 Radial

3.3 Multifracal

3.3.1 Dimension spectrum

3.3.2 Box counting

3.3.3 Wavelets

7
Part II

Graphical interface

8
Chapter 4

Data

Fractalyse can process 2 types of 2D data : vector and raster.

4.1 Loading data : File menu

4.1.1 Load vector data

Shapefile format is a vector GIS file format created by ESRI for its GIS ArcGIS. This format supports 3
type of geometry : point, line and polygon. Fractalyse support all these geometry types.
When the shapefile is loaded with the menu ”Load vector data”, a new layer is created and displayed.

4.1.2 Load raster data

Fractalyse support 2 raster formats : TIFF and Ascii Grid.


When the image file is loaded with the menu ”Load raster data”, a new layer is created and the image is
displayed. If the image contains only 0 and 1 value, Fractalyse set the layer as binary layer and set white
color for 0 and black color for 1. Otherwise, it sets a gray scale color ramp for the image. Color image
(RGB) are not supported.

4.2 Data manipulation : Tools menu


For some analyses the vector data type is not supported (for example correlation for lineal or polygonal
geometry) and for raster data type, most analyses need binary image. Fractalyse contains some functions
in Tools menu to convert vector to raster data (Rasterize menu) and to convert grayscale raster to binary
(Binarize menu).

9
4.2.1 Rasterize menu : convert vector to raster

4.2.2 Binarize menu : convert grayscale raster to black and white raster

4.2.3 Negative menu : inverse binary raster

Binary raster layer (ie. black and white) can be inversed by right clicking on the layer and select Negative
menu item. Black pixels become white pixels and whites become blacks.

4.2.4 Selection menu

10
Chapter 5

Fractal analysis

5.1 Vector menu

5.1.1 Box counting

5.1.2 Dilation

5.1.3 Radial

5.1.4 Multifractal

5.1.5 Batch

5.2 Raster menu

5.2.1 Box counting

5.2.2 Dilation

5.2.3 Correlation

5.2.4 Radial

5.2.5 Multiradial

5.2.6 Multifractal

5.3 Network menu

5.3.1 Radial

5.3.2 Desserte

5.3.3 Backbone

11
Chapter 6

Estimation module

6.1 Unifractal

6.2 Multifractal

12
Chapter 7

Miscellaneous

7.1 Preferences menu

7.1.1 Memory

7.1.2 Processors

7.2 Log window

13
Part III

Command line interface

14
Chapter 8

Prerequisite

Fractalyse can be used in command line interface (CLI). It is useful for executing Fractalyse on a distant
computer without a graphical interface, or batching some processes that are not available in the graphical
user interface (GUI).

8.1 Launch Fractalyse in CLI mode


First you have to open a terminal window. Then, go to the directory of the Fractalyse program with cd
command. Finally, type the following command to display the Fractalyse help screen :
java -jar fractalyse-3.0.jar --help
Result
Usage :
java -jar fractalyse.jar [-proc n]
...
...
You’re ready to use Fractalyse in CLI mode !

8.2 Syntax

8.2.1 Definition

Commands always start with a double dash (--).


A global option starts with only one dash (-).
A parameter does not have a dash.

8.2.2 Character separator

Blank spaces are used to separate commands and parameters. You cannot have a name containing blank
spaces.

8.2.3 Optional parameter

Parameters enclosed in brackets are optional. Therefore, parameters not in brackets are mandatory.

15
8.2.4 Command execution

Fractalyse can execute only one command.


java -jar fractalyse-3.0.jar ...

16
Chapter 9

Command reference

9.1 General command

9.1.1 –help : display help

Command :
java -jar fractalyse-3.0.jar --help
Result :
Usage :
java -jar fractalyse.jar [-mpi | -proc n] COMMAND
COMMAND:
--rasterize [neg] res=val file_1.shp [... file_n.shp]
--binarize min=val max=val file_1.tif [... file_n.tif]
--boxcounting SAMPLING [gliding=val] [estim=log|direct] file_1.shp [... file_n.shp]
--rboxcounting SAMPLING [estim=log|direct] file_1.tif [... file_n.tif]
--dilation SAMPLING [estim=log|direct] file_1.shp [... file_n.shp]
--rdilation SAMPLING [estim=log|direct] file_1.tif [... file_n.tif]
--correlation SAMPLING [estim=log|direct] file_1.tif [... file_n.tif]
SAMPLING:
[coef=val] [min=val] [max=val] [seq=arith|geom]

9.2 Data manipulation commands

9.2.1 –rasterize : convert vector to raster

--rasterize [neg] res=val file_1.shp [... file_n.shp ]

9.2.2 –binarize : convert grayscale raster to binary

--binarize min=val max=val file_1.tif [... file_n.tif ]

9.3 Fractal analysis commands

9.3.1 –boxcounting : box counting on vector data

--boxcounting SAMPLING [gliding=val ] [estim=log|direct] file_1.shp [... file_n.shp ]

17
9.3.2 –rboxcounting : box counting on raster data

--rboxcounting SAMPLING [estim=log|direct] file_1.tif [... file_n.tif ]

9.3.3 –dilation : dilation on vector data

--dilation SAMPLING [estim=log|direct] file_1.shp [... file_n.shp ]

9.3.4 –rdilation : dilation on raster data

--rdilation SAMPLING [estim=log|direct] file_1.tif [... file_n.tif ]

9.3.5 –correlation : correlation on raster data

--correlation SAMPLING [estim=log|direct] file_1.tif [... file_n.tif ]

9.3.6 Sampling

[coef=val ] [min=val ] [max=val ] [seq=arith|geom]

9.4 Options

9.4.1 -proc

Defines the number of processors (or cores) used by Fractalyse. By default, CLI mode uses the value
defined in the preferences window. See the parallelism section for more details.

9.4.2 -mpi

18
Chapter 10

Command examples

The following command will binarize all tif images contained in the current directory. For each .tif file,
it will create a new one where each pixel having a value between 1 and 10 will be set to 1 and others to
0. Each new file will have a name with the suffix: _bin1-10.tif.
java -jar fractalyse-3.0.jar --binarize min=1 max=10 *.tif
The following command will calculate the fractal dimension with box counting method for each images
previously binarized.
java -jar fractalyse-3.0.jar --rboxcounting coef=1.5 *_bin*.tif

19
Chapter 11

Performance tuning

11.1 Parallelism to speed up execution

11.1.1 One computer : threads

If your computer has more than one core (most of them), you can take advantage of parallelism. Most
Fractalyse commands are parallelized. You can speed up command execution by defining the number of
cores (or processors) used by Fractalyse with the option -proc after the project command :
java -jar fractalyse-3.0.jar -proc 8 ...
By default, CLI mode uses the number of processors defined in the preferences window of the GUI.

11.1.2 Computer cluster : mpi

Fractalyse can be run on computer clusters wich support Java for OpenMPI.
mpirun java -jar fractalyse-3.0.jar -mpi ...
Only some commands can be used in mpi environments :

11.2 Memory management


In CLI mode, the memory configuration defined in the preferences window cannot be used. By default, the
amount of memory available for Fractalyse is system dependent. It can vary from 128 Mb to several Gb.
In most cases, Fractalyse will run normally. But if you have a large image, some commands would be slow
or even crash due to memory limitation. If Fractalyse execution terminates with OutOfMemoryError,
GC overhead or Java Heap space, you need to increase memory allocated to Fractalyse.
To define manually the maximum amount of memory allocated to Fractalyse, use Java option -Xmx :
java -Xmx2g -jar fractalyse-3.0.jar ... # 2Gb allocated
java -Xmx1500m -jar fractalyse-3.0.jar ... # 1500 Mb -> 1.5Gb allocated
If you cannot allocate more than 1Gb or 1.5G and your computer has more memory available, you have
probably a 32-bit version of Java, which is limited to less than 2Gb of memory. Check your Java version
:
java -version
If it is a 32-bit version, install a 64-bit Java version to handle all your computer memory.

20

You might also like