Fractal Dimension - 2D Box Counting

Fractal Dimension - 2D Box Counting

Using this facility in DigImage, the fractal dimension (Kolmogorov capacity) of a selected intensity contour may be evaluated using the standard box counting algorithm. With this technique the image is broken up into a number of equal sized (approximately square) boxes. The number of boxes containing a section of the required intensity contour is counted. The process is then repeated with a different size of box. The fractal dimension of the contour is related to the slope of the relationship between the logarithm of the number of boxes through which the contour passes and the logarithm of the size of the boxes. A linear relationship between these two is an indication of self-similarity, the key feature of fractal contours. As an option, DigImage is able to produce a plot of this information, along with estimates of the slope of the relationship. By producing such a plot, the degree to which a contour is fractal may be visualised.

Note that this technique is very similar to [G Fractal dimension - 1D line counting].

RETURN VALUES DigImage fits a power law to the data using a least-squares fit in log-log space. This fit is plotted along with the raw data, and the fit printed out. The coefficients fitted are also available through the !!Rn mechanism:

           !!R0    The scale factor for the fit.
           !!R1    The power law - this is the "fractal dimension"
           !!R2    The root mean square error in the fit.

Note that you will normally require a E, F or G modifier to return the floating point representation of these return variables (e.g. !!GR1).

Dimension of which buffer ?

The fractal dimension of a specific intensity contour may be calculated on a list of buffers. Any valid DigImage buffer may be used.

Calculate dimension in Window or whole Screen ?

The contour on which the dimension is based may be limited to a window (<W>) within a buffer, or the entire buffer (<S>) may be used.

Specify Window: Region to calculate dimension from

The window specification submenu will be produced only if a window (<W>) is selected in the previous entry. Only boxes falling within the window will be used in the fractal dimension calculations. The window is specified in the normal DigImage manner. For further details, consult [H Help] within the submenu.

Dimension of what threshold ?

This entry specifies the intensity level which is to be used for locating the contour on which the fractal dimension is to be calculated.

Name of file to write data to (blank to suppress, .PLT default extension) ?

The box counts and sizes may be written to the formatted file specified by this field. In addition to the fractal data, this file contains plot instructions for use by DigiPlot. The formatted output may be suppressed by entering a blank line.

Produce log-log plot on what buffer (-1 for computer monitor) ?

As an option, a log-log plot of the number of boxes verses the size of the box may be produced on one of the buffers. The least squares estimate of the line of best fit is also plotted. The plot may be produced on any valid buffer. This buffer is made the current output buffer. A value of -1 is used to indicate that the plot is to be produced on the computer monitor.

{If plotting on buffer}

Erase plot buffer first ?

This entry determines whether the plot buffer specified at the previous prompt will be erased before plotting the fractal dimension data.

Name of output PostScript file (blank to suppress; .PS for printable PostScript .EPS for encapsulated PostScript, or .DPS for data only PostScript) ?

Specifying a file in response to this prompt will cause a PostScript description of the output to be placed in the file. The file will subsequently need to be transfered to a suitable PostScript printer to enable the hard copy to be produced. Entering a blank line suppresses the production of the PostScript file.

Encapsulated PostScript (.EPS) and Data Only PostScript (.DPS) can not be printed directly, except using DigiFile. Normally they would be included within some other package (eg. a word processor) to be printed. The .DPS file is a special version of .EPS which does not contain the normal DigImage\PostScr\Header.PS and DigImage\PostScr\GraphVDU.PS header files. These may need to be added to the PostScript prolog used by the application into which the .DPS file is inserted.

If no extension is specified, then the default PostScript type specified in [;P Printers] in CONFIGUR.EXE will be produced, and the appropriate extension added.

This file may be sent to the printer immediately by specifying PRN as the file name.

{If PostScript file specified} Default, Line, Greyscale or Colour printing ? DigImage is able to produce either grey-scale or colour PostScript files. The Default option is controlled by the setting in the Configur.EXE utility. If colour is selected, then the file MUST be printed on a level 2 (or higher) PostScript printer.

        Default                 Colour type specified in Configur.EXE
        Line                    Greyscale images and dashed line types
        Greyscale               Greyscale images and greyscale lines
        Colour                  Colour images and colour lines - requires
                                Level 2 PostScript

Message:
Fractal dimension: !!R1=!!FR1


Parent menu

Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996