BCFD a Visual Basic pro gram for cal cu la tion of the fractal di men sion of digitized geological image data using a box-counting technique

Similar documents
TT1300 Se ries. Low Noise Matched Transister Ar ray ICs DESCRIPTION APPLICATIONS FEATURES. Microphone Preamplifiers

Evaluation of Front Morphological Development of Reactive Solute Transport Using Behavior Diagrams

TEST OF TOTAL HEAT FLUX FROM WOOD CRIB FIRE IN AND OUTSIDE COMPARTMENT

Ma trix re ar range ment

NUMERICAL STUDY OF A MODIFIED TROMBE WALL SOLAR COLLECTOR SYSTEM. Snežana M. DRAGI]EVI] and Miroslav R. LAMBI]

FINITE TIME THERMODYNAMIC MODELING AND ANALYSIS FOR AN IRREVERSIBLE ATKINSON CYCLE

HEAT EXCHANGER OPERATING POINT DETERMINATION. Dušan D. GVOZDENAC

EXPERIMENTAL INVESTIGATION OF A FLOW AROUND A SPHERE

V6309/V Pin Microprocessor Reset Circuit EM MICROELECTRONIC-MARIN SA. Fea tures. Typi cal Op er at ing Con figu ra tion.

APPLICATION OF INVERSE CONCEPTS TO DRYING

TOTAL HEAT FLUX ON THE WALL: BENCH SCALE WOOD CRIB FIRES TESTS

HEAT-BALANCE INTEGRAL METHOD FOR HEAT TRANSFER IN SUPERFLUID HELIUM. Bertrand BAUDOUY

NUMERICAL INVESTIGATION OF FLUID FLOW AND HEAT TRANSFER CHARACTERISTICS IN SINE, TRIANGULAR, AND ARC-SHAPED CHANNELS

A L A BA M A L A W R E V IE W

NUMERICAL SIMULATION FOR THERMAL CONDUCTIVITY OF NANOGRAIN WITHIN THREE DIMENSIONS

Alternative Approaches to Estimating the Linear Propagator and Fi nite-time Growth Rates from Data

RADIATION AND CHEMICAL REACTION EFFECTS ON ISOTHERMAL VERTICAL OSCILLATING PLATE WITH VARIABLE MASS DIFFUSION

Gi ant Res o nance in 4d Photo-Ionization and -Ex ci ta tion of High Z Atoms and Ions; Sys tem atic Study of Dy namic Elec tron-correlation

HOW GOOD IS GOODMAN S HEAT-BALANCE INTEGRAL METHOD FOR ANALYZING THE REWETTING OF HOT SURFACES?

NUMERICAL ANALYSIS OF FORTH-ORDER BOUNDARY VALUE PROBLEMS IN FLUID MECHANICS AND MATHEMATICS

DISPERSION MODELING FOR REGULATORY APPLICATIONS

MI LAN P. PEŠI] Sci en tific pa per DOI: /NTRP P

One could hardly imag ine a wide va ri ety of pro cesses in the mod ern world with out ca tal y - sis. Many pro cesses in volved in fuel con ver

EMPIRICAL CORRELATIONS TO PREDICT THERMOPHYSICAL AND HEAT TRANSFER CHARACTERISTICS OF NANOFLUIDS

1 Introduction. 2 The Problem and the present method. 2.1 The problem

Bimetal Industrial Thermometers

I/O7 I/O6 GND I/O5 I/O4. Pin Con fig u ra tion Pin Con fig u ra tion

PRODUCTIVITY ENHANCEMENT OF STEPPED SOLAR STILL PERFORMANCE ANALYSIS. V. VELMURUGAN, S. SENTHIL KUMARAN, V. NIRANJAN PRABHU, and K.

Agnese Kukela, Valdis Seglins Uni ver sity of Lat via, 10 Al berta street, Riga, LV-1010, Lat via,

EFFECT OF VARIABLE VISCOSITY AND SUCTION/INJECTION ON THERMAL BOUNDARY LAYER OF A NON-NEWTONIAN POWER-LAW FLUIDS PAST A POWER-LAW STRETCHED SURFACE

THEORETICAL ANALYSIS AND EXPERIMENTAL VERIFICATION OF PARABOLIC TROUGH SOLAR COLLECTOR WITH HOT WATER GENERATION SYSTEM

SOLAR EQUIPMENT FOR PREHEATING BITUMEN

MIXED CONVECTION FLOW OF JEFFREY FLUID ALONG AN INCLINED STRETCHING CYLINDER WITH DOUBLE STRATIFICATION EFFECT

Density and Partial Mo lar Volumes of Binary Mixtures for the Dimethyl Ether of a Glycol + Eth a nol from T = K to T = 318.

Molecular Distance-Edge Vec tor ( ) and Chro mato graphic Retention In dex of Alkanes

Tie Bar Extension Measuring Chain

EFFECT OF CHAR LAYER ON TRANSIENT THERMAL OXIDATIVE DEGRADATION OF POLYETHYLENE

EMPIRICAL SOOT FORMATION AND OXIDATION MODEL. Karima BOUSSOUARA and Mahfoud KADJA

VA LENCE XPS STRUC TURE AND CHEM I CAL BOND IN Cs 2 UO 2 Cl 4

EXPERIMENTAL INVESTIGATION OF TURBULENT STRUCTURES OF FLOW AROUND A SPHERE

THE NATURE OF BIOLOGICAL SYSTEMS AS REVEALED BY THERMAL METHODS

Vas cu lar elas tic ity from re gional dis place ment es ti mates

AN INCREASE OF HYDRO-AGGREGATE'S INSTALLED POWER AND EFFICIENCY FACTOR BEFORE THE REVITALIZATION PHASE

DETERMINATION OF THERMAL CONDUCTIVITY OF ROCKS SAMPLES USING FABRICATED EQUIPMENT

FIRE SUPPRESSION STUDIES

A CFD ANALYSIS OF ROOM ASPECT RATIO ON THE EFFECT OF BUOYANCY AND ROOM AIR FLOW

EXERGOECONOMIC OPTIMIZATION OF GAS TURBINE POWER PLANTS OPERATING PARAMETERS USING GENETIC ALGORITHMS: A CASE STUDY

ANALYSIS OF PHOTOTHERMAL RESPONSE OF THIN SOLID FILMS BY ANALOGY WITH PASSIVE LINEAR ELECTRIC NETWORKS

GENERAL BUILDING HEIGHTS AND AREAS

A NOVEL METHOD FOR ESTIMATING THE ENTROPY GENERATION RATE IN A HUMAN BODY

Velocity Models from Three-Dimensional Traveltime Tomography in the Nechako Basin, South-Central British Columbia (Parts of NTS 093B, C, F, G)

EFFECTS OF DIFFERENT MEAN VELOCITY RATIOS ON DYNAMICS CHARACTERISTICS OF A COAXIAL JET

A MOD ERN MATH E MAT I CAL METHOD FOR FIL TER ING NOISE IN LOW COUNT EX PER I MENTS

Nikola V. ŽIVKOVI] *, Dejan B. CVETINOVI], Mili} D. ERI], and Zoran J. MARKOVI]

THE EFFECT OF SURFACE REGRESSION ON THE DOWNWARD FLAME SPREAD OVER A SOLID FUEL IN A QUIESCENT AMBIENT

MODELING THE EFFECT OF THE INCLINATION ANGLE ON NATURAL CONVECTION FROM A FLAT PLATE The Case of a Pho to vol taic Mod ule

Introduction. Study Area. T. Ferbey, British Columbia Geological Survey, Victoria, BC,

(NTS 092N, O, 093B, C, F, G)

The de sign and use of porous asphalt mixes

THE SPECTRAL RADIATIVE EFFECT OF Si/SiO 2 SUBSTRATE ON MONOLAYER ALUMINUM POROUS MICROSTRUCTURE

OH BOY! Story. N a r r a t iv e a n d o bj e c t s th ea t e r Fo r a l l a g e s, fr o m th e a ge of 9

RESEARCH IN SOLAR ENERGY AT THE POLITEHNICA UNIVERSITY OF TIMISOARA: STUDIES ON SOLAR RADIATION AND SOLAR COLLECTORS

(NTS 092N; 093C, B, G, H),

ul. Mokhovaya 11, k. 7, Moscow, Russia, b Hydrometeorological Research Center of the Russian Federation,

Geochemistry Projects of the British Columbia Geological Survey

THE EFECT OF POLYMERS ON THE DYNAMICS OF TURBULENCE IN A DRAG REDUCED FLOW

Evaluation of Mineral Inventories and Mineral Exploration Deficit of the Interior Plateau Beetle Infested Zone (BIZ), South-Central British Columbia

PERSISTENCE OF THE LAMINAR REGIME IN A FLAT PLATE BOUNDARY LAYER AT VERY HIGH REYNOLDS NUMBER

THEORETICAL-EXPERIMENTAL DETERMINING OF COOLING TIME (t 8/5 ) IN HARD FACING OF STEELS FOR FORGING DIES

P a g e 5 1 of R e p o r t P B 4 / 0 9

Deep Aquifer Characterization in Support of Montney Gas Development, Northeastern British Columbia (Parts of NTS 093, 094): Progress Report

Introduction. Methodologies Receiver Function Analysis

Cover Thickness across the Southern Interior Plateau, British Columbia (NTS 092O, P; 093A, B, C, F): Constraints from Water-Well Records

Con cen tra tion De pend ence of the Fifth-Order Two-Dimensional Raman Sig nal

EX PANDED AND COM BINED UN CER TAINTY IN MEA SURE MENTS BY GM COUN TERS

Anal y sis of Tai pei Ba sin Re sponse for Earth quakes of Var i ous Depths and Locations Using Empirical Data

Sa lin ity Min i mum in the Up per Layer of the Sea of Ja pan

Shal low S-Wave Ve loc ity Struc tures in the West ern Coastal Plain of Tai wan

Im pact of GPS Ra dio Occultation Refractivity Soundings on a Sim u la tion of Ty phoon Bilis (2006) upon Land fall

Solar Heat Worldwide Markets and Contribution to the Energy Supply 2006

Introduction. D.R. Heberlein, Consulting Exploration Geochemist, Heberlein Geoconsulting, North Vancouver, BC,

Hydrogeology and Water Quality of Significant Sand and Gravel Aquifers in Parts of Aroostook, Penobscot, and Washington Counties, Maine

Table of C on t en t s Global Campus 21 in N umbe r s R e g ional Capac it y D e v e lopme nt in E-L e ar ning Structure a n d C o m p o n en ts R ea

Laser Spectroscopic Studies of Tran si tion Metal Con taining Rad i cals

Volume and Quality of Sand and Gravel Aggregate in the Submerged Paleodelta, Shorelines, and Modern Shoreface of Saco Bay, Maine

Characterization of Placer- and Lode-Gold Grains as an Exploration Tool in East-Central British Columbia (Parts of NTS 093A, B, G, H)

Description LB I/O15 I/O14 I/O13 I/O12 GND I/O11 I/O10 I/O9 I/O8

The Bonding Structure of Quadricyclanylidene Derivatives

NUMERICAL SIMULATION OF POROUS BURNERS AND HOLE PLATE SURFACE BURNERS

EXPERIMENTAL ANALYSIS OF FUZZY CONTROLLED ENERGY EFFICIENT DEMAND CONTROLLED VENTILATION ECONOMIZER CYCLE VARIABLE AIR VOLUME AIR CONDITIONING SYSTEM

A STO CHAS TIC MODEL OF GAMMA-RAY IN DUCED OX IDE CHARGE DIS TRI BU TION AND THRESH OLD VOLT AGE SHIFT OF MOS TRAN SIS TORS

BUBBFIL ELECTROSPINNING OF PA66/Cu NANOFIBERS

Contribution to the Mineralogy of the Arthur Point Rhodonite Deposit, Southwestern British Columbia

FRAC TIONAL VARIATIONAL PROB LEMS AND PAR TI CLE IN CELL GYROKINETIC SIM U LA TIONS WITH FUZZY LOGIC AP PROACH FOR TOKA MAKS

T11 - Neutron Diffraction

Hydrogeology and Wa ter Qual ity of Sig nif i cant Sand and Gravel Aqui fers in Parts of Frank lin, Ox ford and Somerset Coun ties, Maine

SIMULATION ON MARINE CURRENTS AT MIDIA CAPE-CONSTANTA AREA USING COMPUTATIONAL FLUID DYNAMICS METHOD

OP TI MI ZA TION OF THE SELF-SUF FI CIENT THO RIUM FUEL CY CLE FOR CANDU POWER RE AC TORS

Steel Frame Design Manual

Jour nal of the Chi nese Chem i cal So ci ety, 2002, 49,

Transcription:

Geo log i cal Quar terly, 2009, 53 (2): 241 248 BCFD a Visual Basic pro gram for cal cu la tion of the fractal di men sion of digitized geological image data using a box-counting technique Timotej VERBOVŠEK Verbovšek T. (2009) BCFD a Vi sual Ba sic pro gram for cal cu la tion of the fractal di men sion of dig i tized geo log i cal im age data us - ing a box-count ing tech nique. Geol. Quart., 53 (2): 241 248. Warszawa. The BCFD pro gram was de vel oped for the anal y sis of dig i tized ob jects us ing a box-count ing al go rithm, which has the larg est num ber of ap pli ca tions among the fractal meth ods in the geosciences. Count ing is per formed by scan ning of im age pix els in boxes of dif fer ent sizes, and the num ber of boxes is de ter mined au to mat i cally from the im age res o lu tion. The pro gram cal cu lates the fractal di men sion D of the ob jects in the im age, along with the co ef fi cient of de ter mi na tion R 2. In put files are thus trans ferred to ubiq ui tous BMP im ages, in a 1-bit mono chrome for mat. The pro gram out puts the re sults on screen, into a text file and op tion ally also di rectly into MS Ex cel, where the data can be fur ther used in charts or other cal cu la tions. It was tested with three fractal and three Eu clid ean ob jects with known the o ret i cal val - ues, plus three geo log i cal im age data (a nat u ral river net work and two frac ture net works), and gave re sults with very high or per fect the o - ret i cal ac cu racy. Ap pli ca tion of data val ues ob tained is pre sented with sev eral ex am ples. BCFD is writ ten in Vi sual Ba sic 6.0. The source code is freely avail able, and is open for any mod i fi ca tions or in te gra tion with other soft ware pack ages that are pow ered by Vi sual Ba sic for Ap pli ca tions (VBA) or its equiv a lent. Timotej Verbovšek, Uni ver sity of Ljubljana, Fac ulty of Nat u ral Sci ences and En gi neer ing, De part ment of Ge ol ogy, Aškerèeva 12, SI-1000 Ljubljana, Slovenia; e-mail: timotej.verbovsek@ntf.uni-lj.si, timotej.verbovsek@guest.arnes.si (re ceived: De cem ber 10, 2007; ac cepted: Oc to ber 17, 2008). Key words: box-count ing, pro gram, Vi sual Ba sic, im age anal y sis, fractal di men sion. INTRODUCTION Since its in ven tion about 30 years ago, fractal anal y sis has proved to be very use ful, and is above all ap pli ca ble in the geosciences. Fractal methodologies are appropriate where classical geometry is not suitable for describing the irregular objects found in na ture (Mandelbrot, 1983). Frac tals are most eas - ily de fined as geo met ric ob jects with a self-sim i lar prop erty, which de fines that they re tain their shape un der any mag ni fi ca - tion, i.e. they do not change shape with scale (Feder, 1988; An - geles et al., 2004). An other fun da men tal prop erty is their fractal dimension (D), which yields im por tant in sights into the physical properties of geological materials (Turcotte, 1992; Dillon et al., 2001). It can oc cupy non-in te ger val ues, com - pared to the integer values characteristic of Euclidean objects, such as 3D cubes or 2D pla nar sur faces. As an ex am ple, a well-known fractal ob ject, the Koch curve (Fig. 1), has a fractal di men sion of about 1.26, and there fore ex hib its prop er ties of both 1D and 2D ob jects, as it fills more space than a line (D = 1) and less space than a sur face (D = 2). Use of fractal anal y ses based on cal cu la tion of the fractal di men sion has found an ap - plication in many fields, including geology and geophysics (Turcotte, 1992), speleology (Kusumayudha et al., 2000), geo - morphology (Angeles et al., 2004), anal y sis of frac ture net - works (Bon net et al., 2001), at mo spheric re search (Brewer and Di Girolamo, 2006), river net works anal y sis (Schuller et al., 2001), and also in other non-earth sci ences, such as med i cine, space sciences, physics, chemistry, economics, and others. As most fractal anal y sis soft ware is ei ther spe cial ized or com mer cial, it is of ten hard to find ap pro pri ate pro grams to per - form anal y ses. The fol low ing pa per de scribes the de sign, de - tails of use and ap pli ca tions of the BCFD program, developed for determination of the fractal dimension of digitized objects us ing a box-count ing al go rithm. The pro gram runs in the MS Windows en vi ron ment and is writ ten in Visual Basic 6.0. The source code is freely avail able, with the free dom for mod i fi ca - tion to meet the user s pur poses or for on ward in te gra tion with other software packages, especially using Vi sual Ba sic for Ap - plications (VBA).

242 Timotej Verbovšek Fig. 1. Box-count ing tech nique Only the oc cu pied boxes are shown cov er ing the Koch curve (D = 1.2618); A 4 boxes (step 2), B 6 boxes (step 3), C 20 boxes (step 4) and D 44 boxes (step 5); the first step (one box) is not shown; see also Ta ble 1 METHODS ESTIMATION OF THE FRACTAL DIMENSION USING THE BOX-COUNTING TECHNIQUE There are many def i ni tions of di men sion, and also many ways to at tempt their de ter mi na tion. The most com mon di men - sions are the self-sim i lar ity, com pass and box-count ing di men - sions, and the lat ter has the most ap pli ca tions in sci ence (Peitgen et al., 2004). One should note that many nat u ral sys - tems are self-af fine rather than strictly self-sim i lar and thus em - pirically derived box-counting dimensions for these objects are only es ti mates of their true fractal di men sion. How ever, the box-count ing di men sion is still prob a bly the most com monly used, as the prin ci ple of its use is rather sim ple. The dig i tized map of an ob ject (for in stance a river or frac ture net work) is cov ered by boxes of dif fer ent side length s, and then the number of occupied boxes N (s) is counted for each box size (Feder, 1988; Bon net et al., 2001). The pro cess is re peated by re duc ing the box sizes by half their size (Fig. 1), with the larg est box de fined by the im age res o lu tion and the small est box oc cu - py ing one pixel of com puter im age. For fractal ob jects, the number of occupied boxes N (s) fol lows the power-law re la - tion ship with the box size s: N (s) s D and the fractal di men sion D is there fore cal cu lated as the slope of lin ear re gres sion best-fit line of log-log data: D = log N (s)/log s. A typ i cal log-log curve there fore rep re sents a per fectly lin - ear re la tion ship of data points of the num ber of oc cu pied boxes N (s) and the box size s. Such a per fect re la tion ship is valid only for ideal math e mat i cal frac tals such as the Koch curve de - scribed (Fig. 1). Mathematical fractals are by definition con - structed from a set of rules, in con trast to nat u ral frac tals, and do not in volve any ran dom pro cesses such as geo log i cal pro - cesses. Natural fractals can be classified as statistical fractals, which are not strictly self-sim i lar and do not pre serve their shape across all scales as do math e mat i cal frac tals. Sta tis ti cal fractals have only their numerical or statistical measures pre - served across all scales, and this mea sure is rep re sented by the fractal dimension. The relationship of log N (s) log s data plots on the graph as a per fect line for math e mat i cal frac tals. De spite the ap par ent sim plic ity of the box-count ing method, us ers should be aware of the po ten tial pit falls of the box-counting technique, especially for real geological data. If the correlation of log N (s) log s data plots on the graph as a curve and not as a line (which is typ i cal for nat u ral frac tals), only the valid range (the lin ear part of the curve) should be ex - am ined. In ad di tion, the un mapped space out side the stud ied area should not be in cluded in the anal y sis and the im age ex am - ined must there fore be em braced com pletely within this area (Walsh and Watterson, 1993). Most com mon de vi a tions from a line of log N (s) log s data plots oc cur as a re sult of trun ca tion and cen sor ing ef fects. Trun ca tion oc curs as a shallowing of the line s slope at the lower end of the scale range, as for real data, and the num ber of smaller ob jects (e.g., frac tures) be low some thresh old val ues can be un der-sam pled. On the other hand, cen - sor ing oc curs if the ob jects ana lysed pass out side the ob served re gion, caus ing steep en ing of the curve in plots at the up per end of the scale range (Bon net et al., 2001). These ef fects are eas ily seen in the log-log plots, and are for the pur pose of sim plic ity not im ple mented in the pro gram cal cu la tions. To cor rectly de - ter mine the fractal di men sions of real geo log i cal ob jects, cal cu - la tions must be car ried out care fully, and the fractal struc ture should be not only cal cu lated but also ver i fied af ter wards by examination of the log-log plots. It is nec es sary to com ment that the val ues of fractal di men - sions of river and frac ture net works used as geo log i cal ex am - ples in this pa per are pre sented for both meth ods of box-count - ing: the com plete one, us ing all data points in the log-log plots (as calculated by BCFD), and the lin ear one, us ing only the lin - ear part of the log-log plots (later de ter mined vi su ally in MS Ex - cel). It is not the main goal of this pa per to dis cuss the mean ing of the ex act val ues of fractal di men sions for dif fer ent geo log i - cal data, so the user must ex am ine the data care fully to ana lyse only the fractal part. PROGRAM DESIGN Af ter open ing the file, the pro gram reads the header of the BMP im age. It first checks the im age for BMP for mat and looks for proper col our depth and res o lu tion (width height). If any of these pa ram e ters do not match ap pro pri ate val ues, the pro gram warns the user of the er ror type and ex its. Af ter check - ing the file, the pro gram con se quently reads the im age into dy - namic mem ory ar ray (pixel ()) by scan ning each row start ing from lower left to up per right cor ner (Fig. 2). Ev ery byte is con - verted into eight bits of im age ob ject in for ma tion. A bit value of zero rep re sents white im age back ground and a value of one rep re sents the black pixel of the ob ject. A hex a dec i mal value of 81h (10000001 bi nary) there fore rep re sents the ob ject oc cu py - ing the first and the last bits (byte 34 in Fig. 2). The ob ject is thus read into the vir tual screen with the same res o lu tion as the im age. Af ter the ob ject has been read into the ar ray, the

BCFD a Visual Basic program for calculation of the fractal dimension of digitized geological image data using a box-counting technique 243 Fig. 2. Ex am ple im age of 32 32 pix els, read by pro gram into 128 bytes from lower left to up per right cor ner Val ues of 1 rep re sent ob jects, and 0 back ground box-count ing is per formed by sub di vid ing the im age into smaller boxes, and in each of them the pix els of the ar ray are scanned from the lower left to up per right cor ner of the box. If at least one ob ject part (marked by a bit value of 1) is found, the box is re garded as oc cu pied. As the scan ning of each of smaller boxes reaches the end of the ar ray, the size of boxes is re duced by half and scan ning is re peated. The pro cess is com plete when all the boxes of one pixel size are scanned. The pix els on the box edges are scanned only once. Fi nally, the fractal di men sion (D) and squared value of Pearson s correlation coefficient (R 2 ), which il lus trates the good ness of fit (Borradaile, 2003), are cal cu lated. D is cal cu - lated as a neg a tive value of the slope of the best lin ear-fit re - gression line D x x y y / x s 2. In MS Ex cel, both val ues are cal cu lated by in ter nal func tions, D by the SLOPE func tion and R 2 by the RSQ func tion. Due to the na ture of the pro gram, only one-bit (two-col our black and white) un com pressed bitmap files (*.BMP) are sup - ported as in put files. Sup ported im age res o lu tions are 256 256, 512 512, 1.024 1.024, 2.048 2.048 and 4.096 4.096 pix - els. The min i mum value is cho sen as such be cause im ages of lower resolution cannot faithfully represent fractal and natural ob jects, and im ages greater than the max i mum value are slow to pro cess and are sel dom used. The sup ported res o lu tions can eas - ily be added or changed in a sin gle line (Case 4096, 2048, 1024, 512, 256) of code in the sub rou tine CheckResolution(). Out put re sults are given as a ta ble of box sizes s and cor re - sponding number of occupied boxes N (s) plus the D and R 2 val ues. These re sults are writ ten on screen and into the text (*.txt) file. If the checkbox Write to Ex cel file be low the Open but ton is turned on, out put is also sent di rectly into an MS Excel spreadsheet, with direct calculation of D and R 2. Both files are writ ten in the same folder as the ana lysed im age, and the file names are pre sented in the BCFD out put screen (Fig. 3). Output to Excel is sup ported and pre ferred, as it is pos si ble to fur ther rep re sent the data on charts, in clude them into other cal - cu la tions or to check the slope of fit ted data for trun ca tion or censoring effects (Bonnet el al., 2001). Fig. 3. Screenshot of the pro gram BCFD and MS Ex cel with fin ished re sults

244 Timotej Verbovšek The pro gram is writ ten in Visual Basic (VB), version 6.0. This lan guage has be come one of the world s most widely used pro gram ming lan guages due to its sim plic ity and ease of use. Even if BCFD is in tended to run as a stand-alone pro gram, it can straightforwardly be integrated into various applications by Visual Basic for Applications (VBA). This rep re sents a ver sion of the VB lan guage in te grated into ap pli ca tions, which does not per mit de vel op ment of stand-alone ex e cut able files. It is fully compatible with Visual Basic and is in tended for the au tom a ti - zation and customization of applications in other programs (Hart-Davis, 1999). VBA or compatible versions of Visual Basic power, for ex am ple, some of the most known pop u lar soft - ware, such as Microsoft Of fice, AutoCAD (AutoDesk, Inc.), Statistica (StatSoft, Inc.), Adobe Photoshop (Adobe, Inc.), Surfer (Golden Soft ware, Inc.), ArcGIS (ESRI, Inc.), and many oth ers. The code can be also be trans ferred to other ver sions of Visual Basic, such as the 2005 ver sion or the NET plat form (Patrick et al., 2006), with out mod i fi ca tion or with only mi nor modifications. RESULTS AND DISCUSSION ANALYSIS OF MATHEMATICAL FRACTAL TEST DATA AND EUCLIDEAN OBJECTS The pro gram has been tested with sev eral im ages (Fig. 4): three frac tals and three Eu clid ean ob jects with known fractal Fig. 4. An a lysed im ages (ex am ple files in the folder test_data ) A point (en larged), B line, C filled square, D Sierpinski car pet, E Koch curve, F Can tor s dust (en larged), G nat u ral river net work ex am ple, H nat u ral frac ture net work ex am ple no. 1 (see Fig. 5A), I nat u ral frac ture net work ex am ple no. 2 (see Fig. 5B)

BCFD a Visual Basic program for calculation of the fractal dimension of digitized geological image data using a box-counting technique 245 di men sions plus three nat u ral ob jects, de scribed in the next sec - tion. The first com prise fa mil iar self-sim i lar fractal ob jects: the Sierpinski car pet (Fig. 4D), the Koch curve (Fig. 4E), and Can - tor s dust (Fig. 4F). These frac tals have non-in te gral di men - sions and are con structed by an in fi nite se ries of it er a tions (Feder, 1988; Peitgen et al., 2004), so they be long to the group of strictly self-similar mathematical objects. All tested images have a res o lu tion of 2.048 2.048 pix els. This res o lu tion is suf - ficient to allow faithful representation of fractal objects by seven it er a tion steps, so the small est ir reg u lar ity on the frac tals is equal to or smaller than one pixel of the im age. This re quire - ment is im por tant, as the num ber of it er a tions af fects the value of D, and too small a num ber of it er a tions yields in fe rior re sults (Dillon et al., 2001). Eu clid ean ob jects with in te gral di men - sions, used as ex am ples, in clude a point (Fig. 4A), a line (Fig. 4B) and a filled square (Fig. 4C). Results (Table 1) show that the pro gram cal cu lates the fractal dimension (D c ) with per fect or very high ac cu racy. De - viations from ideal dimension values (D t ) can be at trib uted to two facts. First, all tested frac tals are, by def i ni tion, self-sim i lar ob jects con structed by an in fi nite num ber of it er a tions, and in the ex am ple im ages only the first seven it er a tions are shown. As the pixel size achieved on mon i tor is not in fi nitely small, to allow representation of all iterations, some minor error is always pres ent. Sec ondly, sev eral frac tals such as Koch curve are triangular objects and are therefore impossible to represent faith fully on the square grid of the com puter screen or ar ray. ANALYSIS OF NATURAL GEOLOGICAL DATA Nat u ral data rep re sent ing a river chan nel net work and two frac ture net works were ana lysed in or der to pres ent some geo - logical examples of the program application. The first example is a nat u ral river net work (Fig. 4G), digitized from topographical maps 1. The area of the im age cov ers about 8.8 8.8 km in south-west Slovenia. The river net work is de vel oped in flysch rocks of Ter tiary age, com posed mostly of low-per me abil ity rocks (marls, mudstones and sandstones). The theoretical limits of fractal di men sions for river net works are 1 (sin gle straight chan nels) and 2, which would im ply a fully braided river, fill - ing the com plete ter rain. How ever, the ex pected di men sions are lower than 2, be cause of the geo log i cal, top o log i cal and hy dro - log i cal re straints that re duce the abil ity of the stream net work to de velop fully (Schuller et al., 2001). Skel e tal im ages of rivers were used in stead of com plete dig i tized im ages, as they are likely to pro vide better ma te rial to es ti mate the fractal di men - sion then the orig i nal im ages (Foroutan-pour et al., 1999). The ob tained value of D (Table 1) for nat u ral river net - works (D = 1.36) is in agree ment with di men sions for river net - works, which can vary widely (1.28 1.71 ac cord ing to the method used; Schuller et al., 2001). Vari a tions oc cur be cause of the self-af fine prop er ties of river net works. The fractal di - mension and self-similar or self-affine properties obtained from im age anal y sis can be fur ther ap plied to an un der stand ing of the be hav iour of river net work de vel op ment and the flu vial ero sion topography which influences the networks (Veneziano and Niemann, 2000). If the log-log plots are af ter wards ana lysed vi - su ally, the fractal di men sions can be higher for only the lin ear part of the curve. How ever, the dis cus sion on ex act val ues of dif fer ent fractal prop er ties of rivers or other data and the vi sual in spec tion are not the fo cus of this pa per, and the ver i fi ca tion of the fractal struc ture must be car ried out by the user, based on the data it self. The user must for in stance de cide which data points of the curve to use, and this de ci sion can be very sub jec - tive and can not be di rectly im ple mented in the pro gram code. The same note ap plies to the fol low ing cal cu la tions of fractal dimensions of fracture networks. Program BCFD should be there fore viewed as an open-source start ing point code with further possible modifications and upgrades. Two geological examples of analysed natural fracture networks are also given. They are ob tained from the Main do lo - mite (anal o gous to Ger man Hauptdolomit or Ital ian Dolomia Ta ble 1 Ex am ple ob jects (Fig. 4) with their the o ret i cal (D t ) and cal cu lated (D c ) di men sions, co ef fi cient of de ter mi na tion (R 2 ) and dif fer ence (dif.) be tween D t and D c Ob ject type Ob ject D t D c R 2 dif. [%] Fractal Can tor s dust 0.6309 (= log2/log3) 0.6367 0.9784 0.92 Fractal Koch curve 1.2618 (= log4/log3) 1.2494 0.9981 0.99 Fractal Sierpinski car pet 1.8928 (= log8/log3) 1.8994 0.9997 0.35 Eu clid ean point 0 0.0000 0.00 Eu clid ean line 1 1.0000 1.0000 0.00 Eu clid ean filled square 2 2.0000 1.0000 0.00 Nat u ral river net work (be tween 1 and 2) 1.3625 0.9699 Nat u ral frac ture net work 1 (be tween 1 and 2) 1.5111 0.9744 Nat u ral frac ture net work 2 (be tween 1 and 2) 1.5254 0.9750 1 EUROWATERNET http://nfp-si.eionet.eu.int/ewnsi/ (accessed on 21.05.2004) and http://eionet-si.arso.gov.si/dokumenti/gis/voda/index_eng.htm (accessed on 18.09.2007)

246 Timotej Verbovšek Fig. 5. Pho to graphs of do lo mite ex po sures with su per im posed dig i tized frac ture net work traces Principale) of Up per Tri as sic age (Verbovšek, 2008) in South - ern Slovenia. Frac ture net works were ob tained by pho to graph - ing the do lo mite out crops, where frac tures were well ex posed (Fig. 5A, B), and the traces of the frac tures were fur ther dig i - tized into vec tor for mat. The width of the su per im posed lines in the pho to graphs is 40 times larger than the one ac tu ally used in digitalization, to make the fractures visible on the photographs. The width of both pho to graphs is ap prox i mately 32 cm. Frac - tures are dig i tized in side a square in stead of in side a com plete photograph owing to box-counting requirements. Vector format im ages were fur ther con verted into 1-bit BMP im ages, used for pro cess ing in the BCFD pro gram. The val ues of D for natural fracture networks (D 1 = 1.51 and D 2 = 1.53) are al most iden ti cal (av er age value D av = 1.52) and are in agree ment with the val ues of frac ture net works given in a re view pa per by Bon net et al. (2001). In some tec tonic en - vironments, several generations of fracturing can affect the rocks, and thus each gen er a tion of frac tures is youn ger than the previous ones. Analysis of separate fracture characteristics from one gen er a tion to the next re veals the frac ture net works de vel op ment. Ob ser va tions by Barton (1995) show that the first-generation fractures are long and subparallel and net work connectivity is poor. Second-generation fractures are shorter and form polygonal blocks with first-generation fractures. Younger fractures are generally shorter, variously oriented, and form small po lyg o nal blocks. Ad di tion of youn ger frac - tures there fore con trib utes to an in crease in the fractal di men - sion of the com plete net work, as first-gen er a tion subparallel frac tures ex hibit low fractal di men sions, which in crease with the ad di tion of many smaller ones of later gen er a tions. The in - flu ence of frac ture net work evo lu tion can pos si bly be tested in the lab o ra tory or by phys i cal ex per i ments rather than in the field on exposures of do lo mite rocks. When out crops are, for example, inadequately exposed or fractures are affected by mineral infillings, this approach becomes inoperable (Barton, 1995). Ad di tion ally, the tec tonic stresses for each frac tur ing ep i sode (from the old est to the youn gest) should be known, and these data are mostly un avail able. The val ues of fractal di men - sions of frac tures net works in dolomites are there fore pre sented as a sim ple ex am ple of com plete net works, as it was not pos si - ble to di vide the frac tures into sep a rate gen er a tions. The val ues of fractal di men sions of nat u ral frac ture net - works can be fur ther used as a pa ram e ter or ana lysed in sev eral fields of ge ol ogy. The first ex am ples can be found in the field of en gi neer ing ge ol ogy, where they are used to ana lyse the rough ness of rock or soil par ti cles and rock sur faces, to ana lyse the dis tri bu tion of rock frag ments re sult ing from blast ing, or to describe the statistical homogeneity of jointed rock masses (Vallejo, 1997). A sec ond ap pli ca tion can be found in the study of un der ground wa ter flow and trans port in frac tured rocks based on the interconnectivity and dis tri bu tion of frac tures and the in flu ence of these two fac tors on per me abil ity. It has been rec og nized that the flow di men sion ob tained from the well-test pres sure curve is a func tion of the geo met ri cal fractal di men - sion and these geo met ri cal fractal di men sions are al ways equal to or greater than the flow di men sion (Polek et al., 1990; Doughty and Karasaki, 2002). It is the flow di men sion that should be used to char ac ter ize a net work s be hav iour dur ing well tests. Knowl edge of the geo met ri cal fractal di men sion, which can be ac quired by the box-count ing method, is there - fore of great im por tance in un der stand ing fluid flow and trans - port in frac tured rocks. To il lus trate the ap pli ca bil ity of the geo - metrical dimension, we can extrapolate the obtained two-dimensional average value of the geometrical fractal dimension of frac ture net works D = 1.52 to three di men sions. Ex trap o la - tion can be car ried out us ing the for mula D 3D = D 2D + 1 to ob - tain a value of D 3D = 2.52, as the in ter sec tion of a 3D fractal with a plane re sults in a fractal with D 2D equal to D 3D 1 (Barton, 1995; Bon net et al., 2001). The ex trap o la tion is valid for non-mathematical and isotropic fractals, and fractures in intensely frac tured dolomites are in deed close to this ide al iza tion. From these re sults we can there fore con clude that the flow di - mension describing the geometry of water flow towards the wa ter well (Barker, 1988) can reach a max i mum value of D 3D = 2.52 in the dolomites an a lysed due to chan nel ling ef fects (Polek et al., 1990; Doughty and Karasaki, 2002). For a more detailed analysis of these applications, more fracture networks should cer tainly be stud ied and checked for trun ca tion and cen - sor ing ef fects, as only two ex am ples are used in this pa per to il - lustrate the applicability. INFLUENCE OF IMAGE RESOLUTION ON THE RESULTS Image resolution does not greatly influence the calculated values of D c (Table 2), as shown for the ex am ple of the

BCFD a Visual Basic program for calculation of the fractal dimension of digitized geological image data using a box-counting technique 247 Sierpinski car pet. An orig i nal im age with a res o lu tion of 6.561 6.561 pix els was scaled down in five steps for the anal y sis. The co ef fi cient of de ter mi na tion is very high in all cases and the difference dif. (= 100*(D c D t )/D t ) does not show any in - creas ing or de creas ing trend, al though the de vi a tion is high est for the lowest resolution. As R 2 is very high for all res o lu tions, it can be con cluded that the fractal di men sion is more or less the same and hence in de pend ent of the im age res o lu tion. This is in agreement with observations (e.g., Dillon et al., 2001), which state that ob jects with the same form but of dif fer ent size should re tain a con stant fractal di men sion. Yet, when us ing dig i tized maps of nat u ral ob jects, it is better to use high-res o lu tion im - ages, as these cap ture more de tails. Cal cu lated val ues of D c for all Euclidean objects are equal to theoretical ones. COMPARISON WITH OTHER AVAILABLE BOX-COUNTING PROGRAMS Ta ble 2 In flu ence of im age res o lu tion on cal cu lated di men sion Res o lu tion D c R 2 dif. [%] 256 256 1.8656 0.9985 1.44 512 512 1.8881 0.9991 0.25 1.024 1.024 1.8946 0.9995 0.10 2.048 2.048 1.8994 0.9997 0.35 4.096 4.096 1.8967 0.9997 0.21 Ex am ple for Sierpinski car pet (D t = 1.8928, Fig. 4D); for no ta tion see Ta ble 1 Very few box-count ing pro grams are freely avail able on the internet. Many au thors of the works dis cussed in the fol - low ing para graphs do not men tion ei ther the method or the pro - gram used for cal cu lat ing the box-di men sion. There fore a com - parison of BCFD with other pro grams can not be made faith - fully, or per haps can not be made at all. A short com par i son with other pro grams is given in the fol low ing para graphs. The pro gram Fractal Dimension Calculation Software (Foroutan-Pour et al., 1999) is avail able for Ap ple Macintosh computers. Therefore for reasons of incompatibility it cannot be tested in the MS Win dows environment. Angeles et al. (2004) have de vel oped a spe cial ized func tion in MATLAB 2 soft ware for au to matic box-count ing. Their code is not freely avail able. In the code they have de vel oped spe cific cri te ria to avoid the dou ble count ing of points that fall on box sides. In BCFD code, the code is de signed in such a way that dou ble count ing is not pos si ble. Tang and Marangoni (2006) used the 2D and 3D al go - rithms that are now part of the com mer cial TruSoft 3 soft ware (pro grams 3D-FD and Benoit). In ad di tion, they also used the mass di men sion method, which is not com pa ra ble to the box-counting method. Fractscript (Dillon et al., 2001) is a macro de vel oped for fractal anal y sis of mul ti ple ob jects as part of the free ImageTool 4 pack age. It is writ ten in a di a lect lan guage of Pascal and re quires ImageTool to be in stalled. When com pared with BCFD, the lat ter can be im ple mented in a much broader range of soft ware, as Visual Basic lan guage is in te grated as VBA in a much broader spec trum of pro grams, as de scribed in Section 2.2, than ImageTool and Pascal. Al though these pro grams are not di rectly com pa ra ble with BCFD due to the dif fer ent meth ods or dif fer ent com puter codes used, it is most likely that BCFD code is eas ier to in te grate into other pro grams as it uses Visual Basic and gives out put di rectly into MS Ex cel. There fore, the only strictly com pa ra ble pro gram is VSBC (Vi sual Screen Box-Count ing; Gonzato, 1998). It is writ ten in C lan guage and uses PCX im age for mat, which is now vir tu ally ob so lete. The pro gram is small, fast and easy to use; how ever, in some cases it gives er ro ne ous re sults. An im age of the Koch curve (Fig. 4E) is used as an ex am ple. If the im age is ro tated by 90 de grees, the re sults of box-count ing should be the same for all four ro ta tions, as the im age has the same width and height. BCFD cal cu lates the num ber of oc cu pied boxes for all ro ta tions equally (N = 16.899), but VSBC gives dif fer ent val ues (N = 23.043 for 0 and 180 an gles and N = 23.380 for 90 and 270 angles). BCFD there fore ful fills the qual ity re quire ment that the ob ject s fi nal value must be in de pend ent of ro ta tion and re - flection (Dillon et al., 2001). The cal cu lated fractal di men sion value pro duced by BCFD (D = 1.25) is also much closer to the theoretical value (D = 1.26) than is that pro duced by VSBC (D = 1.33 for 0 and 180 an gles or D = 1.31 for 90 and 270 an - gles). Sim i lar con clu sions can be made for R 2, al though val ues pro duced by both pro grams are very high. Im age res o lu tion can be changed in VSBC only in the C source code, whereas BCFD de ter mines box sizes from the im age it self. VSBC also has prob lems with cal cu la tions for sin gle point (Fig. 4A), as it out - puts the num ber of oc cu pied boxes as zero, one or two for dif - fer ent box sizes, and the true val ues, cal cu lated by BCFD, are one (sin gle point oc cu pied) for all cases. CONCLUSIONS The BCFD pro gram was shown to per form box-count ing anal y sis with high ac cu racy. It has been tested ex ten sively with several objects (fractal, Euclidean, and three natural geological ex am ples river chan nels and two frac ture net works). Ap pli ca - tion of data val ues ob tained has been pre sented with a few ex am - ples. The pro gram gives re sults very close or equal to the o ret i - cally ex pected val ues. It is user-friendly and uti lizes BMP for - mat, avail able to most graphic pro grams. As the source code is freely avail able, it can eas ily be mod i fied or in te grated into any 2 The MathWorks Inc., http://www.mathworks.com. 3 TruSoft International Inc., http://www.trusoft.netmegs.com. 4 UTHSCSA ImageTool, http://ddsdx.uthscsa.edu/dig/itdesc.html.

248 Timotej Verbovšek image analysis software that uses Visual Basic for Applications (VBA) or a compatible lan guage as a back ground en gine. As Vi - sual Ba sic powers the majority of today s software applications, the pro gram can be used broadly, ei ther as a stand-alone or in te - grated ver sion. It will there fore hope fully be of use to all geoscientists deal ing with fractal anal y ses of im ages. The pro gram (ex e cut able ver sion, test files, source code, and other files) is avail able on http://www.geo.ntf.uni-lj. si/tverbovsek/ programi.html Acknowledgments. The au thor thanks G. Gonzato for pro - viding the executable version of the VSBC pro gram and D. J. Lowe and oth ers for smooth ing the Eng lish ver sion of the text. REFERENCES ANGELES G. R., PERILLO M. E., PICCOLO M. C. and PIERINI J. O. (2004) Fractal anal y sis of tidal chan nels in the Bahía Blanca Es tu - ary (Ar gen tina). Geo mor phol ogy, 57: 263 274. BARKER J. A. (1988) Gen er al ized ra dial flow model for hy drau lic tests in frac tured Rock. Wa ter Resour. Res., 24 (10): 1796 1804. BARTON C. C. (1995) Fractal anal y sis and spa tial clus ter ing of frac - tures. In: Frac tals in the Earth Sci ences (eds. C. C. Barton and P. R. La Pointe): 141 178. Ple num Press, New York. BONNET E., BOUR O., ODLING N. E., DAVY P., MAIN I., COWIE P. and BERKOWITZ B. (2001) Scal ing of frac ture sys tems in geo log - i cal me dia. Rev. Geophys., 39 (3): 347 383. BORRADAILE G. (2003) Sta tis tics of Earth Sci ence Data. Springer, Berlin. BREWER J. and DI GIROLAMO L. (2006) Lim i ta tions of fractal di - men sion es ti ma tion al go rithms with im pli ca tions for cloud stud ies. Atmos. Res., 82: 433 454. DILLON C. G., CAREY P. F. and WORDEN R. H. (2001) Fractscript: a macro for cal cu lat ing the fractal di men sion of ob ject per im e ters in im - ages of mul ti ple ob jects. Comput. Geosc., 27: 787 794. DOUGHTY C. and KARASAKI K. (2002) Flow and trans port in hi er ar - chi cally frac tured rock. J. Hydrol., 263: 1 22. FEDER J. (1988) Frac tals. Ple num Press, New York. FOROUTAN-POUR K., DUTILLEUL P. and SMITH D. L. (1999) Ad - vances in the im ple men ta tion of the box-count ing method of fractal di - men sion es ti ma tion. Appl. Math. Comput., 105: 195 210. GONZATO G. (1998) A prac ti cal im ple men ta tion of the box count ing al go rithm. Comput. Geosc., 24 (1): 95 100. HART-DAVIS G. (1999) Mas ter ing VBA 6. Sybex, San Fran cisco, CA. KUSUMAYUDHA S. B., ZEN M. T., NOTOSISWOYO S. and SAYOGA GAUTAMA R. (2000) Fractal anal y sis of the Oyo River, cave sys - tems, and to pog ra phy of the Gunungsewu karst area, cen tral Java, In - do ne sia. Hydrogeol. J., 8: 271 278. MANDELBROT B. (1983) The Fractal Ge om e try of Na ture. W. H. Free man & Co., New York. PATRICK T., ROMAN S., PETRUSHA R. and LOMAX P. (2006) Vi - sual Ba sic 2005 in a nut shell. O Reilly Me dia, Sebastopol, CA. PEITGEN H-O., JÜRGENS H. and SAUPE D. (2004) Chaos and frac - tals. New Fron tiers of Sci ence. Springer-Verlag, New York. POLEK J., KARASAKI K., LONG J. C. S. and BARKER J. A. (1990) Flow to Wells in Frac tured Rock with Fractal Struc ture. De part ment of Ma te rial Sci ence and Min eral En gi neer ing. Univ. Cal i for nia, Berke - ley. Rep. LBL-27900, Law rence Berke ley Lab o ra tory, Berke ley, Cal i - for nia: 74 76. SCHULLER D. J., RAO A. R. and JEONG G. D. (2001) Fractal char ac - ter is tics of dense stream net works. J. Hydrol., 243: 1 16. TANG D. and MARANGONI A. G. (2006) 3D fractal di men sion of fat crys tal net works. Chem. Phys. Lett., 433: 248 252. TURCOTTE D. L. (1992) Frac tals and Chaos in Ge ol ogy and Geo phys - ics. Cam bridge Univ. Press, Cam bridge. VALLEJO L. E. (1997) Frac tals in en gi neer ing ge ol ogy. Pref ace. Eng. Geol., 48: 159 160. VENEZIANO D. and NIEMANN J. D. (2000) Self-sim i lar ity and multifractality of flu vial ero sion to pog ra phy. Math e mat i cal con di tions and phys i cal or i gin. 1. Wa ter Resour. Res., 36 (7): 1923 1936. VERBOVŠEK T. (2008) Diagenetic ef fects on the well yield of do lo - mite aqui fers in Slovenia. En vi ron. Geol., 53 (6): 1173 1182. WALSH J. J. and WATTERSON J. (1993) Fractal anal y sis of frac ture pat terns us ing the stan dard box-count ing tech nique. Valid and in valid meth od ol o gies. J. Struct. Geol., 15 (12): 1509 1512.