Fractals: Gwyddion Library Reference Manual

## Fractals Fractals — Fractal dimension calculation, fractal interpolation |

## Functions

void | gwy_field_fractal_partitioning ()
void | gwy_field_fractal_cubecounting ()
void | gwy_field_fractal_triangulation ()
void | gwy_field_fractal_psdf ()
void | gwy_field_fractal_hhcf ()
gdouble | gwy_field_fractal_cubecounting_dim ()
gdouble | gwy_field_fractal_triangulation_dim ()
gdouble | gwy_field_fractal_partitioning_dim ()
gdouble | gwy_field_fractal_psdf_dim ()
gdouble | gwy_field_fractal_hhcf_dim ()
void | gwy_field_fractal_correction ()

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

## Functions

### gwy_field_fractal_partitioning()

    void
    gwy_field_fractal_partitioning (GwyField *field,
                                    GwyLine *xresult,
                                    GwyLine *yresult,
                                    GwyInterpolationType interpolation);

Computes data for log-log plot by partitioning (variance).

Data lines `xresult` and `yresult` will be resized to the output size and they will contain corresponding values at each position.

#### Parameters

field | A data field. |
xresult | Data line to store x-values for log-log plot to. |
yresult | Data line to store y-values for log-log plot to. |
interpolation | Interpolation type. |

### gwy_field_fractal_cubecounting()

    void
    gwy_field_fractal_cubecounting (GwyField *field,
                                    GwyLine *xresult,
                                    GwyLine *yresult,
                                    GwyInterpolationType interpolation);

Computes data for log-log plot by cube counting.

Data lines `xresult` and `yresult` will be resized to the output size and they will contain corresponding values at each position.

#### Parameters

field | A data field. |
xresult | Data line to store x-values for log-log plot to. |
yresult | Data line to store y-values for log-log plot to. |
interpolation | Interpolation type. |

### gwy_field_fractal_triangulation()

    void
    gwy_field_fractal_triangulation (GwyField *field,
                                     GwyLine *xresult,
                                     GwyLine *yresult,
                                     GwyInterpolationType interpolation);

Computes data for log-log plot by triangulation.

Data lines `xresult` and `yresult` will be resized to the output size and they will contain corresponding values at each position.

#### Parameters

field | A data field. |
xresult | Data line to store x-values for log-log plot to. |
yresult | Data line to store y-values for log-log plot to. |
interpolation | Interpolation type. |

### gwy_field_fractal_psdf()

    void
    gwy_field_fractal_psdf (GwyField *field,
                            GwyLine *xresult,
                            GwyLine *yresult,
                            GwyInterpolationType interpolation);

Computes data for log-log plot by spectral density method.

Data lines `xresult` and `yresult` will be resized to the output size and they will contain corresponding values at each position.

#### Parameters

field | A data field. |
xresult | Data line to store x-values for log-log plot to. |
yresult | Data line to store y-values for log-log plot to. |
interpolation | Interpolation type. The argument has no effect. It exists to keep the same signature as the other functions. |

### gwy_field_fractal_hhcf()

    void
    gwy_field_fractal_hhcf (GwyField *field,
                            GwyLine *xresult,
                            GwyLine *yresult);

Computes data for log-log plot by structure function (HHCF) method.

Data lines `xresult` and `yresult` will be resized to the output size and they will contain corresponding values at each position.

#### Parameters

field | A data field. |
xresult | Data line to store x-values for log-log plot to. |
yresult | Data line to store y-values for log-log plot to. |

### gwy_field_fractal_cubecounting_dim()

    gdouble
    gwy_field_fractal_cubecounting_dim (GwyLine *xresult,
                                        GwyLine *yresult,
                                        gdouble *a,
                                        gdouble *b);

Computes fractal dimension by cube counting method from log-log plot data.

The `xresult` and `yresult` data lines are usually calculated by `gwy_field_fractal_cubecounting()`.

#### Parameters

xresult | Log-log fractal data (x values). |
yresult | Log-log fractal data (y values). |
a | Location to store linear fit constant to. | [out]
b | Location to store linear fit slope to. | [out]

#### Returns

The fractal dimension.

### gwy_field_fractal_triangulation_dim()

    gdouble
    gwy_field_fractal_triangulation_dim (GwyLine *xresult,
                                         GwyLine *yresult,
                                         gdouble *a,
                                         gdouble *b);

Computes fractal dimension by triangulation method from log-log plot data.

The `xresult` and `yresult` data lines are usually calculated by `gwy_field_fractal_triangulation()`.

#### Parameters

xresult | Log-log fractal data (x values). |
yresult | Log-log fractal data (y values). |
a | Location to store linear fit constant to. | [out]
b | Location to store linear fit slope to. | [out]

#### Returns

The fractal dimension.

### gwy_field_fractal_partitioning_dim()

    gdouble
    gwy_field_fractal_partitioning_dim (GwyLine *xresult,
                                        GwyLine *yresult,
                                        gdouble *a,
                                        gdouble *b);

Computes fractal dimension by partitioning (variance) method from log-log plot data.

The `xresult` and `yresult` data lines are usually calculated by `gwy_field_fractal_partitioning()`.

#### Parameters

xresult | Log-log fractal data (x values). |
yresult | Log-log fractal data (y values). |
a | Location to store linear fit constant to. | [out]
b | Location to store linear fit slope to. | [out]

#### Returns

The fractal dimension.

### gwy_field_fractal_psdf_dim()

    gdouble
    gwy_field_fractal_psdf_dim (GwyLine *xresult,
                                GwyLine *yresult,
                                gdouble *a,
                                gdouble *b);

Computes fractal dimension by spectral density function method from log-log plot data.

The `xresult` and `yresult` data lines are usually calculated by `gwy_field_fractal_psdf()`.

#### Parameters

xresult | Log-log fractal data (x values). |
yresult | Log-log fractal data (y values). |
a | Location to store linear fit constant to. | [out]
b | Location to store linear fit slope to. | [out]

#### Returns

The fractal dimension.

### gwy_field_fractal_hhcf_dim()

    gdouble
    gwy_field_fractal_hhcf_dim (GwyLine *xresult,
                                GwyLine *yresult,
                                gdouble *a,
                                gdouble *b);

Computes fractal dimension by structure function (HHCF) method from log-log plot data.

The `xresult` and `yresult` data lines are usually calculated by `gwy_field_fractal_hhcf()`.

#### Parameters

xresult | Log-log fractal data (x values). |
yresult | Log-log fractal data (y values). |
a | Location to store linear fit constant to. | [out]
b | Location to store linear fit slope to. | [out]

#### Returns

The fractal dimension.

### gwy_field_fractal_correction()

    void
    gwy_field_fractal_correction (GwyField *field,
                                  GwyNield *mask,
                                  GwyInterpolationType interpolation);

Replaces data under mask with interpolated values using fractal interpolation.

The data should preferrably be square and with pixel size a power of 2. The function does not require it, but data not satisfying this condition are resampled back and forth using given interpolation.

#### Parameters

field | A data field. |
mask | Mask of places to be corrected. |
interpolation | Interpolation type. |