FREE
SOFTWARE FOR THE
3D AND 2D MORPHOLOGICAL ANALYSIS |
The software may be used freely provided it is acknowledged. Any publication arising from use of the morph2D or morph3D program should contain the following references:
gcc
morph3D.c
-lm -o morph3D
morph3D Nthreshold input_file
The input file is then produced in the loop:f[0][j][k]=f[N-1][j][k]f[i][0][k]=f[i][N-1][k]f[i][j][0]=f[i][j][N-1]
PLEASE NOTE: In the above loops the indices i, j, and k run over N-1 points and the second (redundant) boundary is skipped.for(i=0;i<N-1;i++)for(j=0;j<N-1;j++)for(k=0;k<N-1;k++)fprintf(input_file,"%lf\n",f[i][j][k]);
In the working directory the output file input_file.his is created. It is composed of three columns, which are H_i, K_i, and S_i. H_i, and K_i are, respectively, the mean and Gaussian curvatures, and the area (i.e. weight) associated with the i-th vertex.
The output file may be quite big since it contains the number of lines equal to the number of all vertices, which is usually of the order 10^4 - 10^5. So, if you do not want to make the histograms you can simply cancel the procedure MakeHistogram() (line 214 in the source file morph3D.c).
grid size N=50 threshold=0.0 input file: pb.dat (0.45Mb)NUMBER OF SURFACES: 1
# AREA EULER CHAR. INTEGRAL OF H
----------------------------------
1 4.713455 -32 0.000982output file: pb.dat.his (0.39Mb)
grid size N=50 threshold=0.0 input file: pm.dat (0.52Mb)
NUMBER OF SURFACES: 9
# AREA EULER CHAR. INTEGRAL OF H
----------------------------------
1 0.324751 2 -2.022234
2 0.812731 2 3.207685
3 1.441901 2 -4.335119
4 2.196970 -4 2.315473
5 2.359155 -4 -0.000003
6 2.196973 -4 -2.315444
7 1.441906 2 4.335127
8 0.812735 2 -3.207712
9 0.324754 2 2.022261output file: pm.dat.his (1.1Mb)
grid size N=61 threshold=0.0 input file: ma.dat (0.80Mb)
NUMBER OF SURFACES: 2
# AREA EULER CHAR. INTEGRAL OF H
----------------------------------
1 14.979642 -594 14.545141
2 0.009179 2 -0.356581output file: ma.dat.his (2.84Mb)
2D MORPHOLOGICAL ANALYSIS
- The program determines all closed contours and rings (see Fig. 1 for the explanation) separating f<f_0 and f>f_0, where f_0 is input threshold value.
- For each closed contour the program determines (i) the length of the contour (LENGTH_0), the area enclosed by the contour (AREA_0), the total length of the contour and the first-rank contours inside it (LENGTH_1), the area enclosed by the contour minus the total area enclosed by the first-rank contours inside it (AREA_1), the average radius of the contour (RADIUS), and the type of the contour (TYPE). The definition of the the lengths and areas is explained in Fig. 2. The average radius is calculated as the average distance between the points (vertices) on the contour and the geometrical center of mass of the contour. If the contour encloses f>f_0 in the sea of f<f_0 then it is marked with "-", otherwise it is marked with "+".
- For each ring the length (LENGTH) is calculated
- All the vertices v_i are scanned; The curvature k associated with every single vertex are collected in an output file. This file can be used to make a histogram of the curvatures.
gcc
morph2D.c
-lm -o morph2D
morph2D Nthreshold input_file
The input file consists of one column obtained in the following way:N is the linear size of the simulation box threshold is the threshold value f_0 of the field f input_file is the name of the input file
The input file is then produced in the loop:f[0][j]=f[N-1][j]f[i][0]=f[i][N-1]
PLEASE NOTE: In the above loops the indices i and j run over N-1 points and the second (redundant) boundary is skipped.for(i=0;i<N-1;i++)for(j=0;j<N-1;j++)fprintf(input_file,"%lf\n",f[i][j]);
In the working directory the output file input_file.his
is created. It is composed of three columns, which are k_i, l_i ,
and TYPE. They are, respectively, the curvature, the length of interface
(i.e. weight) associated with the i-th vertex., and the type
of the contour (rings are marked with "0"). If you do not want to
make the histogram you can simply cancel the procedure MakeHistogram()
(line 155 in the source file morph2D.c).
grid size N=500 threshold=0.0 input file: cir.dat (6.5 Kb)NUMBER CLOSED CONTOURS: 1 (+), 2 (-), NUMBER OF RINGS: 0
CLOSED CONTOURS:
# LENGTH_0 LENGTH_1 AREA_0 AREA_1 RADIUS TYPE
---------------------------------------------------------
1 2.911023 4.360292 0.498763 0.374931 0.397662 -1
2 1.449269 2.342087 0.123832 0.076647 0.198153 1
3 0.892818 0.892818 0.047185 0.047185 0.122323 -1output file: cir.dat.his (7.1 Kb)
grid size N=500 threshold=0.0 input file: dom.dat (212Kb)
NUMBER CLOSED CONTOURS: 4 (+), 2 (-), NUMBER OF RINGS: 2
CLOSED CONTOURS:
# LENGTH_0 LENGTH_1 AREA_0 AREA_1 RADIUS TYPE
---------------------------------------------------------
1 1.572575 1.744433 0.110333 0.108187 0.186409 1
2 0.171858 0.171858 0.002146 0.002146 0.026949 -1
3 0.781716 0.781716 0.024446 0.024446 0.088450 -1
4 0.264802 0 .264802 0.005144 0.005144 0.042030 1
5 0.155437 0.155437 0.001816 0.001816 0.023973 1
6 0.348709 0.348709 0.008515 0.008515 0.055131 1RINGS:
# LENGTH
---------
1 1.114251
2 1.395887output file: dom.dat.his (54Kb)